2

I am trying to execute serverless deploy command to deploy my lambda function.But it is showing

user is not authorized to perform: cloudformation:UpdateStack on resource: arn:aws:cloudformation:ap-south-1

What policy should be attached to deploy lambda function?

2 Answers 2

1

AWS user you are using for deploying serverless template should have updateStack permission for cloudformation.

{ "Effect":"Allow", "Action": "cloudformation:UpdateStack", "Resource":"*" }

Use policy simulator to check if user has required permissions.

Sign up to request clarification or add additional context in comments.

2 Comments

Can you please tell me how to set permission in details
@Dnyanesh Create a new policy in IAM with { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "cloudformation:*", "Resource": "*" } ] }. This provides full permission to cloudformation. Add this policy to the user you are using to deploy.
0

I simply created a user called "serverless-admin" with only "Programmatic Access" and attached the policy "AdministratorAccess". I DIDNT check the "AWS Management Console Access" feature. Then simply write down the "Key" and the "secret" and use that for configuring serverless aka aws client.

This way you can be sure that everything serverless does when it comes to deploying your stack is allowed. Perhaps you can do it more strict but this way you dont run into any issues.

1 Comment

I would recommend against creating a deploy user with full admin privileges, especially if you're going to store the key and secret somewhere. Either deploy as you using your current profile or create a deploy user with only the access it requires.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.