By using AWS re:Post, you agree to the Terms of Use

missing properties in InstanceProps interface

0

Hi team,

I'm creating an ec2 instance via CDK, but I can't find how to set:

  • Termination protection (Enabled)
  • Answer private resource DNS name (IPv4 (A))

I can't find those 2 properties on InstanceProps interface

are they supported by CDK?

Thank you!

1 Answer
0

From the CDK documentation (2) , we are unable to enable instance termination protection; although we can enable CDK stack terminationProtection (1). We can configure private DNS Name (IPv4 A) using instancePrivateIp Properties (2).

For more details, refers to:

  1. https://bobbyhadz.com/blog/enable-termination-protection-cdk
  2. https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ec2.Instance.html
answered 19 days ago
  • Thank you for your answer,

    if I use instancePrivateIp, I force my instance to have a specific IP so I just want the instance to get one available private IP address at the time of deploying the stack

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions