Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(docdb): cannot delete a stack with DatabaseCluster removal_policy set to 'Retain' #29059

Closed

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{
"Resources": {
"DatabaseSubnets56F17B9A": {
"Type": "AWS::DocDB::DBSubnetGroup",
"Properties": {
"DBSubnetGroupDescription": "Subnets for Database database",
"SubnetIds": [
{
"Ref": "VPCPrivateSubnet1Subnet8BCA10E0"
},
{
"Ref": "VPCPrivateSubnet2SubnetCFCDAA7A"
}
]
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"DatabaseSecurityGroup5C91FDCB": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "DocumentDB security group",
"SecurityGroupEgress": [
{
"CidrIp": "0.0.0.0/0",
"Description": "Allow all outbound traffic by default",
"IpProtocol": "-1"
}
],
"VpcId": {
"Ref": "VPCB9E5F0B4"
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"DatabaseSecret3B817195": {
"Type": "AWS::SecretsManager::Secret",
"Properties": {
"Description": {
"Fn::Join": [
"",
[
"Generated by the CDK for stack: ",
{
"Ref": "AWS::StackName"
}
]
]
},
"GenerateSecretString": {
"ExcludeCharacters": "\"@/",
"GenerateStringKey": "password",
"PasswordLength": 41,
"SecretStringTemplate": "{\"username\":\"clusteradmin\"}"
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"DatabaseSecretAttachmentE5D1B020": {
"Type": "AWS::SecretsManager::SecretTargetAttachment",
"Properties": {
"SecretId": {
"Ref": "DatabaseSecret3B817195"
},
"TargetId": {
"Ref": "DatabaseB269D8BB"
},
"TargetType": "AWS::DocDB::DBCluster"
}
},
"DatabaseB269D8BB": {
"Type": "AWS::DocDB::DBCluster",
"Properties": {
"DBSubnetGroupName": {
"Ref": "DatabaseSubnets56F17B9A"
},
"MasterUserPassword": {
"Fn::Join": [
"",
[
"{{resolve:secretsmanager:",
{
"Ref": "DatabaseSecret3B817195"
},
":SecretString:password::}}"
]
]
},
"MasterUsername": {
"Fn::Join": [
"",
[
"{{resolve:secretsmanager:",
{
"Ref": "DatabaseSecret3B817195"
},
":SecretString:username::}}"
]
]
},
"StorageEncrypted": true,
"VpcSecurityGroupIds": [
{
"Fn::GetAtt": [
"DatabaseSecurityGroup5C91FDCB",
"GroupId"
]
}
]
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"DatabaseInstance1844F58FD": {
"Type": "AWS::DocDB::DBInstance",
"Properties": {
"DBClusterIdentifier": {
"Ref": "DatabaseB269D8BB"
},
"DBInstanceClass": "db.t3.medium"
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading