I created a user, assigned admin access and configured key in my local, but when I run sls deploy command I am getting error.
ServerlessError: User: arn:aws:iam::660841947412:user/vagrant is not authorized to perform: cloudformation:DescribeStacks on resource: arn:aws:cloudformation:us-east-1:660841947412:stack/simple-dev/*
I don’t know why I am getting the error because the key, and secret I set has admin access. And why user name is user/vagrant, because the user associated with key, and secret has different name on aws. how do I change it ?
I set aws credentials in credentials file as per serverless documentation.
and then running sls deploy command.
I am begineer with serverless, I don’t know how to specify user during deployment. I believe it is using credentails set but user name is not correct. How do I set that ?
Can I assume this means you’re setting the default profile then running sls deploy without specifying a profile on the command line or setting profile inside your serverless.yml? The Serverless Framework uses the AWS SDK and it’s mechanism for selecting which profile to use unless you specify it. The chances are it’s being overridden by an environment variable somewhere. Trying renaming the profile in your credentials file then deploy using
If you don’t explicitly set the profile then the AWS SDK has a process for determining which one to use. If you want to understand more then read the AWS Guide.
My best guess is you’re setting the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables somewhere.