DestroyOptions

class aws_cdk.cloud_assembly_schema.DestroyOptions(*, all=None, app=None, asset_metadata=None, ca_bundle_path=None, color=None, context=None, debug=None, ec2_creds=None, ignore_errors=None, json=None, lookups=None, notices=None, output=None, path_metadata=None, profile=None, proxy=None, role_arn=None, stacks=None, staging=None, strict=None, trace=None, verbose=None, version_reporting=None, exclusively=None, force=None)

Bases: DefaultCdkOptions

Options to use with cdk destroy.

Parameters
  • all (Optional[bool]) – Deploy all stacks. Requried if stacks is not set Default: - false

  • app (Optional[str]) – command-line for executing your app or a cloud assembly directory e.g. “node bin/my-app.js” or “cdk.out”. Default: - read from cdk.json

  • asset_metadata (Optional[bool]) – Include “aws:asset:*” CloudFormation metadata for resources that use assets. Default: true

  • ca_bundle_path (Optional[str]) – Path to CA certificate to use when validating HTTPS requests. Default: - read from AWS_CA_BUNDLE environment variable

  • color (Optional[bool]) – Show colors and other style from console output. Default: true

  • context (Optional[Mapping[str, str]]) – Additional context. Default: - no additional context

  • debug (Optional[bool]) – enable emission of additional debugging information, such as creation stack traces of tokens. Default: false

  • ec2_creds (Optional[bool]) – Force trying to fetch EC2 instance credentials. Default: - guess EC2 instance status

  • ignore_errors (Optional[bool]) – Ignores synthesis errors, which will likely produce an invalid output. Default: false

  • json (Optional[bool]) – Use JSON output instead of YAML when templates are printed to STDOUT. Default: false

  • lookups (Optional[bool]) – Perform context lookups. Synthesis fails if this is disabled and context lookups need to be performed Default: true

  • notices (Optional[bool]) – Show relevant notices. Default: true

  • output (Optional[str]) – Emits the synthesized cloud assembly into a directory. Default: cdk.out

  • path_metadata (Optional[bool]) – Include “aws:cdk:path” CloudFormation metadata for each resource. Default: true

  • profile (Optional[str]) – Use the indicated AWS profile as the default environment. Default: - no profile is used

  • proxy (Optional[str]) – Use the indicated proxy. Will read from HTTPS_PROXY environment if specified Default: - no proxy

  • role_arn (Optional[str]) – Role to pass to CloudFormation for deployment. Default: - use the bootstrap cfn-exec role

  • stacks (Optional[Sequence[str]]) – List of stacks to deploy. Requried if all is not set Default: - []

  • staging (Optional[bool]) – Copy assets to the output directory. Needed for local debugging the source files with SAM CLI Default: false

  • strict (Optional[bool]) – Do not construct stacks with warnings. Default: false

  • trace (Optional[bool]) – Print trace for stack warnings. Default: false

  • verbose (Optional[bool]) – show debug logs. Default: false

  • version_reporting (Optional[bool]) – Include “AWS::CDK::Metadata” resource in synthesized templates. Default: true

  • exclusively (Optional[bool]) – Only destroy the given stack. Default: false

  • force (Optional[bool]) – Do not ask for permission before destroying stacks. Default: false

ExampleMetadata

infused

Example:

app = App()

stack_under_test = Stack(app, "StackUnderTest")

stack = Stack(app, "stack")

test_case = IntegTest(app, "CustomizedDeploymentWorkflow",
    test_cases=[stack_under_test],
    diff_assets=True,
    stack_update_workflow=True,
    cdk_command_options=CdkCommands(
        deploy=DeployCommand(
            args=DeployOptions(
                require_approval=RequireApproval.NEVER,
                json=True
            )
        ),
        destroy=DestroyCommand(
            args=DestroyOptions(
                force=True
            )
        )
    )
)

Attributes

all

Deploy all stacks.

Requried if stacks is not set

Default
  • false

Return type

Optional[bool]

app

command-line for executing your app or a cloud assembly directory e.g. “node bin/my-app.js” or “cdk.out”.

Default
  • read from cdk.json

Return type

Optional[str]

asset_metadata

*” CloudFormation metadata for resources that use assets.

Default

true

Type

Include “aws

Type

asset

Return type

Optional[bool]

ca_bundle_path

Path to CA certificate to use when validating HTTPS requests.

Default
  • read from AWS_CA_BUNDLE environment variable

Return type

Optional[str]

color

Show colors and other style from console output.

Default

true

Return type

Optional[bool]

context

Additional context.

Default
  • no additional context

Return type

Optional[Mapping[str, str]]

debug

enable emission of additional debugging information, such as creation stack traces of tokens.

Default

false

Return type

Optional[bool]

ec2_creds

Force trying to fetch EC2 instance credentials.

Default
  • guess EC2 instance status

Return type

Optional[bool]

exclusively

Only destroy the given stack.

Default

false

Return type

Optional[bool]

force

Do not ask for permission before destroying stacks.

Default

false

Return type

Optional[bool]

ignore_errors

Ignores synthesis errors, which will likely produce an invalid output.

Default

false

Return type

Optional[bool]

json

Use JSON output instead of YAML when templates are printed to STDOUT.

Default

false

Return type

Optional[bool]

lookups

Perform context lookups.

Synthesis fails if this is disabled and context lookups need to be performed

Default

true

Return type

Optional[bool]

notices

Show relevant notices.

Default

true

Return type

Optional[bool]

output

Emits the synthesized cloud assembly into a directory.

Default

cdk.out

Return type

Optional[str]

path_metadata

path” CloudFormation metadata for each resource.

Default

true

Type

Include “aws

Type

cdk

Return type

Optional[bool]

profile

Use the indicated AWS profile as the default environment.

Default
  • no profile is used

Return type

Optional[str]

proxy

Use the indicated proxy.

Will read from HTTPS_PROXY environment if specified

Default
  • no proxy

Return type

Optional[str]

role_arn

Role to pass to CloudFormation for deployment.

Default
  • use the bootstrap cfn-exec role

Return type

Optional[str]

stacks

List of stacks to deploy.

Requried if all is not set

Default
  • []

Return type

Optional[List[str]]

staging

Copy assets to the output directory.

Needed for local debugging the source files with SAM CLI

Default

false

Return type

Optional[bool]

strict

Do not construct stacks with warnings.

Default

false

Return type

Optional[bool]

trace

Print trace for stack warnings.

Default

false

Return type

Optional[bool]

verbose

show debug logs.

Default

false

Return type

Optional[bool]

version_reporting

Include “AWS::CDK::Metadata” resource in synthesized templates.

Default

true

Return type

Optional[bool]