Skip to content

Conversation

@PoeppingT
Copy link
Contributor

With the addition of the multicontainer feature and the usage of the CloudFormation macro to control updates according to Application Services, the ability to install multiple environments in a single account (typically for testing purposes) was broken.

This commit fixes that bug by adding a Parameter to the base stack that will only create those CloudFormation macro resources if they do not already exist.


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

@PoeppingT PoeppingT requested a review from brtrvn August 24, 2022 22:42
PoeppingT added 5 commits August 26, 2022 15:10
This commit changes the default functionality from creating the macro
resources to not. This allows the onboarding service to update the base
stack without redoing the same logic for knowing whether the macro
resources should be created.
Copy link
Contributor

@brtrvn brtrvn left a comment

Choose a reason for hiding this comment

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

We had discussed using the IAM role/policy as the lookup key to "know" whether the macro (and its lambda, log group, etc) had been installed in the current AWS Region. Pros/cons now that we know macros are regional?

}

private boolean doesCfnMacroResourceExist() {
// this assumes that the macro resource exists in CloudFormation IFF all requisite resources also exist,
Copy link
Contributor

Choose a reason for hiding this comment

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

s/IFF/IF/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IFF here meaning "if and only if".


private boolean doesCfnMacroResourceExist() {
// this assumes that the macro resource exists in CloudFormation IFF all requisite resources also exist,
// e.g. the macro Lambda function, execution role, and log group. this should always be true, since the
Copy link
Contributor

Choose a reason for hiding this comment

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

i.e. (in other words) not e.g. (for example)

@PoeppingT
Copy link
Contributor Author

We had discussed using the IAM role/policy as the lookup key to "know" whether the macro (and its lambda, log group, etc) had been installed in the current AWS Region. Pros/cons now that we know macros are regional?

Instead now we're just creating a "regional" IAM policy by Parameterizing the name. The assumption described in doesCfnMacroResourceExist still applies then and simplifies the work needed to be done in the installer.

Copy link
Contributor

@brtrvn brtrvn left a comment

Choose a reason for hiding this comment

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

Thanks for clarifying the comments. Looking good.

@brtrvn brtrvn merged commit de33cfd into awslabs:main Aug 29, 2022
@PoeppingT PoeppingT deleted the multi-environment-fix branch August 29, 2022 23:00
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