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 would like to set a user-data script on my EC2 instances like this:

#include
http://mybucket.s3.amazonaws.com/myapp/environment/aws_init.sh

However the resource is acl private and cannot be accessed without credentials.

There are multiple solutions to this issue, such as using curl modified to compute credentials to append in a request or tools like s3cmd, all of which reads credentials stored somewhere.

I would like to know if IAM can help here, given this is a autoscale configuration, in getting and executing this file.

I was reading here: http://aws.amazon.com/iam/

Introducing roles for EC2 instances

Roles for EC2 instances is a new feature that makes it easier for you to securely access AWS services from within your EC2 instances. It ensures that you automatically will have valid AWS access keys on your EC2 instances, and makes it easier for you to control the AWS service permissions you want to grant to applications running on your EC2 instances. To the right is a short video that illustrates how easy it is to get started. Visit the Working with roles section in the Using IAM guide for more details.

Will it work in a situation like this?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Well, once a IAM role has been set one can perform a GET to the appropriate internal endpoint to get the credentials, so the answer is yes.

Hope it helps someone else.

share|improve this answer

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.