Skip to content

Commit 007e7b4

Browse files
skinny85RomainMuller
authored andcommitted
feat(aws-cloudformation): rename the CFN CodePipeline Actions. (#771)
BREAKING CHANGE: this renames all CloudFormation Actions for CodePipeline to bring them in line with Actions defined in other service packages.
1 parent f4078a2 commit 007e7b4

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts

+22-22
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import cdk = require('@aws-cdk/cdk');
55
/**
66
* Properties common to all CloudFormation actions
77
*/
8-
export interface CloudFormationCommonProps extends codepipeline.CommonActionProps {
8+
export interface PipelineCloudFormationActionProps extends codepipeline.CommonActionProps {
99
/**
1010
* The name of the stack to apply this action to
1111
*/
@@ -37,15 +37,15 @@ export interface CloudFormationCommonProps extends codepipeline.CommonActionProp
3737
/**
3838
* Base class for Actions that execute CloudFormation
3939
*/
40-
export abstract class CloudFormationAction extends codepipeline.DeployAction {
40+
export abstract class PipelineCloudFormationAction extends codepipeline.DeployAction {
4141
/**
4242
* Output artifact containing the CloudFormation call response
4343
*
4444
* Only present if configured by passing `outputFileName`.
4545
*/
4646
public artifact?: codepipeline.Artifact;
4747

48-
constructor(parent: cdk.Construct, id: string, props: CloudFormationCommonProps, configuration?: any) {
48+
constructor(parent: cdk.Construct, id: string, props: PipelineCloudFormationActionProps, configuration?: any) {
4949
super(parent, id, {
5050
stage: props.stage,
5151
artifactBounds: {
@@ -70,9 +70,9 @@ export abstract class CloudFormationAction extends codepipeline.DeployAction {
7070
}
7171

7272
/**
73-
* Properties for the ExecuteChangeSet action.
73+
* Properties for the PipelineExecuteChangeSetAction.
7474
*/
75-
export interface ExecuteChangeSetProps extends CloudFormationCommonProps {
75+
export interface PipelineExecuteChangeSetActionProps extends PipelineCloudFormationActionProps {
7676
/**
7777
* Name of the change set to execute.
7878
*/
@@ -82,8 +82,8 @@ export interface ExecuteChangeSetProps extends CloudFormationCommonProps {
8282
/**
8383
* CodePipeline action to execute a prepared change set.
8484
*/
85-
export class ExecuteChangeSet extends CloudFormationAction {
86-
constructor(parent: cdk.Construct, id: string, props: ExecuteChangeSetProps) {
85+
export class PipelineExecuteChangeSetAction extends PipelineCloudFormationAction {
86+
constructor(parent: cdk.Construct, id: string, props: PipelineExecuteChangeSetActionProps) {
8787
super(parent, id, props, {
8888
ActionMode: 'CHANGE_SET_EXECUTE',
8989
ChangeSetName: props.changeSetName,
@@ -95,7 +95,7 @@ export class ExecuteChangeSet extends CloudFormationAction {
9595
/**
9696
* Properties common to CloudFormation actions that stage deployments
9797
*/
98-
export interface CloudFormationDeploymentActionCommonProps extends CloudFormationCommonProps {
98+
export interface PipelineCloudFormationDeployActionProps extends PipelineCloudFormationActionProps {
9999
/**
100100
* IAM role to assume when deploying changes.
101101
*
@@ -176,10 +176,10 @@ export interface CloudFormationDeploymentActionCommonProps extends CloudFormatio
176176
/**
177177
* Base class for all CloudFormation actions that execute or stage deployments.
178178
*/
179-
export abstract class CloudFormationDeploymentAction extends CloudFormationAction {
179+
export abstract class PipelineCloudFormationDeployAction extends PipelineCloudFormationAction {
180180
public readonly role: iam.Role;
181181

182-
constructor(parent: cdk.Construct, id: string, props: CloudFormationDeploymentActionCommonProps, configuration: any) {
182+
constructor(parent: cdk.Construct, id: string, props: PipelineCloudFormationDeployActionProps, configuration: any) {
183183
const capabilities = props.fullPermissions && props.capabilities === undefined ? [CloudFormationCapabilities.NamedIAM] : props.capabilities;
184184

185185
super(parent, id, props, {
@@ -214,9 +214,9 @@ export abstract class CloudFormationDeploymentAction extends CloudFormationActio
214214
}
215215

216216
/**
217-
* Properties for the CreateReplaceChangeSet action.
217+
* Properties for the PipelineCreateReplaceChangeSetAction.
218218
*/
219-
export interface CreateReplaceChangeSetProps extends CloudFormationDeploymentActionCommonProps {
219+
export interface PipelineCreateReplaceChangeSetActionProps extends PipelineCloudFormationDeployActionProps {
220220
/**
221221
* Name of the change set to create or update.
222222
*/
@@ -234,8 +234,8 @@ export interface CreateReplaceChangeSetProps extends CloudFormationDeploymentAct
234234
* Creates the change set if it doesn't exist based on the stack name and template that you submit.
235235
* If the change set exists, AWS CloudFormation deletes it, and then creates a new one.
236236
*/
237-
export class CreateReplaceChangeSet extends CloudFormationDeploymentAction {
238-
constructor(parent: cdk.Construct, id: string, props: CreateReplaceChangeSetProps) {
237+
export class PipelineCreateReplaceChangeSetAction extends PipelineCloudFormationDeployAction {
238+
constructor(parent: cdk.Construct, id: string, props: PipelineCreateReplaceChangeSetActionProps) {
239239
super(parent, id, props, {
240240
ActionMode: 'CHANGE_SET_REPLACE',
241241
ChangeSetName: props.changeSetName,
@@ -247,9 +247,9 @@ export class CreateReplaceChangeSet extends CloudFormationDeploymentAction {
247247
}
248248

249249
/**
250-
* Properties for the CreateUpdate action
250+
* Properties for the PipelineCreateUpdateStackAction.
251251
*/
252-
export interface CreateUpdateProps extends CloudFormationDeploymentActionCommonProps {
252+
export interface PipelineCreateUpdateStackActionProps extends PipelineCloudFormationDeployActionProps {
253253
/**
254254
* Input artifact with the CloudFormation template to deploy
255255
*/
@@ -285,8 +285,8 @@ export interface CreateUpdateProps extends CloudFormationDeploymentActionCommonP
285285
* Use this action to automatically replace failed stacks without recovering or
286286
* troubleshooting them. You would typically choose this mode for testing.
287287
*/
288-
export class CreateUpdateStack extends CloudFormationDeploymentAction {
289-
constructor(parent: cdk.Construct, id: string, props: CreateUpdateProps) {
288+
export class PipelineCreateUpdateStackAction extends PipelineCloudFormationDeployAction {
289+
constructor(parent: cdk.Construct, id: string, props: PipelineCreateUpdateStackActionProps) {
290290
super(parent, id, props, {
291291
ActionMode: props.replaceOnFailure ? 'REPLACE_ON_FAILURE' : 'CREATE_UPDATE',
292292
TemplatePath: props.templatePath.location
@@ -296,10 +296,10 @@ export class CreateUpdateStack extends CloudFormationDeploymentAction {
296296
}
297297

298298
/**
299-
* Properties for the DeleteOnly action
299+
* Properties for the PipelineDeleteStackAction.
300300
*/
301301
// tslint:disable-next-line:no-empty-interface
302-
export interface DeleteStackOnlyProps extends CloudFormationDeploymentActionCommonProps {
302+
export interface PipelineDeleteStackActionProps extends PipelineCloudFormationDeployActionProps {
303303
}
304304

305305
/**
@@ -308,8 +308,8 @@ export interface DeleteStackOnlyProps extends CloudFormationDeploymentActionComm
308308
* Deletes a stack. If you specify a stack that doesn't exist, the action completes successfully
309309
* without deleting a stack.
310310
*/
311-
export class DeleteStackOnly extends CloudFormationDeploymentAction {
312-
constructor(parent: cdk.Construct, id: string, props: DeleteStackOnlyProps) {
311+
export class PipelineDeleteStackAction extends PipelineCloudFormationDeployAction {
312+
constructor(parent: cdk.Construct, id: string, props: PipelineDeleteStackActionProps) {
313313
super(parent, id, props, {
314314
ActionMode: 'DELETE_ONLY',
315315
});

packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const prodStage = new codepipeline.Stage(pipeline, 'Deploy', { pipeline });
2525
const stackName = 'OurStack';
2626
const changeSetName = 'StagedChangeSet';
2727

28-
new cfn.CreateReplaceChangeSet(prodStage, 'PrepareChanges', {
28+
new cfn.PipelineCreateReplaceChangeSetAction(prodStage, 'PrepareChanges', {
2929
stage: prodStage,
3030
stackName,
3131
changeSetName,
@@ -37,7 +37,7 @@ new codepipeline.ManualApprovalAction(stack, 'ApproveChanges', {
3737
stage: prodStage,
3838
});
3939

40-
new cfn.ExecuteChangeSet(stack, 'ExecuteChanges', {
40+
new cfn.PipelineExecuteChangeSetAction(stack, 'ExecuteChanges', {
4141
stage: prodStage,
4242
stackName,
4343
changeSetName,

packages/@aws-cdk/aws-codepipeline/test/integ.pipeline-cfn.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const role = new Role(stack, 'CfnChangeSetRole', {
3232
assumedBy: new ServicePrincipal('cloudformation.amazonaws.com'),
3333
});
3434

35-
new cfn.CreateReplaceChangeSet(stack, 'DeployCFN', {
35+
new cfn.PipelineCreateReplaceChangeSetAction(stack, 'DeployCFN', {
3636
stage: cfnStage,
3737
changeSetName,
3838
stackName,

packages/@aws-cdk/aws-codepipeline/test/test.cloudformation-pipeline-actions.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, haveResource } from '@aws-cdk/assert';
2-
import { CreateReplaceChangeSet, CreateUpdateStack, ExecuteChangeSet } from '@aws-cdk/aws-cloudformation';
2+
import { PipelineCreateReplaceChangeSetAction, PipelineCreateUpdateStackAction, PipelineExecuteChangeSetAction } from '@aws-cdk/aws-cloudformation';
33
import { CodePipelineBuildArtifacts, CodePipelineSource, PipelineBuildAction, Project } from '@aws-cdk/aws-codebuild';
44
import { PipelineSourceAction, Repository } from '@aws-cdk/aws-codecommit';
55
import { ArtifactPath } from '@aws-cdk/aws-codepipeline-api';
@@ -57,7 +57,7 @@ export = {
5757
const stackName = 'BrelandsStack';
5858
const changeSetName = 'MyMagicalChangeSet';
5959

60-
new CreateReplaceChangeSet(stack, 'BuildChangeSetProd', {
60+
new PipelineCreateReplaceChangeSetAction(stack, 'BuildChangeSetProd', {
6161
stage: prodStage,
6262
stackName,
6363
changeSetName,
@@ -66,7 +66,7 @@ export = {
6666
templateConfiguration: new ArtifactPath(buildAction.artifact!, 'templateConfig.json')
6767
});
6868

69-
new ExecuteChangeSet(stack, 'ExecuteChangeSetProd', {
69+
new PipelineExecuteChangeSetAction(stack, 'ExecuteChangeSetProd', {
7070
stage: prodStage,
7171
stackName,
7272
changeSetName,
@@ -200,7 +200,7 @@ export = {
200200
const stack = new TestFixture();
201201

202202
// WHEN
203-
new CreateUpdateStack(stack.deployStage, 'CreateUpdate', {
203+
new PipelineCreateUpdateStackAction(stack.deployStage, 'CreateUpdate', {
204204
stage: stack.deployStage,
205205
stackName: 'MyStack',
206206
templatePath: stack.source.artifact.subartifact('template.yaml'),
@@ -253,7 +253,7 @@ export = {
253253
const stack = new TestFixture();
254254

255255
// WHEN
256-
new CreateUpdateStack(stack, 'CreateUpdate', {
256+
new PipelineCreateUpdateStackAction(stack, 'CreateUpdate', {
257257
stage: stack.deployStage,
258258
stackName: 'MyStack',
259259
templatePath: stack.source.artifact.subartifact('template.yaml'),
@@ -284,7 +284,7 @@ export = {
284284
const stack = new TestFixture();
285285

286286
// WHEN
287-
new CreateUpdateStack(stack, 'CreateUpdate', {
287+
new PipelineCreateUpdateStackAction(stack, 'CreateUpdate', {
288288
stage: stack.deployStage,
289289
stackName: 'MyStack',
290290
templatePath: stack.source.artifact.subartifact('template.yaml'),
@@ -317,7 +317,7 @@ export = {
317317
const stack = new TestFixture();
318318

319319
// WHEN
320-
new CreateUpdateStack(stack, 'CreateUpdate', {
320+
new PipelineCreateUpdateStackAction(stack, 'CreateUpdate', {
321321
stage: stack.deployStage,
322322
stackName: 'MyStack',
323323
templatePath: stack.source.artifact.subartifact('template.yaml'),

0 commit comments

Comments
 (0)