Piers Williams
01/25/2022, 5:02 PMsst deploy
on an EC2 instance as part of our build pipeline, and having problems getting it to use an AWS_PROFILE that resides in another account. In ~/.aws/config
the profile looks like so:
[profile sandbox]
role_arn = arn:aws:iam.../SandboxAdmin
region = eu-west-2
credential_source = Ec2InstanceMetadata
and the pipeline just tries to run AWS_PROFILE=sandbox sst deploy --stage test
, but the error I get is:
reparing your SST app
Deploying stacks
AccessDenied: User: arn:aws:sts::035571076409:assumed-role/GitlabRunner/i-0da27111607bdae26 is not authorized to perform: cloudformation:DescribeStacks on resource: arn:aws:cloudformation:eu-west-2:... because no identity-based policy allows the cloudformation:DescribeStacks action
Piers Williams
01/25/2022, 5:02 PM~/.aws/config
file have been used for a while in our terraform environment.
If I swap the ~/.aws/config
out and point [profile sandbox] at my own role_session_name
and then provide my credentials in ~/.aws/credentials
, it works.
Both my role and the GitlabRunner role have perms to assume this sandbox role in the other account. How do I correctly point at AWS profiles that the IAM role has permissions to assume, when using Ec2InstanceMetadata?Frank
Piers Williams
01/28/2022, 10:48 AMFrank
Frank
Piers Williams
02/03/2022, 10:20 AM