Home > database >  How can I specify region in `CodeBuildAction` in AWS CDK?
How can I specify region in `CodeBuildAction` in AWS CDK?

Time:12-11

I am deploying a AWS codepiepline which includes cross region action in each stage. I am using CodebuildAction (https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codepipeline-actions.CodeBuildAction.html) inside stage of the pipeline and define all the build commands inside the action.

However, I can't see there is any parameter I can specify a region when create CodebuildAction instance. It is always run from the default region. How can I specify the region for CodebuildAction?

CodePudding user response:

You would need to create the CodeBuild Project in another region, then import it with Project.fromProjectArn() when creating the action. The action's region is determined by the Project's region.

CodePudding user response:

CodeBuildAction inherits from Action which takes ActionProperties as input parameter. So this is where you specify region.

  • Related