-
Notifications
You must be signed in to change notification settings - Fork 246
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
fix(utils): address issues in printing override warnings #1113
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@@ -456,6 +456,7 @@ test("Custom resource is provisioned if encryption key is provided as bucketProp | |||
} | |||
}); | |||
const template = Template.fromStack(stack); | |||
defaults.printWarning(`******************${JSON.stringify(template)}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intended to leave this line?
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
@@ -35,19 +35,38 @@ import { Construct } from 'constructs'; | |||
import { Stack, StackProps } from 'aws-cdk-lib'; | |||
import { ConstructsFactories } from '@aws-solutions-constructs/aws-constructs-factories'; | |||
|
|||
const factories = new ConstructsFactories(this, 'integ-test'); | |||
const factories = new ConstructsFactories(this, MyFactories'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Missing an open apostrophe before MyFactories
edit: typo
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue 1 - Spurious overwrite warnings come up when synth’ing a stack using aws-openapigateway-lambda.
Cause – we use buildLambdaFunction() in the TemplateWriter custom resource. We fully specify the props, including the role. When overrideProps is called – this generates warnings (that have nothing to do with the client’s infrastructure or props)
Changes:
Issue 2 – deepdiff() dies. This is for 2 reasons.
Reason 1 – some properties do not have scalar values, such as maxRecordAge, which has a cdk.Duration.minutes(5) value. This causes deepdiff() to die. We have a prefilter list of values to ignore so this doesn’t happen, but if the customer does overwrite one of those values they won’t be informed.
Change– when we skip a value because it is in the prefilter list we print a warning that we cannot report on that value (is completely open with client, but will lead to noise)
Reason 2 – circular references in the props cause an infinite loop that exhausts memory requirements
Change – constructs in the props object seem to be the primary cause of this – let’s add ‘node’ to the prefilter list so deepdiff doesn’t dive into a CDK construct in props. We can print out a different warning for ‘node’ than for other prefilter list values