aws-cdk-lib.cloud_assembly_schema.DestroyCommand

interface DestroyCommand

LanguageType name
.NETAmazon.CDK.CloudAssembly.Schema.DestroyCommand
Gogithub.com/aws/aws-cdk-go/awscdk/v2/cloudassemblyschema#DestroyCommand
Javasoftware.amazon.awscdk.cloudassembly.schema.DestroyCommand
Pythonaws_cdk.cloud_assembly_schema.DestroyCommand
TypeScript (source)aws-cdk-lib » cloud_assembly_schema » DestroyCommand

Represents a cdk destroy command.

Example

const app = new App();

const stackUnderTest = new Stack(app, 'StackUnderTest', /* ... */);

const stack = new Stack(app, 'stack');

const testCase = new IntegTest(app, 'CustomizedDeploymentWorkflow', {
  testCases: [stackUnderTest],
  diffAssets: true,
  stackUpdateWorkflow: true,
  cdkCommandOptions: {
    deploy: {
      args: {
        requireApproval: RequireApproval.NEVER,
        json: true,
      },
    },
    destroy: {
      args: {
        force: true,
      },
    },
  },
});

Properties

NameTypeDescription
args?DestroyOptionsAdditional arguments to pass to the command This can be used to test specific CLI functionality.
enabled?booleanWhether or not to run this command as part of the workflow This can be used if you only want to test some of the workflow for example enable synth and disable deploy & destroy in order to limit the test to synthesis.
expectError?booleanIf the runner should expect this command to fail.
expectedMessage?stringThis can be used in combination with expectedError to validate that a specific message is returned.

args?

Type: DestroyOptions (optional, default: only default args are used)

Additional arguments to pass to the command This can be used to test specific CLI functionality.


enabled?

Type: boolean (optional, default: true)

Whether or not to run this command as part of the workflow This can be used if you only want to test some of the workflow for example enable synth and disable deploy & destroy in order to limit the test to synthesis.


expectError?

Type: boolean (optional, default: false)

If the runner should expect this command to fail.


expectedMessage?

Type: string (optional, default: do not validate message)

This can be used in combination with expectedError to validate that a specific message is returned.