After some quick checks using the CloudFormation validation function and my own spot checks, there were several hyphens ("-") that needed to be removed. Additionally, I'm running on the assumptions that
!Ref PrivateSubnetIds, and so forth are filled in with your account-specific IDs.
I've included my revised version of your code block below, and I was able to successfully create the stack in my own AWS account.
AWSTemplateFormatVersion: 2010-09-09 Resources: DocumentDBSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupName: 'DocumentDB SG' GroupDescription: !Sub 'Security Group for the DocumentDb' VpcId: !Ref VPC DocumentDBSubnetGroup: Type: AWS::DocDB::DBSubnetGroup Properties: DBSubnetGroupDescription: "Subnet group for Document DB cluster" DBSubnetGroupName: "document-db-subnet-group" SubnetIds: !Ref PrivateSubnetIds DocumentDBParameterGroup: Type: AWS::DocDB::DBClusterParameterGroup Properties: Description: "Parameter group for Document DB cluster" Family: docdb4.0 Name: "document-db-paramater-group" Parameters: audit_logs: "disabled" DocumentDBCluster: Type: AWS::DocDB::DBCluster Properties: BackupRetentionPeriod: 7 DBClusterIdentifier: "docdb" DBSubnetGroupName: !Ref DocumentDBSubnetGroup DBClusterParameterGroupName: !Ref DocumentDBParameterGroup Port: 27017 PreferredBackupWindow: "07:00-09:30" PreferredMaintenanceWindow: "tue:07:00-tue:11:00" VpcSecurityGroupIds: !Ref DocumentDBSecurityGroup StorageEncrypted: true DocumentDBInstance: Type: AWS::DocDB::DBInstance DependsOn: DocumentDBCluster Properties: DBClusterIdentifier: !Ref DocumentDBCluster DBInstanceClass: db.t3.medium DBInstanceIdentifier: "docdb" PreferredMaintenanceWindow: "tue:07:00-tue:11:00"
Cloudformation Bug when creating VPCE and GWLB Instance Targetsasked 10 months ago
Failed to stabilize Instance with idasked 2 months ago
Failed to deploy application. Unsuccessful command execution on instance id(s)asked 24 days ago
Instance Status Checks always failed.asked 2 years ago
Failed to start the instance i-0ba6839e114ac134e Insufficient capacity.Accepted Answerasked 2 months ago
Why does my EKS cluster fails init on "Nodegroup... failed to stabilize"?asked 3 years ago
MSK instance size using CDKAccepted Answerasked 7 months ago
X-Ray in ECS: "Get instance id metadata failed"asked 4 years ago
"no route to host" instance id i-0a0d3444fd0a171feasked 2 years ago
Case ID 6135575121 Retry payment for reserved instanceasked 4 years ago