Show / Hide Table of Contents

Class PipelineDeployStackActionProps

Inheritance
System.Object
PipelineDeployStackActionProps
Implements
IPipelineDeployStackActionProps
Namespace: Amazon.CDK.AppDelivery
Assembly: Amazon.CDK.AppDelivery.dll
Syntax (csharp)
public class PipelineDeployStackActionProps : Object, IPipelineDeployStackActionProps
Syntax (vb)
Public Class PipelineDeployStackActionProps
    Inherits Object
    Implements IPipelineDeployStackActionProps
Remarks

Stability: Deprecated

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.CodeBuild;
using Amazon.CDK.AWS.CodePipeline;
using Amazon.CDK.AWS.CodePipeline.Actions;
using Amazon.CDK;
using Amazon.CDK.AppDelivery;
using Amazon.CDK.AWS.IAM;

class MyServiceStackA : Stack
{
}
class MyServiceStackB : Stack
{
}

var app = new App();

// We define a stack that contains the CodePipeline
var pipelineStack = new Stack(app, "PipelineStack");
var pipeline = new Pipeline(pipelineStack, "CodePipeline", new PipelineProps {
    // Mutating a CodePipeline can cause the currently propagating state to be
    // "lost". Ensure we re-run the latest change through the pipeline after it's
    // been mutated so we're sure the latest state is fully deployed through.
    RestartExecutionOnUpdate = true
});

// Configure the CodePipeline source - where your CDK App's source code is hosted
var sourceOutput = new Artifact();
var source = new GitHubSourceAction(new GitHubSourceActionProps {
    ActionName = "GitHub",
    Output = sourceOutput,
    Owner = "myName",
    Repo = "myRepo",
    OauthToken = SecretValue.UnsafePlainText("secret")
});
pipeline.AddStage(new StageOptions {
    StageName = "source",
    Actions = new [] { source }
});

var project = new PipelineProject(pipelineStack, "CodeBuild", new PipelineProjectProps { });
var synthesizedApp = new Artifact();
var buildAction = new CodeBuildAction(new CodeBuildActionProps {
    ActionName = "CodeBuild",
    Project = project,
    Input = sourceOutput,
    Outputs = new [] { synthesizedApp }
});
pipeline.AddStage(new StageOptions {
    StageName = "build",
    Actions = new [] { buildAction }
});

// Optionally, self-update the pipeline stack
var selfUpdateStage = pipeline.AddStage(new StageOptions { StageName = "SelfUpdate" });
selfUpdateStage.AddAction(new PipelineDeployStackAction(new PipelineDeployStackActionProps {
    Stack = pipelineStack,
    Input = synthesizedApp,
    AdminPermissions = true
}));

// Now add our service stacks
var deployStage = pipeline.AddStage(new StageOptions { StageName = "Deploy" });
var serviceStackA = new MyServiceStackA(app, "ServiceStackA", new StackProps { });
// Add actions to deploy the stacks in the deploy stage:
var deployServiceAAction = new PipelineDeployStackAction(new PipelineDeployStackActionProps {
    Stack = serviceStackA,
    Input = synthesizedApp,
    // See the note below for details about this option.
    AdminPermissions = false
});
deployStage.AddAction(deployServiceAAction);
// Add the necessary permissions for you service deploy action. This role is
// is passed to CloudFormation and needs the permissions necessary to deploy
// stack. Alternatively you can enable [Administrator](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html#jf_administrator) permissions above,
// users should understand the privileged nature of this role.
var myResourceArn = "arn:partition:service:region:account-id:resource-id";
deployServiceAAction.AddToDeploymentRolePolicy(new PolicyStatement(new PolicyStatementProps {
    Actions = new [] { "service:SomeAction" },
    Resources = new [] { myResourceArn }
}));

var serviceStackB = new MyServiceStackB(app, "ServiceStackB", new StackProps { });
deployStage.AddAction(new PipelineDeployStackAction(new PipelineDeployStackActionProps {
    Stack = serviceStackB,
    Input = synthesizedApp,
    CreateChangeSetRunOrder = 998,
    AdminPermissions = true
}));

Synopsis

Constructors

PipelineDeployStackActionProps()

Properties

AdminPermissions

(deprecated) Whether to grant admin permissions to CloudFormation while deploying this template.

Capabilities

(deprecated) Acknowledge certain changes made as part of deployment.

ChangeSetName

(deprecated) The name to use when creating a ChangeSet for the stack.

CreateChangeSetActionName

(deprecated) The name of the CodePipeline action creating the ChangeSet.

CreateChangeSetRunOrder

(deprecated) The runOrder for the CodePipeline action creating the ChangeSet.

ExecuteChangeSetActionName

(deprecated) The name of the CodePipeline action creating the ChangeSet.

ExecuteChangeSetRunOrder

(deprecated) The runOrder for the CodePipeline action executing the ChangeSet.

Input

(deprecated) The CodePipeline artifact that holds the synthesized app, which is the contents of the <directory> when running cdk synth -o <directory>.

Role

(deprecated) IAM role to assume when deploying changes.

Stack

(deprecated) The CDK stack to be deployed.

Constructors

PipelineDeployStackActionProps()

public PipelineDeployStackActionProps()

Properties

AdminPermissions

(deprecated) Whether to grant admin permissions to CloudFormation while deploying this template.

public bool AdminPermissions { get; set; }
Property Value

System.Boolean

Remarks

Setting this to true affects the defaults for role and capabilities, if you don't specify any alternatives.

The default role that will be created for you will have admin (i.e., *) permissions on all resources, and the deployment will have named IAM capabilities (i.e., able to create all IAM resources).

This is a shorthand that you can use if you fully trust the templates that are deployed in this pipeline. If you want more fine-grained permissions, use addToRolePolicy and capabilities to control what the CloudFormation deployment is allowed to do.

Stability: Deprecated

Capabilities

(deprecated) Acknowledge certain changes made as part of deployment.

public CloudFormationCapabilities[] Capabilities { get; set; }
Property Value

CloudFormationCapabilities[]

Remarks

For stacks that contain certain resources, explicit acknowledgement that AWS CloudFormation might create or update those resources. For example, you must specify AnonymousIAM if your stack template contains AWS Identity and Access Management (IAM) resources. For more information

Default: [AnonymousIAM, AutoExpand], unless adminPermissions is true

Stability: Deprecated

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities

ChangeSetName

(deprecated) The name to use when creating a ChangeSet for the stack.

public string ChangeSetName { get; set; }
Property Value

System.String

Remarks

Default: CDK-CodePipeline-ChangeSet

Stability: Deprecated

CreateChangeSetActionName

(deprecated) The name of the CodePipeline action creating the ChangeSet.

public string CreateChangeSetActionName { get; set; }
Property Value

System.String

Remarks

Default: 'ChangeSet'

Stability: Deprecated

CreateChangeSetRunOrder

(deprecated) The runOrder for the CodePipeline action creating the ChangeSet.

public Nullable<double> CreateChangeSetRunOrder { get; set; }
Property Value

System.Nullable<System.Double>

Remarks

Default: 1

Stability: Deprecated

ExecuteChangeSetActionName

(deprecated) The name of the CodePipeline action creating the ChangeSet.

public string ExecuteChangeSetActionName { get; set; }
Property Value

System.String

Remarks

Default: 'Execute'

Stability: Deprecated

ExecuteChangeSetRunOrder

(deprecated) The runOrder for the CodePipeline action executing the ChangeSet.

public Nullable<double> ExecuteChangeSetRunOrder { get; set; }
Property Value

System.Nullable<System.Double>

Remarks

Default: createChangeSetRunOrder + 1

Stability: Deprecated

Input

(deprecated) The CodePipeline artifact that holds the synthesized app, which is the contents of the &lt;directory> when running cdk synth -o &lt;directory>.

public Artifact_ Input { get; set; }
Property Value

Artifact_

Remarks

Stability: Deprecated

Role

(deprecated) IAM role to assume when deploying changes.

public IRole Role { get; set; }
Property Value

IRole

Remarks

If not specified, a fresh role is created. The role is created with zero permissions unless adminPermissions is true, in which case the role will have admin permissions.

Default: A fresh role with admin or no permissions (depending on the value of adminPermissions).

Stability: Deprecated

Stack

(deprecated) The CDK stack to be deployed.

public Stack Stack { get; set; }
Property Value

Stack

Remarks

Stability: Deprecated

Implements

IPipelineDeployStackActionProps
Back to top Generated by DocFX