Skip to content

Conversation

bombguy
Copy link
Contributor

@bombguy bombguy commented Oct 9, 2023

Description of changes

Custom resource should populate with region and account from CDK default variables.

https://docs.aws.amazon.com/cdk/v2/guide/environments.html

Issue #, if available

#12575

Description of how you validated changes

Manual testing, unit test & e2e tests added

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bombguy bombguy requested a review from a team as a code owner October 9, 2023 15:02
Comment on lines +148 to +151
// should pickup to default cdk env vars and build cfn stack.
process.env.CDK_DEFAULT_ACCOUNT = 'some_id';
process.env.CDK_DEFAULT_REGION = process.env.CLI_REGION;
await amplifyPushAuth(projRoot);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lacks assertion.
we have developed the following mechanism in override tests to assert that injected values actually work

if (amplifyProjectInfo.envName != '##EXPECTED_ENV_NAME') {
throw new Error(`Unexpected envName: ${amplifyProjectInfo.envName}`);
}
if (amplifyProjectInfo.projectName != '##EXPECTED_PROJECT_NAME') {
throw new Error(`Unexpected envName: ${amplifyProjectInfo.envName}`);
}

Can we please use similar pattern in barebone-cdk-stack.ts ?

@joeykay9
Copy link

joeykay9 commented Jun 26, 2025

What's happening with this PR? @bombguy @sobolk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants