Problem
Constructs such as AutoScalingGroup can create Cloud-Init data sources internally, but an AwsStack does not register a CloudinitProvider when those resources are needed. A consumer can therefore build an otherwise complete stack and encounter this only at synthesis:
Found resources without a matching provider construct. Please make sure to add provider constructs [...] for the following providers: cloudinit
This is inconsistent with the stack-managed singleton behavior consumers see for other supporting providers, and the required manual provider registration is not obvious from the L2 API.
Discovered while validating the PR-head package from #134 in an external example project. This is not a blocker for that PR.
Reproduction
- Create an
aws.AwsStack.
- Add a VPC and
aws.compute.autoscaling.AutoScalingGroup using the normal L2 API.
- Do not manually instantiate
@cdktn/provider-cloudinit's CloudinitProvider.
- Run
app.synth().
Synthesis fails with the missing-provider validation above. Adding this manually makes the same stack synthesize successfully:
new CloudinitProvider(stack, "CloudInit");
Expected developer experience
When a TerraConstructs L2 internally introduces resources from a supporting provider, the stack should register or expose a consistent singleton for that provider, rather than requiring consumers to discover the dependency from a synthesis error.
Possible direction
Add stack-managed singleton handling for CloudinitProvider, following the existing supporting-provider patterns where appropriate, and add a synthesis test proving an ASG that needs Cloud-Init does not require manual provider setup.
Problem
Constructs such as
AutoScalingGroupcan create Cloud-Init data sources internally, but anAwsStackdoes not register aCloudinitProviderwhen those resources are needed. A consumer can therefore build an otherwise complete stack and encounter this only at synthesis:This is inconsistent with the stack-managed singleton behavior consumers see for other supporting providers, and the required manual provider registration is not obvious from the L2 API.
Discovered while validating the PR-head package from #134 in an external example project. This is not a blocker for that PR.
Reproduction
aws.AwsStack.aws.compute.autoscaling.AutoScalingGroupusing the normal L2 API.@cdktn/provider-cloudinit'sCloudinitProvider.app.synth().Synthesis fails with the missing-provider validation above. Adding this manually makes the same stack synthesize successfully:
Expected developer experience
When a TerraConstructs L2 internally introduces resources from a supporting provider, the stack should register or expose a consistent singleton for that provider, rather than requiring consumers to discover the dependency from a synthesis error.
Possible direction
Add stack-managed singleton handling for
CloudinitProvider, following the existing supporting-provider patterns where appropriate, and add a synthesis test proving an ASG that needs Cloud-Init does not require manual provider setup.