# How to get an EC2 Windows equipment is instance - id right into a set variable

I have a batch file that I would certainly such as to work on start-up of an EC2 Windows AMI. The program I would certainly such as to range from that batch file takes the instance - id of the EC2 equipment as a parameter. What is the most basic means to get that Instance ID passed as an argument to that program?

From Amazon's Documentation on the subject, I see that you are intended to release a WGET to a defined URL and also parse the feedback. So an alternative means of wording this inquiry could be "How do I pass the materials of a HTTP demand to a program as an argument in a Windows set file"

In pseudocode, this is what I would certainly such as to do :

set ID = GET http://169.254.169.254/2008-08-08/meta-data/instance-id
myprogram.exe /instanceID=%ID%


Any pointers on just how I might continue?

0
2019-12-06 14:37:21
Source Share