Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Export assumed role ARN metadata #87

Merged
merged 2 commits into from
Nov 26, 2018
Merged

Export assumed role ARN metadata #87

merged 2 commits into from
Nov 26, 2018

Conversation

toothbrush
Copy link
Member

Description

Some of our users have asked to have yak expose what account or
environment is currently active. We've introduced an environment
variable AWS_METADATA_USER_ARN, from which you or your script will
be able to deduce which Amazon account is active, and what role you
have.

Closes #86.

Changes

  • aws/aws.go (EnvironmentVariables): Change parameter to be the entire
    sts.AssumeRoleWithSAMLOutput object, instead of just the
    sts.Credentials object. This gives us access to the assumed role
    user, too.
  • cmd/shim.go (shimCmd): Update aws.EnvironmentVariables call site.
  • format/format.go (outputFormatters): Update aws.EnvironmentVariables
    call site.
  • aws/aws_test.go (TestEnvironmentVariables): Update environment
    variable test to include assumed role ARN.
  • format/format_test.go (TestDefaultEnvCredentials): Update formatter
    test to include assumed role ARN.

toothbrush and others added 2 commits November 22, 2018 14:14
Some of our users have asked to have `yak` expose what account or
environment is currently active.  We've introduced an environment
variable `AWS_METADATA_USER_ARN`, from which you or your script will
be able to deduce which Amazon account is active, and what role you
have.

* aws/aws.go (EnvironmentVariables): Change parameter to be the entire
  sts.AssumeRoleWithSAMLOutput object, instead of just the
  sts.Credentials object.  This gives us access to the assumed role
  user, too.
* cmd/shim.go (shimCmd): Update aws.EnvironmentVariables call site.
* format/format.go (outputFormatters): Update aws.EnvironmentVariables
  call site.
* aws/aws_test.go (TestEnvironmentVariables): Update environment
  variable test to include assumed role ARN.
* format/format_test.go (TestDefaultEnvCredentials): Update formatter
  test to include assumed role ARN.

Closes #86.

Co-authored-by: Michael V. <michael.vigilante@redbubble.com>
Copy link
Contributor

@lucaswilric lucaswilric left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@liamjamesfoley liamjamesfoley left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

@rbvigilante
Copy link
Contributor

@rb-johnmurphy: How do you feel about this?

@rbvigilante rbvigilante merged commit e41f681 into master Nov 26, 2018
@rbvigilante rbvigilante deleted the export-arn-metadata branch November 26, 2018 22:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants