[ec2-beta] Get security group from within instance?

Andreas Hasenack andreas at canonical.com
Tue Jan 27 17:18:18 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Darren Govoni wrote:
> Hi guys,
>    Sorry for the bevy of questions as late. Hopefully, they are useful
> to others lurking.
> 
> Anyway, I reviewed the amazon tools as best I could to see if I could
> get the security group of the instance I am running in, but didn't find
> exactly what I need.
> 
> Basically, I want to use the security group as a kind of dynamic
> configuration key. Ergo, once an instance boots, it needs to identify
> what security group it is in and then it will use that for other things.
> 
> Is there a way to get the security group of the instance from within
> itself easily? i.e. without passing anything to the instance.

You can access this URL:
http://169.254.169.254/2008-02-01/meta-data/security-groups

Check here for other parameters that you can retrieve:

http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/


- --
Andreas Hasenack
andreas at canonical.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl/QdkACgkQeEJZs/PdwpAZVACfdE9RLWFlUtc5ydPnulf7Ga3h
xUIAni0BSQWm78rhEDyHJ5+LFSgoLw9q
=Yy+D
-----END PGP SIGNATURE-----




More information about the Ec2-beta mailing list