awsdocs / aws-cdk-guide

User guide for the AWS Cloud Development Kit (CDK).
Other
335 stars 222 forks source link

Cross Account Pipeline Getting Failed with No IAM Role Found. #329

Closed rajnikhil17 closed 3 years ago

rajnikhil17 commented 3 years ago

I am trying to create a cross-account pipeline in python i.e, Pipeline will be in dev, it should be able to deploy into the production account. I found CloudFormationCreateUpdateStackAction construct in CDK python documentation, I have added two stages, one for deploying the stack into dev and another stage for deploying the stack into production, I was able to deploy the stack in dev with no issues, In the dev deployment stage, I am not passing any role parameters for dev. I see attributes for the CloudFormatonCreateUpdateStackAction construct as deployment_role and role, Created Cross-Account Role and Another Role for Deploying CloudFormaton Stack in Production Account. I am trying to pass the above roles in the construct, once I deploy the Pipeline Stack, It is throwing the error like, The role with the name CrossAccountRole cannot be found..

Please find the code attached as Images,

Line 1-29 Line 30-58 Line 58-84 Line 82-110 Line 110-138 Line 138-166 Line 165-190