# CloudFormationDeleteStackAction

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.

Extends: Action › Action › CloudFormationDeleteStackAction
Implements: IAction

- Source: [`aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts#L489)

## 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',
});
```

## Initializer

```ts
new CloudFormationDeleteStackAction(props: CloudFormationDeleteStackActionProps)
```

## Properties

- `actionProperties`: [ActionProperties](/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.ActionProperties.html) (required) — The simple properties of the Action, like its Owner, name, etc.

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

- `deploymentRole`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) (required)

## Methods

- `addToDeploymentRolePolicy(statement: PolicyStatement): boolean` — Add statement to the service role assumed by CloudFormation while executing this action.

- `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): Rule` — Creates an Event that will be triggered whenever the state of this Action changes.
