Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bug/docs: CDK-Pipeline children cannot be suppressed without first running buildPipeline() #925

Closed
a-bigelow opened this issue Jun 28, 2022 · 2 comments · Fixed by #928
Closed
Labels
documentation Improvements or additions to documentation

Comments

@a-bigelow
Copy link
Contributor

What is the problem?

NOTE: This could easily be considered a documentation problem, but for the sake of thoroughness I'm filing it as a bug.

When attempting to suppress elements of a CDK Pipeline, specifically one from the aws-cdk-lib/pipelines package, an error is thrown unless .buildPipeline() is called before the suppressions are applied.

Reproduction Steps

Clone this example repo and attempt to yarn cdk synth.

You should receive this error:

Error: Suppression path "/example-cdk-pipeline/DummyPipeline/Pipeline/ArtifactsBucket/Resource" did not match any resource. This can occur when a resource does not exist or if a suppression is applied before a resource is created.

The fix is simple: uncomment the dummyPipeline.buildPipeline() call in src/Pipeline/DummyPipeline.ts. After this, it will suppress as intended.

What did you expect to happen?

I was expecting the suppressions to be applied as expected.

What actually happened?

This error is thrown:

Error: Suppression path "/example-cdk-pipeline/DummyPipeline/Pipeline/ArtifactsBucket/Resource" did not match any resource. This can occur when a resource does not exist or if a suppression is applied before a resource is created.

cdk-nag version

2.14.46

Language

Typescript

Other information

I don't necessarily think it's on Cdk-Nag to fix this "issue", but adding a more helpful annotation and/or section to the readme on what exactly is meant by the below text snippet would be very helpful.

This can occur when a resource does not exist or if a suppression is applied before a resource is created.

I was stuck on this for a little bit until someone else who happened to know about .buildPipeline() came along and pointed out the issue.

@a-bigelow a-bigelow added bug Something isn't working needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2022
@dontirun
Copy link
Collaborator

For context, this is related to aws/aws-cdk#18440.

Happy to take a PR for improving the documentation!

@dontirun dontirun added documentation Improvements or additions to documentation and removed bug Something isn't working needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2022
@a-bigelow
Copy link
Contributor Author

@dontirun I'll try and take stab this week!

@mergify mergify bot closed this as completed in #928 Jul 8, 2022
mergify bot pushed a commit that referenced this issue Jul 8, 2022
#928)

Fixes #925 

Per the discussion in #925 , adding a section to the README regarding the suppression of cdk-pipeline constructs.

Let me know if any clarification or reformatting is required.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants