Sunday, October 18, 2020

Use Eclipse to develop AWS lambda

 

1. Setup AWS Toolkit in Eclipse [1]

2. Setup AWS credentials [2]

    The instructions are not quite clear. A few steps required here:

     (1) Create an IAM user without any permissions boundaries

     (2) Add permissions for Lambda, S3, CloudFormation and iam (Inline policy). For iam, the iam:CreateRole is required [3]. But I added full access.


         Note: if there is any error in deploying the lambda, check the missing permssions in CloudFormation events or the AWS console in Eclipse.

3. Create a AWS serverless Java project with hello-world blueprint [4]

4. Deploy the project 

     













5. Test lambda. In lambda service in AWS console (Be sure in the right region), add test event 

"TestInput"

The run the lambda. Check the logs in CloudWatch logs.

 

Ref:

[1] https://docs.aws.amazon.com/toolkit-for-eclipse/v1/user-guide/setup-install.html

[2] https://docs.aws.amazon.com/toolkit-for-eclipse/v1/user-guide/setup-credentials.html

[3] https://medium.com/@jun711.g/authorizing-aws-cloudformation-role-to-perform-iam-createrole-on-resources-2928e5ca5be7

[4] https://docs.aws.amazon.com/toolkit-for-eclipse/v1/user-guide/serverless-projects.html


No comments:

Post a Comment