Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docdb: Cannot delete the subnet group because at least one database cluster #29122

Closed
rantoniuk opened this issue Feb 15, 2024 · 3 comments
Closed
Assignees
Labels
@aws-cdk/aws-docdb Related to Amazon DocumentDB bug This issue is a bug. p2

Comments

@rantoniuk
Copy link

Describe the bug

Stack deployed from:

export class MongoDbStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props: MongoStackProps) {
    super(scope, id, props);

    new docdb.DatabaseCluster(this, 'MongoCluster', {
      dbClusterName: 'MongoCluster',
      masterUser: {
        username: `${props.envv.db.mongo.dbUserName}`,
        excludeCharacters: "\"@/:!^;,~%+&()?<>*[]{}_-.#?'`\\|",
      },
      instanceType: ec2.InstanceType.of(props.envv.db.mongo.instance, props.envv.db.mongo.instanceSize),
      // instances: 1,
      vpc: props.vpc,
      securityGroup: props.dbSecurityGroup,
      storageEncrypted: true,
      deletionProtection: true,
      removalPolicy: cdk.RemovalPolicy.RETAIN,
      vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED },
    });

  }
}

Now, there are two bugs here:

  • instances are supposed to be by default == 1 , but when instances: 1 is commented out, the cluster is created without any instances
  • when I try to destroy the stack, I get:
6:47:47 PM | DELETE_FAILED        | AWS::DocDB::DBSubnetGroup                   | MongoClusterSubnets57E68960
Got InvalidDBInstanceStateException with error: Cannot delete the subnet group 'mongoclustersubnets57e68960-jxuv00nfliql' because at least one database cluster: mongocluster is still using
it.

Expected Behavior

as above.

Current Behavior

as above.

Reproduction Steps

As above.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.128.0 (build d995261)

Framework Version

No response

Node.js Version

v18.18.2

OS

MacOS

Language

TypeScript

Language Version

No response

Other information

No response

@rantoniuk rantoniuk added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 15, 2024
@github-actions github-actions bot added the @aws-cdk/aws-docdb Related to Amazon DocumentDB label Feb 15, 2024
@tim-finnigan tim-finnigan self-assigned this Feb 15, 2024
@tim-finnigan
Copy link

It looks like the second issue is a duplicate of a one opened last week: #29054. There is already a PR up to fix it: #29059. Regarding the first issue - it looks like the logic here doesn't allow for deploying less than one instance.

@tim-finnigan tim-finnigan added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 15, 2024
@rantoniuk
Copy link
Author

Well, maybe the logic doesn't allow, but Cloudformation apparently does. My AWS Console shows 0/0 instances in that cluster ;-)

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 16, 2024
@rantoniuk rantoniuk closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2024
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-docdb Related to Amazon DocumentDB bug This issue is a bug. p2
Projects
None yet
Development

No branches or pull requests

2 participants