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 EC2 IMDS endpoint from environment variable #3504

Merged
merged 3 commits into from Aug 28, 2020

Conversation

jasdel
Copy link
Contributor

@jasdel jasdel commented Aug 25, 2020

Adds support for specifying a custom EC2 IMDS endpoint from the environment variable, AWS_EC2_METADATA_SERVICE_ENDPOINT.

AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1]

The aws/session#Options struct also has a new field, EC2IMDSEndpoint. This field can be used to configure the custom endpoint of the EC2 IMDS client. The option only applies to EC2 IMDS clients created after the Session with EC2IMDSEndpoint is specified.

sess, err := session.NewSessionWithOptions(session.Options{
	EC2IMDSEndpoint: "http://[::1]",
})

Adds support for specifying a custom EC2 IMDS endpoint from the
environment variable, `AWS_EC2_METADATA_SERVICE_ENDPOINT`.

The `aws/session#Options` struct also has a new field,
`EC2IMDSEndpoint`. This field can be used to configure the custom
endpoint of the EC2 IMDS client. The option only applies to EC2 IMDS
clients created after the Session with EC2IMDSEndpoint is specified.

```go
sess, err := session.NewSessionWithOptions(session.Options{
	EC2IMDSEndpoint: "http://[::1]",
})
```
@jasdel jasdel merged commit 38c74ca into aws:master Aug 28, 2020
@jasdel jasdel deleted the feat/IMDSEnvVar branch August 28, 2020 22:52
aws-sdk-go-automation pushed a commit that referenced this pull request Aug 31, 2020
===

### Service Client Updates
* `service/backup`: Updates service documentation
* `service/cloudfront`: Updates service API and documentation
  * CloudFront now supports real-time logging for CloudFront distributions. CloudFront real-time logs are more detailed, configurable, and are available in real time.
* `service/ec2`: Updates service API and documentation
  * Amazon EC2 and Spot Fleet now support modification of launch template configs for a running fleet enabling instance type, instance weight, AZ, and AMI updates without losing the current fleet ID.
* `service/sqs`: Updates service documentation
  * Documentation updates for SQS.

### SDK Bugs
* `aws/ec2metadata`: Add support for EC2 IMDS endpoint from environment variable ([#3504](#3504))
  * Adds support for specifying a custom EC2 IMDS endpoint from the environment variable, `AWS_EC2_METADATA_SERVICE_ENDPOINT`.
  * The `aws/session#Options` struct also has a new field, `EC2IMDSEndpoint`. This field can be used to configure the custom endpoint of the EC2 IMDS client. The option only applies to EC2 IMDS clients created after the Session with `EC2IMDSEndpoint` is specified.
aws-sdk-go-automation added a commit that referenced this pull request Aug 31, 2020
Release v1.34.14 (2020-08-31)
===

### Service Client Updates
* `service/backup`: Updates service documentation
* `service/cloudfront`: Updates service API and documentation
  * CloudFront now supports real-time logging for CloudFront distributions. CloudFront real-time logs are more detailed, configurable, and are available in real time.
* `service/ec2`: Updates service API and documentation
  * Amazon EC2 and Spot Fleet now support modification of launch template configs for a running fleet enabling instance type, instance weight, AZ, and AMI updates without losing the current fleet ID.
* `service/sqs`: Updates service documentation
  * Documentation updates for SQS.

### SDK Bugs
* `aws/ec2metadata`: Add support for EC2 IMDS endpoint from environment variable ([#3504](#3504))
  * Adds support for specifying a custom EC2 IMDS endpoint from the environment variable, `AWS_EC2_METADATA_SERVICE_ENDPOINT`.
  * The `aws/session#Options` struct also has a new field, `EC2IMDSEndpoint`. This field can be used to configure the custom endpoint of the EC2 IMDS client. The option only applies to EC2 IMDS clients created after the Session with `EC2IMDSEndpoint` is specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants