-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
codepipeline: Cross region pipelines don't work after updating to 2.80.0 or newer #26633
Comments
I'm not able to reproduce this @makemefeelgr8, this setup is working for me post If this doesn't help, I will need an SSCCE. It helps the team save time when we can work on fixing bugs rather than spending more time reproducing issues to find the root cause. |
@peterwoodworth Thanks for trying it out! I really appreciate that. Let me do my best to help you with reproducing the issue. While this example looks like something one shouldn't actually do, it's the easiest way to reproduce the issue. Here are the steps:
And here's the code: import { App, Stack, StackProps, Stage, StageProps } from 'aws-cdk-lib';
import { LinuxBuildImage } from 'aws-cdk-lib/aws-codebuild';
import { Pipeline } from 'aws-cdk-lib/aws-codepipeline';
import { CodeBuildStep, CodePipeline, CodePipelineSource } from 'aws-cdk-lib/pipelines';
import { Construct } from 'constructs';
const account = '1234567890'; // your account id
// a stage with 1 empty stack
class MyTestStage extends Stage {
constructor(scope: Construct, id: string, props: StageProps) {
super(scope, id, props);
new Stack(this, 'MyTestStackFromStage', {
env: {
account: account,
region: 'eu-central-1'
}
});
}
}
class MyTestPipelineStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
const myPipeline = new CodePipeline(this, 'MyTestCodePipeline', {
cliVersion: '2.80.0',
selfMutation: true,
synth: new CodeBuildStep('MyTestCodeBuildStep', {
buildEnvironment: {
buildImage: LinuxBuildImage.AMAZON_LINUX_2_4,
privileged: true
},
primaryOutputDirectory: 'cdk.out',
installCommands: ['n 16.17.1'],
commands: ['npm i', 'npx aws-cdk@2.80.0 synth'],
input: CodePipelineSource.connection(
// replace with your own connection
'your_repo/your_repo',
'your_branch',
{
connectionArn: 'your_connection_arn',
triggerOnPush: false
}
)
}),
codePipeline: new Pipeline(this, 'MyTestInnerCodePipeline', {
crossAccountKeys: false
}),
});
myPipeline.addStage(new MyTestStage(this, 'MyTestStage', props));
}
}
// and now deploy all of the above
const myTestApp = new App();
const myPipeline = new MyTestPipelineStack(myTestApp, 'MyTestPipelineStack', {
env: {
account: account,
region: 'us-west-2'
}
});
myPipeline.addDependency(
new Stack(myTestApp, 'MyTestDependencyStackIn-eu-central-1', {
env: {
account: account,
region: 'eu-central-1'
}
})
); |
@peterwoodworth is this one not going to be addressed? Should I just close this issue and open a new one? |
Hi @makemefeelgr8 I am helping you to investigate this issue and sorry for the delayed response. As it's been a while, does this issue still exist in the latest CDK 2.111.0 ? If yes, please let me know and I'll try my best to help. |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Describe the bug
A pipeline fails to deploy a stack into another region after updating to 2.80.0 (or newer).
Expected Behavior
I expect the deployment to succeed.
Current Behavior
There's a pipeline located in
us-west-2
that deploys a stack into a different region (eu-central-1
).It works great on aws cdk v2.79.1. Here's the log:
After updating to v2.80.0, the pipeline fails with the folowing error:
As you can see, in
2.79.1
, the pipeline automatically assumed the role which is required to access SSM in a different region. But, starting from2.80.0
, the pipeline does not do that anymore. Instead, it tries to access resources ineu-central-1
with its defaultus-west-2
role, which obviously fails.Reproduction Steps
A repo? A SSCEE standard? Do you really expect me to spend half of my day to create a repo and make sure the code fits requirements? You're the ones who broke pipelines- go fix them yourselves!
Seriously, though, the issue is as easy to reproduce as it gets- just make a pipeline that deploys a stack into a different region.
Possible Solution
Take a look at what happened in 2.80.0 and rollback features 1 by 1 to get to the point when it works.
Additional Information/Context
No response
CDK CLI Version
2.80.0 (build bbdb16a)
Framework Version
No response
Node.js Version
16.17.0
OS
Windows 11; Amazon Linux 2 x86_64 version 4
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: