Show / Hide Table of Contents

Class CloudFormationCreateUpdateStackActionProps

Properties for the CloudFormationCreateUpdateStackAction.

Inheritance
object
CloudFormationCreateUpdateStackActionProps
Implements
ICloudFormationCreateUpdateStackActionProps
ICommonAwsActionProps
ICommonActionProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.CodePipeline.Actions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CloudFormationCreateUpdateStackActionProps : ICloudFormationCreateUpdateStackActionProps, ICommonAwsActionProps, ICommonActionProps
Syntax (vb)
Public Class CloudFormationCreateUpdateStackActionProps Implements ICloudFormationCreateUpdateStackActionProps, ICommonAwsActionProps, ICommonActionProps
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK;

            // in stack for account 123456789012...
            Stack otherAccountStack;

            var actionRole = new Role(otherAccountStack, "ActionRole", new RoleProps {
                AssumedBy = new AccountPrincipal("123456789012"),
                // the role has to have a physical name set
                RoleName = PhysicalName.GENERATE_IF_NEEDED
            });

            // in the pipeline stack...
            var sourceOutput = new Artifact();
            new CloudFormationCreateUpdateStackAction(new CloudFormationCreateUpdateStackActionProps {
                ActionName = "CloudFormationCreateUpdate",
                StackName = "MyStackName",
                AdminPermissions = true,
                TemplatePath = sourceOutput.AtPath("template.yaml"),
                Role = actionRole
            });

Synopsis

Constructors

CloudFormationCreateUpdateStackActionProps()

Properties for the CloudFormationCreateUpdateStackAction.

Properties

Account

The AWS account this Action is supposed to operate in.

ActionName

The physical, human-readable name of the Action.

AdminPermissions

Whether to grant full permissions to CloudFormation while deploying this template.

CfnCapabilities

Acknowledge certain changes made as part of deployment.

DeploymentRole

IAM role to assume when deploying changes.

ExtraInputs

The list of additional input Artifacts for this Action.

Output

The name of the output artifact to generate.

OutputFileName

A name for the filename in the output artifact to store the AWS CloudFormation call's result.

ParameterOverrides

Additional template parameters.

Region

The AWS region the given Action resides in.

ReplaceOnFailure

Replace the stack if it's in a failed state.

Role

The Role in which context's this Action will be executing in.

RunOrder

The runOrder property for this Action.

StackName

The name of the stack to apply this action to.

TemplateConfiguration

Input artifact to use for template parameters values and stack policy.

TemplatePath

Input artifact with the CloudFormation template to deploy.

VariablesNamespace

The name of the namespace to use for variables emitted by this action.

Constructors

CloudFormationCreateUpdateStackActionProps()

Properties for the CloudFormationCreateUpdateStackAction.

public CloudFormationCreateUpdateStackActionProps()
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK;

            // in stack for account 123456789012...
            Stack otherAccountStack;

            var actionRole = new Role(otherAccountStack, "ActionRole", new RoleProps {
                AssumedBy = new AccountPrincipal("123456789012"),
                // the role has to have a physical name set
                RoleName = PhysicalName.GENERATE_IF_NEEDED
            });

            // in the pipeline stack...
            var sourceOutput = new Artifact();
            new CloudFormationCreateUpdateStackAction(new CloudFormationCreateUpdateStackActionProps {
                ActionName = "CloudFormationCreateUpdate",
                StackName = "MyStackName",
                AdminPermissions = true,
                TemplatePath = sourceOutput.AtPath("template.yaml"),
                Role = actionRole
            });

Properties

Account

The AWS account this Action is supposed to operate in.

public string? Account { get; set; }
Property Value

string

Remarks

Note: if you specify the role property, this is ignored - the action will operate in the same region the passed role does.

Default: - action resides in the same account as the pipeline

ActionName

The physical, human-readable name of the Action.

public string ActionName { get; set; }
Property Value

string

Remarks

Note that Action names must be unique within a single Stage.

AdminPermissions

Whether to grant full permissions to CloudFormation while deploying this template.

public bool AdminPermissions { get; set; }
Property Value

bool

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 full (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.

CfnCapabilities

Acknowledge certain changes made as part of deployment.

public CfnCapabilities[]? CfnCapabilities { get; set; }
Property Value

CfnCapabilities[]

Remarks

For stacks that contain certain resources, explicit acknowledgement is required that AWS CloudFormation might create or update those resources. For example, you must specify ANONYMOUS_IAM or NAMED_IAM if your stack template contains AWS Identity and Access Management (IAM) resources. For more information, see the link below.

Default: None, unless adminPermissions is true

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

DeploymentRole

IAM role to assume when deploying changes.

public IRole? DeploymentRole { 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 full permissions.

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

ExtraInputs

The list of additional input Artifacts for this Action.

public Artifact_[]? ExtraInputs { get; set; }
Property Value

Artifact_[]

Remarks

This is especially useful when used in conjunction with the parameterOverrides property. For example, if you have:

parameterOverrides: { 'Param1': action1.outputArtifact.bucketName, 'Param2': action2.outputArtifact.objectKey, }

, if the output Artifacts of action1 and action2 were not used to set either the templateConfiguration or the templatePath properties, you need to make sure to include them in the extraInputs - otherwise, you'll get an "unrecognized Artifact" error during your Pipeline's execution.

Output

The name of the output artifact to generate.

public Artifact_? Output { get; set; }
Property Value

Artifact_

Remarks

Only applied if outputFileName is set as well.

Default: Automatically generated artifact name.

OutputFileName

A name for the filename in the output artifact to store the AWS CloudFormation call's result.

public string? OutputFileName { get; set; }
Property Value

string

Remarks

The file will contain the result of the call to AWS CloudFormation (for example the call to UpdateStack or CreateChangeSet).

AWS CodePipeline adds the file to the output artifact after performing the specified action.

Default: No output artifact generated

ParameterOverrides

Additional template parameters.

public IDictionary<string, object>? ParameterOverrides { get; set; }
Property Value

IDictionary<string, object>

Remarks

Template parameters specified here take precedence over template parameters found in the artifact specified by the templateConfiguration property.

We recommend that you use the template configuration file to specify most of your parameter values. Use parameter overrides to specify only dynamic parameter values (values that are unknown until you run the pipeline).

All parameter names must be present in the stack template.

Note: the entire object cannot be more than 1kB.

Default: No overrides

Region

The AWS region the given Action resides in.

public string? Region { get; set; }
Property Value

string

Remarks

Note that a cross-region Pipeline requires replication buckets to function correctly. You can provide their names with the PipelineProps#crossRegionReplicationBuckets 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.

Default: the Action resides in the same region as the Pipeline

ReplaceOnFailure

Replace the stack if it's in a failed state.

public bool? ReplaceOnFailure { get; set; }
Property Value

bool?

Remarks

If this is set to true and the stack is in a failed state (one of ROLLBACK_COMPLETE, ROLLBACK_FAILED, CREATE_FAILED, DELETE_FAILED, or UPDATE_ROLLBACK_FAILED), AWS CloudFormation deletes the stack and then creates a new stack.

If this is not set to true and the stack is in a failed state, the deployment fails.

Default: false

Role

The Role in which context's this Action will be executing in.

public IRole? Role { get; set; }
Property Value

IRole

Remarks

The Pipeline's Role will assume this Role (the required permissions for that will be granted automatically) right before executing this Action. This Action will be passed into your IAction.bind method in the ActionBindOptions.role property.

Default: a new Role will be generated

RunOrder

The runOrder property for this Action.

public double? RunOrder { get; set; }
Property Value

double?

Remarks

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

Default: 1

See: https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html

StackName

The name of the stack to apply this action to.

public string StackName { get; set; }
Property Value

string

Remarks

ExampleMetadata: infused

TemplateConfiguration

Input artifact to use for template parameters values and stack policy.

public ArtifactPath_? TemplateConfiguration { get; set; }
Property Value

ArtifactPath_

Remarks

The template configuration file should contain a JSON object that should look like this: { "Parameters": {...}, "Tags": {...}, "StackPolicy": {... }}. For more information, see AWS CloudFormation Artifacts.

Note that if you include sensitive information, such as passwords, restrict access to this file.

Default: No template configuration based on input artifacts

TemplatePath

Input artifact with the CloudFormation template to deploy.

public ArtifactPath_ TemplatePath { get; set; }
Property Value

ArtifactPath_

Remarks

ExampleMetadata: infused

VariablesNamespace

The name of the namespace to use for variables emitted by this action.

public string? VariablesNamespace { get; set; }
Property Value

string

Remarks

Default: - a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set

Implements

ICloudFormationCreateUpdateStackActionProps
ICommonAwsActionProps
ICommonActionProps
Back to top Generated by DocFX