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 réponse
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
répondu il y a 2 ans
  • 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

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions