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

SSM Parameter lookup gives "Not making progress trying to resolve environmental context. Giving up." error #30078

Open
AvivSamet-Silk opened this issue May 6, 2024 · 3 comments
Assignees
Labels
@aws-cdk/aws-ssm Related to AWS Systems Manager bug This issue is a bug. guidance Question that needs advice or information. p2

Comments

@AvivSamet-Silk
Copy link

Describe the bug

When running npx cdk synth I get the following error:
image

(This stacktrace is produced in verbose mode, in regular mode you get a less descriptive error).

Following the stacktrace, it looks like this happens when I try to look up an SSM string parameter.

Expected Behavior

This CDK produces a valid cloudformation template that is being deployed by my github actions. For some reason this just isn't working on my local machine.

Current Behavior

image

Reproduction Steps

This is the code that produces the issue, however I wasn't able to reproduce it outside of my local machine (it works fine on GHA and my coworker's machine):

 vpc: ec2.IVpc;

  constructor(scope: Construct) {
    const vpcIdParameter = ssm.StringParameter.valueFromLookup(
      scope,
      "vpc/parameter/path"
    );

    const vpc = ec2.Vpc.fromLookup(
      scope,
      "SilkVpc",
      { vpcId: vpcIdParameter }
    );

    this.vpc = vpc;
  }

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.9.0

Framework Version

No response

Node.js Version

20.3.1

OS

macOS 14.4.1

Language

TypeScript

Language Version

No response

Other information

No response

@AvivSamet-Silk AvivSamet-Silk added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 6, 2024
@github-actions github-actions bot added the @aws-cdk/aws-ssm Related to AWS Systems Manager label May 6, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels May 6, 2024
@khushail khushail self-assigned this May 6, 2024
@khushail
Copy link
Contributor

khushail commented May 6, 2024

Hi @AvivSamet-Silk , thanks for reaching out.

From the error it looks like, the user profile calling the api is not configured on your local machine. You can run this - aws sts get-caller-identity in console to see which user profile is configured.

You could create a user in AWS Console and then generate access and security key and configure the credentials in ~/.aws/config file with this new user . Run cdk bootstrap and run cdk deploy --profile <user-profile>. it should work fine. Here is a doc for reference on how to configure aws cli.

Also when running the code, you could also mention environment parameters like this -

env: { account: '123456789012', region: 'us-east-1' },

Please feel free to reach out if that does not solve the issue.

@khushail khushail added p2 guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels May 6, 2024
@AvivSamet-Silk
Copy link
Author

I am using aws sso login to get my local credentials. Running aws sts get-caller-identity returns a role with SystemAdministrator privileges. Running cdk bootstrap --verbose Also results in the following error:
image

@AvivSamet-Silk
Copy link
Author

AvivSamet-Silk commented May 6, 2024

This works if I export AWS creds locally, but having creds in ~/.aws/config or ~/.aws/credentials does not work

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ssm Related to AWS Systems Manager bug This issue is a bug. guidance Question that needs advice or information. p2
Projects
None yet
Development

No branches or pull requests

2 participants