Failed to stabilize Instance with id

0

I have this problem: Failed to stabilize Instance with id. My CF looks like: 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"

If i search this problem i find information about RDS (snapshot), but i don't use snapshot in this deployment..

  • Resolved! It was problem with IAM role. I didn't have enough permission.

1 Answer
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"
            
awsendo
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions