1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
You're setting associatePublicIpAddress on the ASG. You need to either set it on the launch template; or change the subnets default behavior to associatePublicIpAddress=true
. Just having an IGW doesn't automatically change this setting for the subnet, and the default is false except for the default subnets in your default VPC
The code function you linked is called "verifyNoLaunchConfigPropIsGiven"; meaning those properties were for launch configurations (the older feature that has since been replaced by launch templates)
répondu il y a 2 ans
Contenus pertinents
- demandé il y a un an
- demandé il y a 2 mois
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 4 mois
Thanks, Shahad! I wasn't aware of the
mapPublicIpOnLaunch
Subnet property. I think setting that will be ok as these will be the only instances we launch in our public subnets.Is it possible to set
associatePublicIpAddress=true
in the launch template? From looking at the docs (https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.LaunchTemplate.html), there doesn't seem to be anetworkInterfaces
property. Were you talking about going down to the cfn level and manually setting it like this:Whoops, should have included those details, sorry about that. But yes, exactly correct. For the Launch Template method you would need to directly set the CFN property. However, it sounds like for your usecase the subnet option is much simpler