I am trying to deploy a simple lambda funtcion with the serverless framework. My IAM user doesn't have the necessary permissions to run cloudformation:
User: arn:aws:iam::xxx:user/xxx is not authorized to perform: cloudformation:DescribeStacks on resource: arn:aws:cloudformation:us-east-1:xxx:stack/xx
That's more or less intended, since our setup is using IAM roles to perform certain tasks. I have configured those roles in my ~/.aws/config file, and for aws cli operations I can e.g. call
aws s3 ls --profile myrole
in that way I attach all policies from the role 'myrole' to my IAM user to execute the aws-cli command.
Is there any way of doing something similar for serverless, i.e. attaching a role (not a different user) to the
serverless depoly
statement?
If I change the role via export
AWS_PROFILE=myrole
or call
serverless deploy --aws-profile myrole
I get Error: Profile myrole does not exist
even though the role is defined in /.aws/credentials
and ~/.aws/config