Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAM Deploy Blocked #6083

Closed
desert-digital opened this issue Oct 14, 2023 · 3 comments
Closed

SAM Deploy Blocked #6083

desert-digital opened this issue Oct 14, 2023 · 3 comments

Comments

@desert-digital
Copy link

I am using Visual Studio Code and the AWS Toolkit.

I have two account (for different projects), let's call them account_number_1 and account_number_2, and I am unable to deploy my SAM project to the second account. The error that I get is:```
An error occurred (AccessDenied) when calling the CreateChangeSet operation: User: arn:aws:iam::<account_number_1>:user/amplify-elys is not authorized to perform: cloudformation:CreateChangeSet on resource: arn:aws:cloudformation:us-west-1:<account_number_1>:stack/aws-sam-cli-managed-default/* because no identity-based policy allows the cloudformation:CreateChangeSet action

I changed the profile using the AWS Toolkit to the second account, and verified that the aws_access_key_id and the aws_secret_access_key are correct.

Is there a SAM configuration file that needs to be changed? Why is the SAM CLI picking up a user from account_number_1?

@desert-digital desert-digital added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Oct 14, 2023
@mndeveci
Copy link
Contributor

I changed the profile using the AWS Toolkit

I am not sure if AWS Toolkit provides an alternative way for setting credentials. SAM CLI uses default way to use credentials (either through ~/.aws/credentials file or via environment variables). You could either;

@mndeveci mndeveci added area/credentials area/profiles area/deploy sam deploy command and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Oct 18, 2023
@desert-digital
Copy link
Author

desert-digital commented Oct 22, 2023

This worked! Thanks so much. I was unaware of the profile flag. It appears that the AWS Toolkit modifies the ~/.aws/credentials file, but then doesn't use the flag!?!

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants