Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have to host an AMI in the Amazon Marketplace. i need to get the type of instance, whenever some user launches the AMI., like if its small medium or large. based on that i need to make some changes in the AMI when its created. I can do this with Amazon API call, to get the instance type, but the problem is that the instances created with the AMI will be started by other users, and i cannot use my AWS Credentials in the Amazon API.

Is there any way that i can create an anonymous readonly user to make only specific type of EC2 API Calls? Or can i encrypt my EC2 API credentials, so no one can use it?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

If you just need the instance-type then you can write code/script which browse the URL 'http://169.254.169.254/latest/meta-data/instance-type' which returns the instance-type. It doesn't requires AWS account credentials.

Ref: http://docs.amazonwebservices.com/AWSEC2/2008-12-01/DeveloperGuide/index.html?AESDG-chapter-instancedata.html

share|improve this answer
    
This should be the accepted answer. Much better way of doing it. Faster and easier. –  ceejayoz Sep 5 '12 at 18:39

You can use IAM to create a read-only user. This is simple, you need to create the user in IAM via the AWS console, then you need to assign it a Policy, the policy should say it's a read-only user.

share|improve this answer
    
but readonly user wont be able to make other API Calls as well? which are sensitive and its information should not be disclosed? actually i want a way to ONLY call this single function, and block all other calls. –  Farhan Sep 3 '12 at 8:58
    
You can create an Advanced Policy by selecting what exactly you need to use and not allow everything else in such a case. As for the encryption - calls to the API are done via https, thus the information flow is encrypted. –  Logic Wreck Sep 3 '12 at 9:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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