Skip to content

Commit

Permalink
feat(aws-cloudformation): rename the CFN CodePipeline Actions. (#771)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this renames all CloudFormation Actions for CodePipeline
to bring them in line with Actions defined in other service packages.
  • Loading branch information
skinny85 authored and RomainMuller committed Sep 25, 2018
1 parent f4078a2 commit 007e7b4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
44 changes: 22 additions & 22 deletions packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cdk = require('@aws-cdk/cdk');
/**
* Properties common to all CloudFormation actions
*/
export interface CloudFormationCommonProps extends codepipeline.CommonActionProps {
export interface PipelineCloudFormationActionProps extends codepipeline.CommonActionProps {
/**
* The name of the stack to apply this action to
*/
Expand Down Expand Up @@ -37,15 +37,15 @@ export interface CloudFormationCommonProps extends codepipeline.CommonActionProp
/**
* Base class for Actions that execute CloudFormation
*/
export abstract class CloudFormationAction extends codepipeline.DeployAction {
export abstract class PipelineCloudFormationAction extends codepipeline.DeployAction {
/**
* Output artifact containing the CloudFormation call response
*
* Only present if configured by passing `outputFileName`.
*/
public artifact?: codepipeline.Artifact;

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

/**
* Properties for the ExecuteChangeSet action.
* Properties for the PipelineExecuteChangeSetAction.
*/
export interface ExecuteChangeSetProps extends CloudFormationCommonProps {
export interface PipelineExecuteChangeSetActionProps extends PipelineCloudFormationActionProps {
/**
* Name of the change set to execute.
*/
Expand All @@ -82,8 +82,8 @@ export interface ExecuteChangeSetProps extends CloudFormationCommonProps {
/**
* CodePipeline action to execute a prepared change set.
*/
export class ExecuteChangeSet extends CloudFormationAction {
constructor(parent: cdk.Construct, id: string, props: ExecuteChangeSetProps) {
export class PipelineExecuteChangeSetAction extends PipelineCloudFormationAction {
constructor(parent: cdk.Construct, id: string, props: PipelineExecuteChangeSetActionProps) {
super(parent, id, props, {
ActionMode: 'CHANGE_SET_EXECUTE',
ChangeSetName: props.changeSetName,
Expand All @@ -95,7 +95,7 @@ export class ExecuteChangeSet extends CloudFormationAction {
/**
* Properties common to CloudFormation actions that stage deployments
*/
export interface CloudFormationDeploymentActionCommonProps extends CloudFormationCommonProps {
export interface PipelineCloudFormationDeployActionProps extends PipelineCloudFormationActionProps {
/**
* IAM role to assume when deploying changes.
*
Expand Down Expand Up @@ -176,10 +176,10 @@ export interface CloudFormationDeploymentActionCommonProps extends CloudFormatio
/**
* Base class for all CloudFormation actions that execute or stage deployments.
*/
export abstract class CloudFormationDeploymentAction extends CloudFormationAction {
export abstract class PipelineCloudFormationDeployAction extends PipelineCloudFormationAction {
public readonly role: iam.Role;

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

super(parent, id, props, {
Expand Down Expand Up @@ -214,9 +214,9 @@ export abstract class CloudFormationDeploymentAction extends CloudFormationActio
}

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

/**
* Properties for the CreateUpdate action
* Properties for the PipelineCreateUpdateStackAction.
*/
export interface CreateUpdateProps extends CloudFormationDeploymentActionCommonProps {
export interface PipelineCreateUpdateStackActionProps extends PipelineCloudFormationDeployActionProps {
/**
* Input artifact with the CloudFormation template to deploy
*/
Expand Down Expand Up @@ -285,8 +285,8 @@ export interface CreateUpdateProps extends CloudFormationDeploymentActionCommonP
* Use this action to automatically replace failed stacks without recovering or
* troubleshooting them. You would typically choose this mode for testing.
*/
export class CreateUpdateStack extends CloudFormationDeploymentAction {
constructor(parent: cdk.Construct, id: string, props: CreateUpdateProps) {
export class PipelineCreateUpdateStackAction extends PipelineCloudFormationDeployAction {
constructor(parent: cdk.Construct, id: string, props: PipelineCreateUpdateStackActionProps) {
super(parent, id, props, {
ActionMode: props.replaceOnFailure ? 'REPLACE_ON_FAILURE' : 'CREATE_UPDATE',
TemplatePath: props.templatePath.location
Expand All @@ -296,10 +296,10 @@ export class CreateUpdateStack extends CloudFormationDeploymentAction {
}

/**
* Properties for the DeleteOnly action
* Properties for the PipelineDeleteStackAction.
*/
// tslint:disable-next-line:no-empty-interface
export interface DeleteStackOnlyProps extends CloudFormationDeploymentActionCommonProps {
export interface PipelineDeleteStackActionProps extends PipelineCloudFormationDeployActionProps {
}

/**
Expand All @@ -308,8 +308,8 @@ export interface DeleteStackOnlyProps extends CloudFormationDeploymentActionComm
* Deletes a stack. If you specify a stack that doesn't exist, the action completes successfully
* without deleting a stack.
*/
export class DeleteStackOnly extends CloudFormationDeploymentAction {
constructor(parent: cdk.Construct, id: string, props: DeleteStackOnlyProps) {
export class PipelineDeleteStackAction extends PipelineCloudFormationDeployAction {
constructor(parent: cdk.Construct, id: string, props: PipelineDeleteStackActionProps) {
super(parent, id, props, {
ActionMode: 'DELETE_ONLY',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const prodStage = new codepipeline.Stage(pipeline, 'Deploy', { pipeline });
const stackName = 'OurStack';
const changeSetName = 'StagedChangeSet';

new cfn.CreateReplaceChangeSet(prodStage, 'PrepareChanges', {
new cfn.PipelineCreateReplaceChangeSetAction(prodStage, 'PrepareChanges', {
stage: prodStage,
stackName,
changeSetName,
Expand All @@ -37,7 +37,7 @@ new codepipeline.ManualApprovalAction(stack, 'ApproveChanges', {
stage: prodStage,
});

new cfn.ExecuteChangeSet(stack, 'ExecuteChanges', {
new cfn.PipelineExecuteChangeSetAction(stack, 'ExecuteChanges', {
stage: prodStage,
stackName,
changeSetName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const role = new Role(stack, 'CfnChangeSetRole', {
assumedBy: new ServicePrincipal('cloudformation.amazonaws.com'),
});

new cfn.CreateReplaceChangeSet(stack, 'DeployCFN', {
new cfn.PipelineCreateReplaceChangeSetAction(stack, 'DeployCFN', {
stage: cfnStage,
changeSetName,
stackName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, haveResource } from '@aws-cdk/assert';
import { CreateReplaceChangeSet, CreateUpdateStack, ExecuteChangeSet } from '@aws-cdk/aws-cloudformation';
import { PipelineCreateReplaceChangeSetAction, PipelineCreateUpdateStackAction, PipelineExecuteChangeSetAction } from '@aws-cdk/aws-cloudformation';
import { CodePipelineBuildArtifacts, CodePipelineSource, PipelineBuildAction, Project } from '@aws-cdk/aws-codebuild';
import { PipelineSourceAction, Repository } from '@aws-cdk/aws-codecommit';
import { ArtifactPath } from '@aws-cdk/aws-codepipeline-api';
Expand Down Expand Up @@ -57,7 +57,7 @@ export = {
const stackName = 'BrelandsStack';
const changeSetName = 'MyMagicalChangeSet';

new CreateReplaceChangeSet(stack, 'BuildChangeSetProd', {
new PipelineCreateReplaceChangeSetAction(stack, 'BuildChangeSetProd', {
stage: prodStage,
stackName,
changeSetName,
Expand All @@ -66,7 +66,7 @@ export = {
templateConfiguration: new ArtifactPath(buildAction.artifact!, 'templateConfig.json')
});

new ExecuteChangeSet(stack, 'ExecuteChangeSetProd', {
new PipelineExecuteChangeSetAction(stack, 'ExecuteChangeSetProd', {
stage: prodStage,
stackName,
changeSetName,
Expand Down Expand Up @@ -200,7 +200,7 @@ export = {
const stack = new TestFixture();

// WHEN
new CreateUpdateStack(stack.deployStage, 'CreateUpdate', {
new PipelineCreateUpdateStackAction(stack.deployStage, 'CreateUpdate', {
stage: stack.deployStage,
stackName: 'MyStack',
templatePath: stack.source.artifact.subartifact('template.yaml'),
Expand Down Expand Up @@ -253,7 +253,7 @@ export = {
const stack = new TestFixture();

// WHEN
new CreateUpdateStack(stack, 'CreateUpdate', {
new PipelineCreateUpdateStackAction(stack, 'CreateUpdate', {
stage: stack.deployStage,
stackName: 'MyStack',
templatePath: stack.source.artifact.subartifact('template.yaml'),
Expand Down Expand Up @@ -284,7 +284,7 @@ export = {
const stack = new TestFixture();

// WHEN
new CreateUpdateStack(stack, 'CreateUpdate', {
new PipelineCreateUpdateStackAction(stack, 'CreateUpdate', {
stage: stack.deployStage,
stackName: 'MyStack',
templatePath: stack.source.artifact.subartifact('template.yaml'),
Expand Down Expand Up @@ -317,7 +317,7 @@ export = {
const stack = new TestFixture();

// WHEN
new CreateUpdateStack(stack, 'CreateUpdate', {
new PipelineCreateUpdateStackAction(stack, 'CreateUpdate', {
stage: stack.deployStage,
stackName: 'MyStack',
templatePath: stack.source.artifact.subartifact('template.yaml'),
Expand Down

0 comments on commit 007e7b4

Please sign in to comment.