How to enable EC2 Instance termination protection in AWS CDK?

Viewed 29
1 Answers

Yes, you will have to use the L1 construct: CfnInstance.

This construct has the disableApiTermination prop which can be set to true to enable termination protection.

disableApiTermination? Type: boolean | IResolvable (optional)

If you set this parameter to true , you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can.

Default: false

Related