aws-cloudformation / cloudformation-cli

The CloudFormation Provider Development Toolkit allows you to author your own resource providers and modules that can be used by CloudFormation.
Apache License 2.0
316 stars 157 forks source link

Add logging for canary auto generation and refactor canarySettings #1078

Open marc-1010 opened 1 week ago

marc-1010 commented 1 week ago

Issue #, if available:

Description of changes:

#positive case at Debug Log Level

% cfn generate -v -v -v
Logging set up successfully
...
Starting Canary Auto-Generation...
Writing: /[ROOT]/testcfncli/canary-bundle/bootstrap.yaml
Loading contract test input file: /[ROOT]/testcfncli/contract-tests-artifacts/inputs_1.json
Writing Canary Stack Template File: /[ROOT]/testcfncli/canary-bundle/canary/canary1_001.yaml
Writing Canary Stack Template File: /[ROOT]/testcfncli/canary-bundle/canary/canary1_002.yaml
Loading contract test input file: /[ROOT]/testcfncli/contract-tests-artifacts/inputs_2.json
Writing Canary Stack Template File: /[ROOT]/testcfncli/canary-bundle/canary/canary2_001.yaml
Writing Canary Stack Template File: /[ROOT]/testcfncli/canary-bundle/canary/canary2_002.yaml
Loading contract test input file: /[ROOT]/testcfncli/contract-tests-artifacts/inputs_3.json
Writing Canary Stack Template File: /[ROOT]/testcfncli/canary-bundle/canary/canary3_001.yaml
Writing Canary Stack Template File: /[ROOT]/testcfncli/canary-bundle/canary/canary3_002.yaml
Finished Canary Auto-Generation
Generated files for TestOrg::TestService::TestResource
Finished generate

# canarySettings not in .rpdk-config

% cfn generate -vv
Logging set up successfully
...
Skipping Canary Auto-Generation
Generated files for TestOrg::TestService::TestResource
Finished generate

#canarySettings:{} with DEBUG Log Level

Logging set up successfully
Writing docs README: [ROOT]/testcfncli/docs/README.md
Starting Canary Auto-Generation...
canarySettings are provided but empty. Generation is enabled with default settings.
Writing: [ROOT]/testcfncli/canary-bundle/bootstrap.yaml
Loading contract test input file: [ROOT]/testcfncli/contract-tests-artifacts/inputs_1.json
Writing Canary Stack Template File: [ROOT]/testcfncli/canary-bundle/canary/canary1_001.yaml
Writing Canary Stack Template File: [ROOT]/testcfncli/canary-bundle/canary/canary1_002.yaml
Finished Canary Auto-Generation
Generated files for TestOrg::TestService::TestResource
Finished generate

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