-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pipeline): allow enabling KMS key rotation for cross-region Stac…
…ks (#16468) As suggested by @skinny85 I created an updated PR as successor of #14381 How does it work for v2. Do I need to create another PR for `v2-main`? ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
15 changed files
with
155 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -792,4 +792,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1622,4 +1622,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -788,4 +788,4 @@ | |
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -393,4 +393,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -731,4 +731,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -815,4 +815,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -545,4 +545,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -842,4 +842,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -540,4 +540,4 @@ | |
"DeletionPolicy": "Retain" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/@aws-cdk/pipelines/test/codepipeline/codepipeline-existing.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import * as codePipeline from '@aws-cdk/aws-codepipeline'; | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as cdkp from '../../lib'; | ||
|
||
test('Does not allow setting a pipelineName if an existing CodePipeline is given', () => { | ||
const app = new cdk.App(); | ||
const stack = new cdk.Stack(app, 'PipelineStack'); | ||
const existingCodePipeline = new codePipeline.Pipeline(stack, 'CustomCodePipeline'); | ||
|
||
expect(() => { | ||
new cdkp.CdkPipeline(stack, 'CDKPipeline', { | ||
pipelineName: 'CustomPipelineName', | ||
codePipeline: existingCodePipeline, | ||
cloudAssemblyArtifact: new codePipeline.Artifact(), | ||
}); | ||
}).toThrow("Cannot set 'pipelineName' if an existing CodePipeline is given using 'codePipeline'"); | ||
}); | ||
|
||
test('Does not allow enabling crossAccountKeys if an existing CodePipeline is given', () => { | ||
const app = new cdk.App(); | ||
const stack = new cdk.Stack(app, 'PipelineStack'); | ||
const existingCodePipeline = new codePipeline.Pipeline(stack, 'CustomCodePipeline'); | ||
|
||
expect(() => { | ||
new cdkp.CdkPipeline(stack, 'CDKPipeline', { | ||
crossAccountKeys: true, | ||
codePipeline: existingCodePipeline, | ||
cloudAssemblyArtifact: new codePipeline.Artifact(), | ||
}); | ||
}).toThrow("Cannot set 'crossAccountKeys' if an existing CodePipeline is given using 'codePipeline'"); | ||
}); | ||
|
||
test('Does not allow enabling key rotation if an existing CodePipeline is given', () => { | ||
const app = new cdk.App(); | ||
const stack = new cdk.Stack(app, 'PipelineStack'); | ||
const existingCodePipeline = new codePipeline.Pipeline(stack, 'CustomCodePipeline'); | ||
|
||
expect(() => { | ||
new cdkp.CdkPipeline(stack, 'CDKPipeline', { | ||
enableKeyRotation: true, | ||
codePipeline: existingCodePipeline, | ||
cloudAssemblyArtifact: new codePipeline.Artifact(), | ||
}); | ||
}).toThrow("Cannot set 'enableKeyRotation' if an existing CodePipeline is given using 'codePipeline'"); | ||
}); |