aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Proposal: Use template credentials for sam local

Open rustyautopsy opened this issue 5 years ago • 1 comments

The goal here is to be able to properly test the configured IAM Roles/Policies for the Lambda(s) before deploying, running, dig through logs, find the error, update Lambda and repeat.

To do this I am thinking of doing the following, I would love to know if there is a better way.

  • parse SAM template for Functions
  • create an IAM user "sam-local-function-name"
  • UPSERT ~/.aws/config & ~/.aws/credentials
  • UPSERT Polices/Roles defined in the template to the "sam-local-function-name" user
  • execute sam local invoke… —profile sam-local-<function-name>

rustyautopsy avatar Mar 22 '19 14:03 rustyautopsy

I agree that this would be a great feature. In terms of implementation, I would much more prefer something like the policy simulator (docs).

bramkoot avatar Mar 22 '19 18:03 bramkoot

This is a duplicate of https://github.com/aws/aws-sam-cli/issues/332, which was closed. Closure response can be found here: https://github.com/aws/aws-sam-cli/issues/332#issuecomment-1218371195

jfuss avatar Aug 31 '22 15:08 jfuss