1 Answer
- Newest
- Most votes
- Most comments
0
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 VPC
, !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"
answered 2 years ago
Relevant content
- Accepted Answerasked 3 years ago
- asked 3 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 3 months ago
Resolved! It was problem with IAM role. I didn't have enough permission.