aws_codepipeline_actions: CloudFormationCreateUpdateStackAction cross account doesn't work #29552
Labels
@aws-cdk/aws-codepipeline-actions
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
I am trying to create a cross account pipeline which deploys a cloudformation stack in a different account using the CloudFormationCreateUpdateStackAction action as described here When creating the action using the imported role from the target account, cloudformation tries to attach a policy to the role in the pipeline account which leads to an error.
Stage Definition:
Expected Behavior
Additional policies which are attached to the role of the action should be attached in the target account and not in the pipeline account.
Current Behavior
Stack synthesizes and error is thrown during cloudformation deployment in pipeline account:
Resource handler returned message: "The role with name cdk-oac-cfn-exec-role-****-eu-central-1 cannot be found. (Service: Iam, Status Code: 404, Request ID: 27ec2f6b-110d-4556-a664-e0504ec5c126)" (RequestToken: bff8c0e2-eebc-8b10-7a16-df1d5ceec109, HandlerErrorCode: NotFound)
The error is thrown on a IAM Policy which grants access to the artifact bucket including KMS key.
Reproduction Steps
Follow the third example https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline-readme.html#cross-account-codepipelines
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.133.0 (build dcc1e75)
Framework Version
No response
Node.js Version
v18.17.1
OS
Windows
Language
TypeScript
Language Version
5.0.4
Other information
No response
The text was updated successfully, but these errors were encountered: