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

Added code to save the managed instance's region to the stored cred profile #97

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

thedevopsmachine
Copy link

Added code to save the managed instance's region to the stored credential profile

Scripts that use the .NET Cmdlets and aws command line tools will automatically detect the AWS Region from the EC2 instance profile, however, this is not the case for on-prem servers, since they don't have the EC2 Metadata service. By adding the Region to the shared credentials file, the SDK will be able to discover the region automatically. This will ensure that scripts that run on on-prem servers will run the same way as they would on EC2 instances, without any modification.

…e. This feature ensures that Documents invoked on on-prem instances function the same as those invoked on EC2 instances.
…e. This feature ensures that Documents invoked on on-prem instances function the same as those invoked on EC2 instances.
…tial profile

Scripts that use the .NET Cmdlets and aws command line tools will automatically detect the AWS Region from the EC2 instance profile, however, this is not the case for on-prem servers, since they don't have the EC2 Metadata service. By adding the Region to the shared credentials file, the SDK will be able to discover the region automatically. This will ensure that scripts that run on on-prem servers will run the same way as they would on EC2 instances, without any modification.
…have run, to ensure no pollution of later tests. Also altered the s3util so that if it fails to retrieve the instance region it returns an actual default value rather than an empty string, as well as logging the actual error message that occurred.
…n it returns an actual default value rather than an empty string
@nehalaws nehalaws closed this Sep 17, 2018
@nehalaws nehalaws reopened this Sep 17, 2018
@dimaAmz
Copy link

dimaAmz commented Oct 22, 2018

Hi thedevopsmachine, thank you for submitting the pull request. We're reviewing it. Please reply to comments for the code change.

@@ -29,6 +29,7 @@ var (
accessKeyID = "accessKeyID"
secretAccessKey = "secretAccessKey"
sessionToken = "sessionToken"
region = "us-east-1"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is not used

@@ -30,6 +30,7 @@ const (
accessKey = "DummyAccessKey"
accessSecretKey = "DummyAccessSecretKey"
token = "DummyToken"
region = "us-east-1"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is not used

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.

3 participants