Skip to content
v2.274.0

CloudFormationDeleteStackAction Class ​

CodePipeline action to delete a stack.

Deletes a stack. If you specify a stack that doesn't exist, the action completes successfully without deleting a stack.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_codepipeline as codepipeline } from 'aws-cdk-lib';
import { aws_codepipeline_actions as codepipeline_actions } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const artifact: codepipeline.Artifact;
declare const artifactPath: codepipeline.ArtifactPath;
declare const parameterOverrides: any;
declare const role: iam.Role;
const cloudFormationDeleteStackAction = new codepipeline_actions.CloudFormationDeleteStackAction({
  actionName: 'actionName',
  adminPermissions: false,
  stackName: 'stackName',

  // the properties below are optional
  account: 'account',
  cfnCapabilities: [cdk.CfnCapabilities.NONE],
  deploymentRole: role,
  extraInputs: [artifact],
  output: artifact,
  outputFileName: 'outputFileName',
  parameterOverrides: {
    parameterOverridesKey: parameterOverrides,
  },
  region: 'region',
  role: role,
  runOrder: 123,
  templateConfiguration: artifactPath,
  variablesNamespace: 'variablesNamespace',
});
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_codepipeline as codepipeline
from aws_cdk import aws_codepipeline_actions as codepipeline_actions
from aws_cdk import aws_iam as iam

# artifact: codepipeline.Artifact
# artifact_path: codepipeline.ArtifactPath
# parameter_overrides: Any
# role: iam.Role

cloud_formation_delete_stack_action = codepipeline_actions.CloudFormationDeleteStackAction(
    action_name="actionName",
    admin_permissions=False,
    stack_name="stackName",

    # the properties below are optional
    account="account",
    cfn_capabilities=[cdk.CfnCapabilities.NONE],
    deployment_role=role,
    extra_inputs=[artifact],
    output=artifact,
    output_file_name="outputFileName",
    parameter_overrides={
        "parameter_overrides_key": parameter_overrides
    },
    region="region",
    role=role,
    run_order=123,
    template_configuration=artifact_path,
    variables_namespace="variablesNamespace"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.codepipeline.*;
import software.amazon.awscdk.services.codepipeline.actions.*;
import software.amazon.awscdk.services.iam.*;

Artifact artifact;
ArtifactPath artifactPath;
Object parameterOverrides;
Role role;

CloudFormationDeleteStackAction cloudFormationDeleteStackAction = CloudFormationDeleteStackAction.Builder.create()
        .actionName("actionName")
        .adminPermissions(false)
        .stackName("stackName")

        // the properties below are optional
        .account("account")
        .cfnCapabilities(List.of(CfnCapabilities.NONE))
        .deploymentRole(role)
        .extraInputs(List.of(artifact))
        .output(artifact)
        .outputFileName("outputFileName")
        .parameterOverrides(Map.of(
                "parameterOverridesKey", parameterOverrides))
        .region("region")
        .role(role)
        .runOrder(123)
        .templateConfiguration(artifactPath)
        .variablesNamespace("variablesNamespace")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.CodePipeline;
using Amazon.CDK.AWS.CodePipeline.Actions;
using Amazon.CDK.AWS.IAM;

Artifact artifact;
ArtifactPath artifactPath;
var parameterOverrides;
Role role;

var cloudFormationDeleteStackAction = new CloudFormationDeleteStackAction(new CloudFormationDeleteStackActionProps {
    ActionName = "actionName",
    AdminPermissions = false,
    StackName = "stackName",

    // the properties below are optional
    Account = "account",
    CfnCapabilities = new [] { CfnCapabilities.NONE },
    DeploymentRole = role,
    ExtraInputs = new [] { artifact },
    Output = artifact,
    OutputFileName = "outputFileName",
    ParameterOverrides = new Dictionary<string, object> {
        { "parameterOverridesKey", parameterOverrides }
    },
    Region = "region",
    Role = role,
    RunOrder = 123,
    TemplateConfiguration = artifactPath,
    VariablesNamespace = "variablesNamespace"
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var artifact Artifact
var artifactPath ArtifactPath
var parameterOverrides interface{}
var role Role

cloudFormationDeleteStackAction := awscdk.Aws_codepipeline_actions.NewCloudFormationDeleteStackAction(&CloudFormationDeleteStackActionProps{
	ActionName: jsii.String("actionName"),
	AdminPermissions: jsii.Boolean(false),
	StackName: jsii.String("stackName"),

	// the properties below are optional
	Account: jsii.String("account"),
	CfnCapabilities: []CfnCapabilities{
		cdk.CfnCapabilities_NONE,
	},
	DeploymentRole: role,
	ExtraInputs: []Artifact{
		artifact,
	},
	Output: artifact,
	OutputFileName: jsii.String("outputFileName"),
	ParameterOverrides: map[string]interface{}{
		"parameterOverridesKey": parameterOverrides,
	},
	Region: jsii.String("region"),
	Role: role,
	RunOrder: jsii.Number(123),
	TemplateConfiguration: artifactPath,
	VariablesNamespace: jsii.String("variablesNamespace"),
})

Initializer ​

ts
new CloudFormationDeleteStackAction(props: CloudFormationDeleteStackActionProps)
python
CloudFormationDeleteStackAction(props: CloudFormationDeleteStackActionProps)
java
new CloudFormationDeleteStackAction(CloudFormationDeleteStackActionProps props)
csharp
new CloudFormationDeleteStackAction(CloudFormationDeleteStackActionProps props)
go
NewCloudFormationDeleteStackAction(Props CloudFormationDeleteStackActionProps)

Properties ​

actionPropertiesActionPropertiesaction_propertiesActionPropertiesactionPropertiesActionPropertiesActionPropertiesActionPropertiesActionPropertiesActionPropertiesrequired#
The simple properties of the Action, like its Owner, name, etc.

Note that this accessor will be called before the bind callback.

deploymentRoleIRoledeployment_roleIRoledeploymentRoleIRoleDeploymentRoleIRoleDeploymentRoleIRolerequired#

Methods ​

addToDeploymentRolePolicy(statement: PolicyStatement): booleandef add_to_deployment_role_policy(self, statement: PolicyStatement) -> boolpublic Boolean addToDeploymentRolePolicy(PolicyStatement statement)public bool AddToDeploymentRolePolicy(PolicyStatement statement)func AddToDeploymentRolePolicy(Statement PolicyStatement) *bool#
Add statement to the service role assumed by CloudFormation while executing this action.
bind(scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfigdef bind(self, scope: Construct, stage: IStage, options: ActionBindOptions) -> ActionConfigpublic ActionConfig bind(Construct scope, IStage stage, ActionBindOptions options)public ActionConfig Bind(Construct scope, IStage stage, ActionBindOptions options)func Bind(Scope Construct, Stage IStage, Options ActionBindOptions) ActionConfig#
The callback invoked when this Action is added to a Pipeline.
onStateChange(name: string, target?: IRuleTarget, options?: RuleProps): Ruledef on_state_change(self, name: str, target: typing.Optional[IRuleTarget] = None, options: typing.Optional[RuleProps] = None) -> Rulepublic Rule onStateChange(String name, IRuleTarget target, RuleProps options)public Rule OnStateChange(string name, IRuleTarget? target = null, RuleProps? options = null)func OnStateChange(Name *string, Target IRuleTarget, Options RuleProps) Rule#
Creates an Event that will be triggered whenever the state of this Action changes.