Open timothymathison opened 3 months ago
Haven't tried it, but dependencies are superhard :-(
We only connect to the writer, but we also need the root secret. So I think if you have both as dependencies you probably are good. Happy to have a PR for this, although it needs some good testing.
Haven't tried it, but dependencies are superhard :-(
We only connect to the writer, but we also need the root secret. So I think if you have both as dependencies you probably are good. Happy to have a PR for this, although it needs some good testing.
I think the cluster/writer resources already depend on the secret. So I think its just the writer that we need to directly depend on for the provider. Yeah, full disclosure I'm still trying to figure out the best way to reference the writer dependency since its not directly exposed.
There is a call to
addDependency(props.cluster)
which I think is too broad. https://github.com/berenddeboer/cdk-rds-sql/blob/aa111d209931165b4457934a68c226bef0cc93c3/src/provider.ts#L105The resulting SAM template has every single child resource of the
DatabaseCluster
instance in thedependsOn
array of the provider resources. Because theDatabaseCluster
construct I'm using is a L2/L3 construct, there are quite a few child resources which aren't required for the Provider to work. In particular anyDatabaseProxy
instances created withcluster.addProxy()
are now in the dependency array of the provider resources even though they don't interact with the proxy. This is a problem because I actually want to use thecdk-rds-sql
provider to create roles which are then passed to the proxy via thesecrets
prop. But this leads to a circular dependency because the provider will depend on the proxy. Furthermore, I'm working on an L3DatabaseCluster
construct which has the provider built into it - making it a child resource - which leads to the provider resources depending on themselves.Does the provider actually need to depend on anything besides the
CfnDBCluster
and writer instance resources?