You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resulting SAM template has every single child resource of the DatabaseCluster instance in the dependsOn array of the provider resources. Because the DatabaseCluster 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 any DatabaseProxy instances created with cluster.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 the cdk-rds-sql provider to create roles which are then passed to the proxy via the secrets prop. But this leads to a circular dependency because the provider will depend on the proxy. Furthermore, I'm working on an L3 DatabaseCluster 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?
The text was updated successfully, but these errors were encountered:
timothymathison
changed the title
Provider Depends on Is Too Broad
Provider Depends On Is Too Broad
Aug 12, 2024
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.cdk-rds-sql/src/provider.ts
Line 105 in aa111d2
The 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?The text was updated successfully, but these errors were encountered: