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 回答
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
AWS
已回答 2 年前
  • 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

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则