-
Notifications
You must be signed in to change notification settings - Fork 328
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
base: master
Are you sure you want to change the base?
Conversation
…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
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
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.