awslabs / aws-solutions-constructs

The AWS Solutions Constructs Library is an open-source extension of the AWS Cloud Development Kit (AWS CDK) that provides multi-service, well-architected patterns for quickly defining solutions
https://docs.aws.amazon.com/solutions/latest/constructs/
Apache License 2.0
1.19k stars 240 forks source link

fix(utils): address issues in printing override warnings #1113

Closed biffgaut closed 2 months ago

biffgaut commented 2 months ago

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

aws-solutions-constructs-team commented 2 months ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

aws-solutions-constructs-team commented 2 months ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

aws-solutions-constructs-team commented 2 months ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

aws-solutions-constructs-team commented 2 months ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

aws-solutions-constructs-team commented 2 months ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

aws-solutions-constructs-team commented 2 months ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository