diff --git a/allowed-breaking-changes.txt b/allowed-breaking-changes.txt index 1adbf52a6d17d..905adead48088 100644 --- a/allowed-breaking-changes.txt +++ b/allowed-breaking-changes.txt @@ -55,3 +55,4 @@ removed:@aws-cdk/aws-elasticloadbalancingv2.ApplicationTargetGroup.metricIPv6Req removed:@aws-cdk/core.Fn.getAZs removed:@aws-cdk/aws-iam.UserProps.managedPolicyArns removed:@aws-cdk/aws-iam.GroupProps.managedPolicyArns +removed:@aws-cdk/aws-codepipeline.PipelineProps.crossRegionReplicationBuckets diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts index 721a91f465963..c3ec78648de85 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts @@ -40,7 +40,7 @@ interface CloudFormationActionProps extends codepipeline.CommonAwsActionProps { /** * The AWS region the given Action resides in. * Note that a cross-region Pipeline requires replication buckets to function correctly. - * You can provide their names with the {@link PipelineProps#crossRegionReplicationBuckets} property. + * You can provide their names with the {@link PipelineProps#artifactBuckets} property. * If you don't, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets, * that you will need to `cdk deploy` before deploying the main, Pipeline-containing Stack. * diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts index b7efe480d0de3..7794732b375b2 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts @@ -568,7 +568,7 @@ export = { }, }); const pipeline = new codepipeline.Pipeline(stack, 'MyPipeline', { - crossRegionReplicationBuckets: { + artifactBuckets: { 'us-west-1': s3.Bucket.fromBucketName(stack, 'ImportedBucket', 'sfo-replication-bucket'), }, }); @@ -678,17 +678,17 @@ export = { test.done(); }, - 'allows specifying only one of artifactBucket and crossRegionReplicationBuckets'(test: Test) { + 'allows specifying only one of artifactBucket and artifactBuckets'(test: Test) { const stack = new Stack(); test.throws(() => { new codepipeline.Pipeline(stack, 'Pipeline', { artifactBucket: new s3.Bucket(stack, 'Bucket'), - crossRegionReplicationBuckets: { + artifactBuckets: { // even an empty map should trigger this validation... }, }); - }, /Only one of artifactBucket and crossRegionReplicationBuckets can be specified!/); + }, /Only one of artifactBucket and artifactBuckets can be specified!/); test.done(); }, @@ -702,7 +702,7 @@ export = { }); const sourceOutput = new codepipeline.Artifact(); new codepipeline.Pipeline(stack, 'Pipeline', { - crossRegionReplicationBuckets: { + artifactBuckets: { [pipelineRegion]: new s3.Bucket(stack, 'Bucket', { bucketName: 'my-pipeline-bucket', }) diff --git a/packages/@aws-cdk/aws-codepipeline/README.md b/packages/@aws-cdk/aws-codepipeline/README.md index 3cabab4b31265..d32b0677555af 100644 --- a/packages/@aws-cdk/aws-codepipeline/README.md +++ b/packages/@aws-cdk/aws-codepipeline/README.md @@ -95,7 +95,7 @@ It works like this: ```ts const pipeline = new codepipeline.Pipeline(this, 'MyFirstPipeline', { // ... - crossRegionReplicationBuckets: { + artifactBuckets: { // note that a physical name of the replication Bucket must be known at synthesis time 'us-west-1': s3.Bucket.fromBucketName(this, 'UsWest1ReplicationBucket', 'my-us-west-1-replication-bucket'), diff --git a/packages/@aws-cdk/aws-codepipeline/lib/action.ts b/packages/@aws-cdk/aws-codepipeline/lib/action.ts index 8ab5c79d88042..06c8c8d53e1f9 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/action.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/action.ts @@ -34,7 +34,7 @@ export interface ActionProperties { /** * The AWS region the given Action resides in. * Note that a cross-region Pipeline requires replication buckets to function correctly. - * You can provide their names with the {@link PipelineProps#crossRegionReplicationBuckets} property. + * You can provide their names with the {@link PipelineProps#artifactBuckets} property. * If you don't, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets, * that you will need to `cdk deploy` before deploying the main, Pipeline-containing Stack. * diff --git a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts index cbc3e524f27de..832919ce19f0f 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts @@ -89,7 +89,7 @@ export interface PipelineProps { * * @default - None. */ - readonly crossRegionReplicationBuckets?: { [region: string]: s3.IBucket }; + readonly artifactBuckets?: { [region: string]: s3.IBucket }; /** * The list of Stages, in order, @@ -199,9 +199,9 @@ export class Pipeline extends PipelineBase { validateName('Pipeline', this.physicalName); - // only one of artifactBucket and crossRegionReplicationBuckets can be supplied - if (props.artifactBucket && props.crossRegionReplicationBuckets) { - throw new Error('Only one of artifactBucket and crossRegionReplicationBuckets can be specified!'); + // only one of artifactBucket and artifactBuckets can be supplied + if (props.artifactBucket && props.artifactBuckets) { + throw new Error('Only one of artifactBucket and artifactBuckets can be specified!'); } // If a bucket has been provided, use it - otherwise, create a bucket. @@ -237,8 +237,8 @@ export class Pipeline extends PipelineBase { this.artifactBucket.grantReadWrite(this.role); this.pipelineName = this.getResourceNameAttribute(codePipeline.ref); this.pipelineVersion = codePipeline.attrVersion; - this.crossRegionReplicationBuckets = props.crossRegionReplicationBuckets || {}; - this.crossRegionBucketsPassed = !!props.crossRegionReplicationBuckets; + this.crossRegionReplicationBuckets = props.artifactBuckets || {}; + this.crossRegionBucketsPassed = !!props.artifactBuckets; this.artifactStores = {}; // Does not expose a Fn::GetAtt for the ARN so we'll have to make it ourselves @@ -292,6 +292,8 @@ export class Pipeline extends PipelineBase { /** * Returns all of the {@link CrossRegionSupportStack}s that were generated automatically * when dealing with Actions that reside in a different region than the Pipeline itself. + * + * @experimental */ public get crossRegionSupport(): { [region: string]: CrossRegionSupport } { const ret: { [region: string]: CrossRegionSupport } = {}; @@ -451,9 +453,9 @@ export class Pipeline extends PipelineBase { if (props.artifactBucket) { return props.artifactBucket; } - if (props.crossRegionReplicationBuckets) { + if (props.artifactBuckets) { const pipelineRegion = this.requireRegion(); - return props.crossRegionReplicationBuckets[pipelineRegion]; + return props.artifactBuckets[pipelineRegion]; } return undefined; } @@ -617,6 +619,8 @@ export class Pipeline extends PipelineBase { * An interface representing resources generated in order to support * the cross-region capabilities of CodePipeline. * You get instances of this interface from the {@link Pipeline#crossRegionSupport} property. + * + * @experimental */ export interface CrossRegionSupport { /**