Aws-cdk: Region config for S3DeployAction

Created on 25 Mar 2020  路  8Comments  路  Source: aws/aws-cdk


Please add region configuration in S3DeployAction for cross-region deployment.

Use Case


I have a pipeline that supports cross-region deployment in us-west-2. A deployment stage of my pipeline looks like:

*Pipeline is in us-west-2
...
Deploy stage:
CF                 CF
(us-east-1)    (us-west-2)
 |
S3
(us-east-1)
...

I can set region for CloudFormationCreateUpdateStackAction, so it can support cross region deployment. However, S3DeployAction does not have region config in S3DeployActionProps. The target S3 bucket is created by the us-east-1 CF action above and the bucket is located in us-east-1. Therefore, S3DeployAction fails with the below message in console:

Invalid action configuration
The bucket named [BUCKET_NAME] is not located in the us-west-2 AWS region

I manually changed the region of the action in the console to resolve the problem.

Proposed Solution


It would be great if you can add region to S3DeployActionProps and support cross-region deployment for S3DeployAction.

Other

  • [ ] :wave: I may be able to implement this feature request
  • [ ] :warning: This feature might incur a breaking change

This is a :rocket: Feature Request

@aws-cdaws-codepipeline @aws-cdcore efformedium feature-request in-progress

Most helpful comment

@adrian-hincu yes. We're very close to finalizing this in #8280 . Then, you would be able to do:

const myBucket = s3.Bucket.fromBucketAttributes(this, 'Bucket', {
  bucketName: 'my-bucket',
  region: 'my-region',
});

And when you used that Bucket in the deploy Action, it would correctly set its region to 'my-region'.

All 8 comments

Hey @handk85 ,

how are you referencing this bucket created by the CF action and used in S3DeployAction? Are you using a method like Bucket.fromBucketName() to do it?

Yes, I am using Bucket.fromBucketName() and provide it to bucket property of S3DeployActoin.

Then you need to import the Bucket with fromBucketName into a Stack that is in the region you want (in your case, us-east-1). When that happens, the CodePipeline construct will recognize that situation, and correctly fill the configuration of the action so that it points to us-east-1.

Any progress on this one?

Any updates on this? :) I would also like to specify the bucket region, cause my pipeline is in eu-west-2 and my bucket is in us-east-1. Since it can be done manually from the GUI, I'm guessing there's a way to be done from CDK as well.

@adrian-hincu yes. We're very close to finalizing this in #8280 . Then, you would be able to do:

const myBucket = s3.Bucket.fromBucketAttributes(this, 'Bucket', {
  bucketName: 'my-bucket',
  region: 'my-region',
});

And when you used that Bucket in the deploy Action, it would correctly set its region to 'my-region'.

@skinny85, was this just released in 1.61.0? :)

In 1.60.0 actually 馃檪

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kawamoto picture kawamoto  路  3Comments

mirazmamun picture mirazmamun  路  3Comments

artyom-melnikov picture artyom-melnikov  路  3Comments

eladb picture eladb  路  3Comments

Kent1 picture Kent1  路  3Comments