Is there a way for a running instance, via the meta-data facility to find out the ec2 account name that the instance is running under?

Looking up the meta-data service yields the following items we can query:

ami-id
ami-launch-index
ami-manifest-path
hostname
instance-id
local-ipv4
public-keys/
reservation-id
security-groups

None of which satisfy this - any ideas?

link|improve this question

56% accept rate
feedback

1 Answer

Pass the EC2 account data you need as user data to the instance. You can retrieve the user data passed to an instance by running curl http://169.254.169.254/1.0/user-data on the instance.

link|improve this answer
yeah already using that - but would be nice if it was automatic - but user data works fine. – Michael Neale Jul 16 '10 at 5:19
is userdata only settable when you create the instance? (I haven't found a way to tweak it after booting) – Joel K Nov 5 '10 at 6:19
EC2 user data is set as a boot parameter and read-only afterwards. – earl Nov 6 '10 at 5:09
feedback

Your Answer

 
or
required, but never shown

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