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

Use CFN input for VPC id and Stage #1122

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

lewijacn
Copy link
Collaborator

@lewijacn lewijacn commented Nov 6, 2024

Description

Make this input available on the bootstrap instance, and fill in appropriate CDK context if available

Issues Resolved

https://opensearch.atlassian.net/browse/MIGRATIONS-2205

Is this a backport? If so, please add backport PR # and/or commits #

Testing

Manual deployments for both paths to CFN

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.54%. Comparing base (c189ced) to head (5e2f69f).
Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1122      +/-   ##
============================================
+ Coverage     80.51%   80.54%   +0.03%     
- Complexity     2871     2907      +36     
============================================
  Files           393      393              
  Lines         14554    14630      +76     
  Branches       1000     1007       +7     
============================================
+ Hits          11718    11784      +66     
- Misses         2229     2233       +4     
- Partials        607      613       +6     
Flag Coverage Δ
gradle-test 78.65% <ø> (+0.05%) ⬆️
python-test 90.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

Nice! This is much cleaner than what I was thinking of good work.

@@ -188,6 +182,13 @@ export class SolutionsInfrastructureStack extends Stack {
vpc = importVPC(this, vpcIdParameter, availabilityZonesParameter, privateSubnetIdsParameter);
}

const cfnInitConfig: InitElement[] = [
InitCommand.shellCommand(`echo "export MIGRATIONS_APP_REGISTRY_ARN=${appRegistryAppARN}; export MIGRATIONS_USER_AGENT=${solutionsUserAgent}; export VPC_ID=${vpc.vpcId}; export STAGE=${stageParameter.valueAsString}" > /etc/profile.d/solutionsEnv.sh`),
Copy link
Member

Choose a reason for hiding this comment

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

Nit: create a function to generate these environment variables exports

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

Signed-off-by: Tanner Lewis <[email protected]>
@lewijacn lewijacn merged commit bcd38c6 into opensearch-project:main Nov 7, 2024
15 checks passed
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.

2 participants