3.Setting Up AWS Lambda
What is AWS? Amazon Web Services (AWS) is a lead cloud computing platform. AWS provides servers, storage, networking, remote computing, email, mobile development, and security.
Last updated
What is AWS? Amazon Web Services (AWS) is a lead cloud computing platform. AWS provides servers, storage, networking, remote computing, email, mobile development, and security.
Last updated
AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources for you. You can use AWS Lambda to extend other AWS services with custom logic, or create your own back-end services that operate at AWS scale, performance, and security.
While the entire setup make sure the region selected as Mumbai . This can be seem at the top right near to the username.
This should be ensured while creating both Lambda Function and Lambda Layer
You can complete the Sign Up process as mentioned in the video
Select Lambda from the services section or you can search in the search bar
Now click on Create Function
5. Give a Function name of your choice and Runtime as Python 3.7 and click on Create Function
6. Now click on Upload from followed by select .zip . Now choose LambdaFunction.zip that is shared
7. Fill the details of the token.json
, credentials.json
with the content which you have in the folder
8. Go the the Configuration tab and select General Configuration and click on edit
Now click on Edit. Provide Memory as 1024 MB and time out as 7 min (you can reduce to 5 min also) and Save
9. Navigate to Environmental Variables section under the same Configuration Tab and click on Edit
10. Fill the fields with your credentials and Save
11. Now click on Add trigger and search EventBridge(CloudWatch Events)
12. Provide the details as follows
Rule name : dailyAuthenticate
Schedule expression : cron(30 3 ? * MON-FRI *)
here 30 represent minute and 3 is the hour.We need to provide GMT Time here.So 3:30AM GMT is 9:00 AM IST
You can use any other time if you what to authorise with help of this converter https://savvytime.com/converter/gmt-to-ist
Also you can add multiple trigger as well.Click on Add
13 . Now we can add a Lambda layer
A Lambda layer is an archive containing additional code, such as libraries, dependencies, or even custom runtimes. When you include a layer in a function, the contents are extracted to the /opt directory in the execution environment.
search S3 in the search bar and select first option
14 . Now click on Create bucket
15. Give a bucket name and leave the rest of the options as default and create bucket
16. Select the bucket and click on Upload and upload LambdaLayer.zip
17. Now select the LambdaLayer.zip and copy the URL
18. Now go back to Lambda service and select Layers followed by Create Layer
19. Provide Layer Configuration as follow
Don't forget to paste the URL in that text box and click on Create
Now go back to the page of Lambda function where the code is available , scroll to the bottom and click on Add Layer
From Custom Layers select the Layer you have just created ( here its cdsl ) and click on Add
Before Testing you must ensure that "Conversation View" is turned OFF in the GMail settings.
Note : Refer to Version History for an update
We are almost over now
Now Click on Deploy and Test , you will be able to see the OTP from CDSL . Our Authorisation has been done successfully , now you call sell your stock from Holdings without manual authorization