Open pahud opened 1 year ago
Hi @thebillest
It seems this only happens when Annotations.fromStack()
on a ProductStack. Is it correct?
Do you have any possible solution or proposed changes?
According to the ProductStack documentation:
This stack will not be treated as an independent deployment artifact (won't be listed in "cdk list" or deployable through "cdk deploy"), but rather only synthesized as a template and uploaded as an asset to S3
When I go to the aws-cdk-lib/assertions, look at the Annotations class, and work down to the toMessages method (which is what fromStack calls), it appears that it expects to synth and grab artifactIds. These won't work for ProductStack
objects.
ProductStack works a bit differently from regular stacks:
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.ProductStack.html
This stack will not be treated as an independent deployment artifact (won't be listed in "cdk list" or deployable through "cdk deploy"), but rather only synthesized as a template and uploaded as an asset to S3.
Essentially it just generates a CFN template when you synthesize it. I suggest calling a synth, generating the template which should appear in cdk.out, then running testing against that template.
While the alternative process of synthesizing a ProductStack
and performing testing on that works, does it make sense to integrate fromProductStack()
on Annotations or to expand the fromStack()
method to handle a ProductStack
object?
As it currently stands, it's not trivial to render annotations for any ProductStack
object.
Reopening this issue for https://github.com/aws/aws-cdk/issues/24988 from thebillest
Discussed in https://github.com/aws/aws-cdk/discussions/24989