Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for user-data from ec2metadata service #852

Closed
misham opened this issue Sep 25, 2016 · 4 comments
Closed

Add support for user-data from ec2metadata service #852

misham opened this issue Sep 25, 2016 · 4 comments
Labels
feature-request A feature should be added or improved.

Comments

@misham
Copy link

misham commented Sep 25, 2016

I don't want to allow an instance to use EC2 service to query user-data in general and would like to rely on metadata service instead, since that does not require any permissions.

@jasdel
Copy link
Contributor

jasdel commented Sep 26, 2016

thanks for contacting us @misham. The SDK has basic EC2 meta data access with the the aws/ec2metadata#EC2Metadata client. This client can read from any metadata path, but it's limited in what content it has built in Go types for.

Is this what your looking for, or is there a specific metadata path that would be helpful for the SDK to parse?

@jasdel
Copy link
Contributor

jasdel commented Sep 26, 2016

I took a second look at the ec2metadat client and see what was missing. I think to support this a GetUserData method just needs to be added to the EC2Metadata client. Marking this is a feature request so we can track its change. We're also always glad to review PRs if you're looking to make a change.

@jasdel jasdel added the feature-request A feature should be added or improved. label Sep 26, 2016
jasdel added a commit to jasdel/aws-sdk-go that referenced this issue Oct 5, 2016
Adds the `GetUserData` method to `EC2Metadata` client. This allows you
to get instance user data from the `/latest/user-data` EC2 metadata
endpoint.

If the instance does not have any data set the error code
`NotFoundError` will be returned. If any data is set that value as a
string will be returned by the method.

Fix aws#852
jasdel added a commit that referenced this issue Oct 5, 2016
Adds the `GetUserData` method to `EC2Metadata` client. This allows you
to get instance user data from the `/latest/user-data` EC2 metadata
endpoint.

If the instance does not have any data set the error code
`NotFoundError` will be returned. If any data is set that value as a
string will be returned by the method.

Fix #852
@jasdel
Copy link
Contributor

jasdel commented Oct 5, 2016

Hi @misham I merged in PR #872 that adds the user-data support to the ec2metadata client. Let us know if you have any questions or feedback.

@misham
Copy link
Author

misham commented Oct 5, 2016

Wow, that was fast. Thank you!

I'll test it out in the next couple of days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants