I'm trying to migrate our deployment process over to aws code deploy (by following instructions here:https://pionect.nl/autoscaling-aws-laravel-codedeploy-opsworks-chef-automation/).

When I'm creating the auto-scaling group, I selected the same vpc as my other instances belong to. However when I do that, it says that it the ec2 instance will not be assigned a public ip. How come? My other instances have the same vpc id and are assigned an ip address just fine.

enter image description here

enter image description here

1 Answer 1


I got the answer from AWS support:

The reason why you are seeing that notification is because it is in accordance to your launch configuration (staging-1-deploy) settings. During the creation of a launch configuration, the assignment of public IP addresses to EC2 instances defaults to Only assign a public IP address to instances launched in the default VPC and subnet. (default) [1]. To support automatic assignment of public IP addresses to your EC2 instances as they are launched, you will have to change the launch configuration settings. Since a launch configuration cannot be edited [2], you can create a new one by copying your current launch configuration. Follow the steps below to achieve this:

  1. Go to your AWS console, select Launch Configurations, select staging-1-codedeploy
  2. At the bottom of the details, click the grey Copy Configuration button on the right.
  3. ClickEdit Details link, then click Advanced Details on the resulting page.
  4. Go to IP Address Type and select the second option, Assign a public IP address to every instance.
  5. [optional] Change the name of the launch configuration if need be and
  6. Save launch configuration

You can now proceed to use your new launch configuration for your auto-scaling group and all your EC2 instances will be assigned public IP addresses as desired. I have attached a few screenshots to show some of the steps described above.

  • Where's the screenshots you mentioned?
    – Gene
    Commented Jan 15, 2019 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.