Skip to content

(docdb): Not all properties of Interface DatabaseClusterAttributes should be required #14492

@bpinhosilva

Description

@bpinhosilva

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-docdbRelated to Amazon DocumentDBeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions