Aws-cdk: Profile based credentials don't work with credential_process

Created on 22 Jun 2019  路  11Comments  路  Source: aws/aws-cdk

  • I'm submitting a ...

    • [X] :beetle: bug report
    • [ ] :rocket: feature request
    • [ ] :books: construct library gap
    • [ ] :phone: security issue or vulnerability => Please see policy
    • [ ] :question: support request => Please see note at the top of this template.
  • What is the current behavior?
    If the current behavior is a :beetle:bug:beetle:: Please provide the steps to reproduce

When using --profile (see also #3007), the CLI doesn't respect credential_process. The profile has to have hardcoded credentials.

  • What is the expected behavior (or behavior of feature suggested)?

credentials_process is respected and invoked the same way other AWS CLI tools do.

  • What is the motivation / use case for changing the behavior or adding this feature?

Parity with AWS CLI.

  • Please tell us about your environment:

    • CDK CLI Version: 0.35.0
    • Module Version: 0.35.0
    • OS: macOS Mojave
    • Language: TypeScript
bug efformedium in-progress p1 packagtools

Most helpful comment

https://github.com/aws/aws-cdk/blob/986e2814e072f0334d8470a2d60ea73dcceadfe4/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts#L42-L45

I can hack my way to making this work by adding a line here, though there may be other consequences...

    const sources = [
      () => new AWS.EnvironmentCredentials('AWS'),
      () => new AWS.EnvironmentCredentials('AMAZON'),
      () => new AWS.ProcessCredentials({ profile }),
    ];

All 11 comments

Limitation of the AWS SDK for JavaScript we're using. Nothing to do for us here, you should file a feature request with them: https://github.com/aws/aws-sdk-js

Duplicate: https://github.com/awslabs/aws-cdk/issues/1656

@rix0rrr is that the case? I am seeing some PRs that implement credentials_process: https://github.com/aws/aws-sdk-js/pull/2559

@rix0rrr could you please reopen this ticket? The aws-sdk-js DOES support process credentials now.

https://github.com/aws/aws-cdk/blob/986e2814e072f0334d8470a2d60ea73dcceadfe4/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts#L42-L45

I can hack my way to making this work by adding a line here, though there may be other consequences...

    const sources = [
      () => new AWS.EnvironmentCredentials('AWS'),
      () => new AWS.EnvironmentCredentials('AMAZON'),
      () => new AWS.ProcessCredentials({ profile }),
    ];

Please reopen!

marking as p1 to prioritize a fix

[not a contribution]

Hey is there any update on this issue?

JS SDK now supports process_credentials now. Please check out my demo here:

https://github.com/pahud/gitpod-workspace/issues/1#issue-726527096

However, AWS CDK does not support it. Can we add support for it given JS SDK supports it now?

@shivlaks @rix0rrr Is there anything I can help to make this work? AWS SSO is marketed as the way to configure your users in a multi-account setup but CDK is then not usable.

鈿狅笍COMMENT VISIBILITY WARNING鈿狅笍

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Was this page helpful?
0 / 5 - 0 ratings