HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Why don't the instances in the auto-scaling group get assigned public ip addresses unless it's a default vpc?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
whytheunlessinstancesgroupautopublicscalingvpcdefault

Problem

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.

Solution

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:

  • Go to your AWS console, select Launch Configurations, select staging-1-codedeploy



  • At the bottom of the details, click the grey Copy Configuration button on the right.



  • ClickEdit Details link, then click Advanced Details on the resulting page.



  • Go to IP Address Type and select the second option, Assign a public IP address to every instance.



  • [optional] Change the name of the launch configuration if need be and



  • 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.

Context

StackExchange DevOps Q#4651, answer score: 1

Revisions (0)

No revisions yet.