Skip to content
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

SSO profile from aws sso config – Unable to parse environment specification "aws:///eu-central-1". Expected #28493

Closed
florianbepunkt opened this issue Dec 26, 2023 · 2 comments
Labels
@aws-cdk/aws-sso Related to the @aws-cdk/aws-sso package bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@florianbepunkt
Copy link

florianbepunkt commented Dec 26, 2023

Describe the bug

We have a fresh Control Tower landing zone that also setup SSO. An SSO profile named test-profile was configured via aws configure sso.

When trying to bootstrap the account with AWS_PROFILE=test-profile cdk bootstrap the operation fails: Error: Unable to parse environment specification "aws:///eu-central-1". Expected format: aws://account/region. The account seems to be empty. But other aws cli operations work as expected and the use has sufficient privileges.

EDIT: For clarification aws --profile test-profile sts get-caller-identity worked

Expected Behavior

CDK to properly use the SSO profile from aws configure sso

Current Behavior

Error: Unable to parse environment specification "aws:///eu-central-1". Expected format: aws://account/region

Reproduction Steps

  1. Setup a new landing zone, following the AWS docs for Control Tower
  2. Create SSO profile by using aws aws configure sso
  3. CDK bootstrap new account.

Possible Solution

No response

Additional Information/Context

Content of my .aws/config file:

[profile test-profile]
sso_start_url=https://REDACTED.awsapps.com/start
sso_region = eu-central-1
sso_account_id = REDACTED
sso_role_name = AWSAdministratorAccess
region = eu-central-1

CDK CLI Version

2.116.1 (build 222de71)

Framework Version

No response

Node.js Version

v18.12.1

OS

Mac OS

Language

TypeScript

Language Version

5.3

Other information

No response

@florianbepunkt florianbepunkt added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 26, 2023
@github-actions github-actions bot added the @aws-cdk/aws-sso Related to the @aws-cdk/aws-sso package label Dec 26, 2023
@florianbepunkt
Copy link
Author

Okay, in my case the problem was that CDK was going through all defined stacks – one of the stacks had no account specified.

Copy link

⚠️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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-sso Related to the @aws-cdk/aws-sso package bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant