DatabaseCluster.fromDatabaseClusterAttributes(scope, id, attrs) expects too many mandatory attributes (attrs - DatabaseClusterAttributes) to simply import a DocumentDB Cluster, which makes method's usage not friendly as it should be.
What did you expect to happen?
Only necessary properties of DatabaseClusterAttributes should be mandatory for fromDatabaseClusterAttributes() usage, for example: clusterIdentifier.
What actually happened?
There is no simple way to create a reference of DocumentDB inside CDK App using DatabaseCluster.fromDatabaseClusterAttributes() unless all properties are passed, which makes it cumbersome and not practical. Besides, the interface accepts securityGroup but the L1 construct CfnDBCluster accepts an array - of vpcSecurityGroupIds.
A similar issue was reported and fixed for rds (see reference below). Perhaps, the same fix could fit docdb lib as well.
Environment
- CDK CLI Version : 1.100.0
- Framework Version: 1.100.0
- Node.js Version: v.14.16.1
- OS : win 10 (64 bits)
- Language (Version): TypeScript (3.8.3)
Other
Related issue: #3587
This is 🐛 Bug Report
DatabaseCluster.fromDatabaseClusterAttributes(scope, id, attrs)expects too many mandatory attributes (attrs - DatabaseClusterAttributes) to simply import a DocumentDB Cluster, which makes method's usage not friendly as it should be.What did you expect to happen?
Only necessary properties of DatabaseClusterAttributes should be mandatory for
fromDatabaseClusterAttributes()usage, for example: clusterIdentifier.What actually happened?
There is no simple way to create a reference of DocumentDB inside CDK App using
DatabaseCluster.fromDatabaseClusterAttributes()unless all properties are passed, which makes it cumbersome and not practical. Besides, the interface acceptssecurityGroupbut the L1 construct CfnDBCluster accepts an array - of vpcSecurityGroupIds.A similar issue was reported and fixed for rds (see reference below). Perhaps, the same fix could fit docdb lib as well.
Environment
Other
Related issue: #3587
This is 🐛 Bug Report