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 Antwort
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
beantwortet vor 2 Jahren
  • 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

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen