Giter Club home page Giter Club logo

Comments (6)

gjbae1212 avatar gjbae1212 commented on May 26, 2024

mfa credential doesn’t set default credential forcibly.

default credential has used it in default.
But if mfa credential file is to exist and to validate, used it.

from gossm.

yhakbar avatar yhakbar commented on May 26, 2024

@gjbae1212 if a user does not set AWS_SHARED_CREDENTIALS_FILE, then the default behavior for the golang AWS SDK is not used (gossm doesn't try to use $HOME/.aws/credentials, but instead replaces the value with $HOME/.aws/credentials_mfa on this line

os.Setenv("AWS_SHARED_CREDENTIALS_FILE", _credentialWithMFA)
).

from gossm.

gjbae1212 avatar gjbae1212 commented on May 26, 2024

you should read more than code.

if cred.Expired() || cred.AccessKeyID == "" || cred.SecretAccessKey == "" {

from gossm.

yhakbar avatar yhakbar commented on May 26, 2024

When attempting to use gossm, I get the following error:

[err] [err][cmd.initConfig:209] [err][internal.NewSharedConfig:61] failed to load assume role *my role arn*, of profile default, <nil>

If I run this, the error goes away:

export AWS_SHARED_CREDENTIALS_FILE=$HOME/.aws/credentials

In my setup, I'm performing role assumption and handling MFA outside of gossm.

This is what my ~/.aws/credentials file looks like:

[default]
aws_session_token     = session token
aws_access_key_id     = temporary access key id
aws_secret_access_key = temporary secret key

[my-profile]
role_arn       = role arn
source_profile = default

This is what my ~/.aws/config file looks like:

[default]
output     = json
mfa_serial = mfa arn

[profile my-profile]
role_arn       = role arn
source_profile = default

Let me know if you think I'm using gossm wrong. Thanks for your help!

from gossm.

gjbae1212 avatar gjbae1212 commented on May 26, 2024

Update gossm v1.4.2. Ignore a panic.

from gossm.

yhakbar avatar yhakbar commented on May 26, 2024

Thanks for addressing this @gjbae1212 !

I think the issue might still exist:

$ gossm --version
gossm version v1.4.2
$ gossm start 
[err] [err][cmd.initConfig:249] [err][internal.NewSharedConfig:61] failed to load assume role *my-role-arn*, of profile default, <nil>

It seems you're open to having gossm change to make this use-case work, though. I'll try to get you a PR addressing this today.

from gossm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.