Search code examples
amazon-web-serviceslambdaserverless

AWS application composer - is there any way to specify additional IAM POLICY


I am using AWS application composer to create my serverless stack.

Specifically on Lambdas, i need to add additional IAM policies that have been included in my Lambda code logic. For example, some of the AWS service IAM policies access. I know I can add the additional access after deployment at the AWS IAM page, however this is not ideal especially we might forget or it would be difficult to pass the setup code and templates to other teams.

Any insights? Thanks.

I have searched the reference or documentation but could not find any workaround.


Solution

  • If you are referring to policies attached to Lambda service role, you can add it.

    Since Application Composer uses SAM AWS::Serverless::Function templating, you should be able to add it under the Policies field, it is in the Application Composer console under Details as well (you need to scroll down to the bottom)

    https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html#sam-function-policies

    As stated in the documentation -

    This property accepts a single string or a list of strings, and can be the name of AWS managed policies or AWS SAM policy templates, or inline IAM policy documents formatted in YAML.

    You can try to add that in. For example:enter image description here