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

aws-cdk: SSM parameter not available in account #28208

Closed
andreprawira opened this issue Nov 30, 2023 · 2 comments
Closed

aws-cdk: SSM parameter not available in account #28208

andreprawira opened this issue Nov 30, 2023 · 2 comments
Labels
@aws-cdk/aws-ssm Related to AWS Systems Manager bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@andreprawira
Copy link

andreprawira commented Nov 30, 2023

Describe the bug

i have a code that reads a value from SSM parameter which is going to be built in codebuild project. For the first time ever run, the value will not exist yet, so i wrote a logic that will catch the error and it is supposed to continue, but even with the logic, i'm still getting SSM parameter not available in account error

``
let apiEndpoint: string;

    try {
      apiEndpoint = ssm.StringParameter.valueFromLookup(this, `api-endpoint`)
    } catch (error: any) {
      if (error.message.includes('ParameterNotFound')) {
        // Handle the case where the parameter doesn't exist yet
        console.warn('SSM parameter "api-endpoint" not found. Using default value.');
        apiEndpoint = 'default-value';
      } else {
        // Handle other errors
        throw error;
      }
    }

``

Expected Behavior

SSM parameter not available in account error should not stop the codebuild project

Current Behavior

SSM parameter not available in account 1234, region us-east-1: /api-endpoint error stops the codebuild project

Reproduction Steps

view description

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.108.1 (build 2320255)

Framework Version

No response

Node.js Version

v18.18.0

OS

Windows

Language

TypeScript

Language Version

No response

Other information

No response

@andreprawira andreprawira added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 30, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ssm Related to AWS Systems Manager label Nov 30, 2023
@khushail khushail self-assigned this Nov 30, 2023
@khushail
Copy link
Contributor

Hi @andreprawira , looks like you are using old version. Could you please try this on latest version and let us know if the issue persists.

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 30, 2023
@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Nov 30, 2023
@khushail khushail added the effort/small Small work item – less than a day of effort label Nov 30, 2023
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-ssm Related to AWS Systems Manager bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants