Skip to content

AWS SSO Named Profiles Support #5455

@vikyol

Description

@vikyol

AWS CLI v2 supports AWS SSO named profiles.

However, CDK CLI cannot resolve SSO named profiles yet.

$ cdk deploy --profile sso-named-profile

Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment

Without this feature, users have to login to SSO user portal and fetch credentials for command line and CLI access, which needs to be repeated every time the credentials expire.

Even though CLI v2 is still in preview, it would be good to have this feature implemented for early adopters.

Use Case

  • Simplify deployments to multiple-accounts for AWS SSO users.

Proposed Solution

  • Read sso_start_url, sso_role_name and sso_account_id from ~/.aws/config file.
  • Fetch the accessToken in ~/.aws/sso/cache/ matching sso_start_url.
  • Fetch temporary credentials from STS using SSO.get-role-credentials() with accessToken, sso_account_id and sso_role_name parameters.

This is a 🚀 Feature Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/largeLarge work item – several weeks of effortfeature-requestA feature should be added or improved.p1package/toolsRelated to AWS CDK Tools or CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions