Skip to content

CloudFormation  >  Operations  >  update_termination_protection

update_termination_protection

Operation

update_termination_protection async

update_termination_protection(input: UpdateTerminationProtectionInput, plugins: list[Plugin] | None = None) -> UpdateTerminationProtectionOutput

Updates termination protection for the specified stack. If a user attempts to delete a stack with termination protection enabled, the operation fails and the stack remains unchanged. For more information, see Protect a CloudFormation stack from being deleted in the CloudFormation User Guide.

For nested stacks, termination protection is set on the root stack and can't be changed directly on the nested stack.

Parameters:

Name Type Description Default
input UpdateTerminationProtectionInput

An instance of UpdateTerminationProtectionInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
UpdateTerminationProtectionOutput

An instance of UpdateTerminationProtectionOutput.

Input

UpdateTerminationProtectionInput dataclass

Bases: _SerdeShape

Dataclass for UpdateTerminationProtectionInput structure.

Attributes

enable_termination_protection class-attribute instance-attribute
enable_termination_protection: bool | None = ...

Whether to enable termination protection on the specified stack.

stack_name class-attribute instance-attribute
stack_name: str | None = ...

The name or unique ID of the stack for which you want to set termination protection.

Output

UpdateTerminationProtectionOutput dataclass

Bases: _SerdeShape

Dataclass for UpdateTerminationProtectionOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

stack_id class-attribute instance-attribute
stack_id: str | None = ...

The unique ID of the stack.