-
Notifications
You must be signed in to change notification settings - Fork 4k
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
app-staging-synthesizer: get S3 access denied error on stack deployment #27434
Comments
Can you please provide how you're setting the region for deployment? A minimal working example would be best. |
Hi @indrora, I noticed that I forget to set
The reproduction code is here: #!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { AppStagingSynthesizer, DeploymentIdentities } from '@aws-cdk/app-staging-synthesizer-alpha';
const app = new cdk.App({
defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
appId: 'my-app-id',
deploymentIdentities: DeploymentIdentities.defaultBootstrapRoles({ bootstrapRegion: 'us-east-1' }),
}),
});
new cdk.Stack(app, 'StagingSynthesizerStack'); And run the following command: AWS_REGION=us-east-1 npx cdk bootstrap
AWS_REGION=us-west-2 npx cdk deploy StagingSynthesizerStack Can you reproduce this? Not quite sure if I'm using this feature correctly though. |
In v2.147.3, the same code seems to cause an error about the original cfn-exec-role error instead of the S3 validation error. I am not sure about the S3 validation error, but as for the error about cfn-exec-role error, the aws-cdk/packages/@aws-cdk/app-staging-synthesizer-alpha/lib/default-staging-stack.ts Line 262 in 358cead
Since the arn of the CFn Execution Role is not passed as an argument when initializing the
So, I think it is necessary to correctly initialize the Maybe relates #28195. |
Describe the bug
Also see the comment: #27434 (comment)
Hi, in the article about AppStagingSynthesizer recently published, we can see the following description about IAM roles to deploy stacks.
So I expect that a cdk app using AppStagingSynthesizer can be deployed to any region if we've done cdk bootstrapping in one region. However, currently it seems that we need to bootstrap in each region we're deploying to.
I'd like to make sure if it is expected or not. Maybe a documentation error? Thanks.
Expected Behavior
A cdk app using AppStagingSynthesizer can be deployed to any region if we've done cdk bootstrapping in one region.
Current Behavior
We need to bootstrap in each region we're deploying to.
Reproduction Steps
Bootstrap a region e.g. us-east-1.
Then, when I try to deploy a cdk app using AppStagingSynthesizer to another region without bootstrapping, I get the following error:
The role name contains region
eu-west-2
, so it seems we have to bootstrap eu-west-2 first.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.98.0
Framework Version
2.98.0
Node.js Version
v18.13.0
OS
macOS
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: