How to change new instance tag Name when auto scaling

0 votes

I've created a new Alarm on my AWS account based on a Metric that I also have created. I use this alarm to auto scale. When launching new instances I'm using User Data field to set up this new instance. The problem I'm facing is that I cannot modify the tags of this new instance. If I don't change that, all the new instances will have the same name which won't work with my current setup.

Is it possible to solve that?

Oct 29, 2018 in AWS by datageek
• 3,090 points
3,597 views

1 answer to this question.

0 votes

You can set up a new Name tag for the instance in its own user data script using AWS CLI tools and the instance metadata. It would look like this:

aws ec2 create-tags \ --resources $(curl -s http://169.254.169.254/latest/meta-data/instance-id) \ --tag Key=Name,Value=MyNewNiceName \ --region=us-east-1

answered Oct 29, 2018 by Archana
• 5,640 points

Related Questions In AWS

0 votes
0 answers
0 votes
1 answer

How to attach an instance to an Auto Scaling group in AWS?

Hi@akhtar, You can attach one or more EC2 instances ...READ MORE

answered Nov 26, 2020 in AWS by MD
• 95,460 points
1,874 views
+1 vote
1 answer

How to auto-scale MYSQL database in AWS EC2 instance?

You could always use the Amazon RDS ...READ MORE

answered Aug 24, 2018 in AWS by Archana
• 4,170 points
2,907 views
0 votes
1 answer

How to create new stack using create-change-set in AWS Cloudformation

The type of change set operation. To ...READ MORE

answered Sep 18, 2018 in AWS by Priyaj
• 58,100 points
3,903 views
0 votes
1 answer

How to change the instance type in AWS?

Using the AWS Console. You can follow ...READ MORE

answered Mar 26, 2019 in AWS by Esha
985 views
0 votes
1 answer

How to change the name of a repository in AWS CodeCommit?

Hi@akhtar, You can rename a repository. The repository name ...READ MORE

answered Nov 25, 2020 in AWS by MD
• 95,460 points
2,738 views
0 votes
1 answer

How to attach a load balancer to an Auto Scaling group in AWS?

Hi@akhtar, You can attach one or more Classic Load ...READ MORE

answered Nov 26, 2020 in AWS by MD
• 95,460 points
880 views
0 votes
1 answer
0 votes
1 answer

How to allocate IP address in VPC to RDS instance?

The instance will already have an IP ...READ MORE

answered Oct 31, 2018 in AWS by Archana
• 5,640 points
2,775 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP