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.

Yurii
已提問 2 年前檢視次數 426 次
1 個回答
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"
            
AWS
awsendo
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南