DeletionPolicy: snapshot cannot be specified for the cluster instance, use the delete policy on the cluster instead

I am trying to create an RDS cluster and an aurora instance using the cloud information template below:

{ "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "example setup", "Parameters" : { "DBInstanceIdentifier" : { "Type": "String", "Description": "Name for the DB instance." }, "DBUser" : { "Type": "String", "Description": "Master user" }, "DBPassword" : { "Type": "String", "Description": "Pass" }, "DBModel" : { "Type": "String", "Description": "Instance model to be used for the DB." } }, "Resources": { "RDSCluster": { "Type": "AWS::RDS::DBCluster", "Properties": { "MasterUsername": { "Ref" : "DBUser" }, "MasterUserPassword": { "Ref" : "DBPassword" }, "Engine": "aurora", "DBClusterParameterGroupName": "default.aurora5.6", "VpcSecurityGroupIds": [{"Fn::GetAtt" : [ "DBFromSiteSecurityGroup" , "GroupId" ]}] } }, "AuroraInstance": { "Type": "AWS::RDS::DBInstance", "Properties": { "DBInstanceIdentifier": { "Ref" : "DBInstanceIdentifier" }, "DBParameterGroupName": "default.aurora5.6", "Engine": "aurora", "DBClusterIdentifier": { "Ref": "RDSCluster" }, "PubliclyAccessible": "true", "DBInstanceClass": { "Ref" : "DBModel" } } }, "DBFromSiteSecurityGroup" : { "Type" : "AWS::EC2::SecurityGroup", "Properties" : { "GroupDescription" : "Enable MySQL", "SecurityGroupIngress" : [ {"IpProtocol" : "tcp", "FromPort" : "3306", "ToPort" : "3306", "CidrIp" : "195.171.102.98/32"} ] } }, "DBFromSiteSecurityGroupIngress1" : { "Type" : "AWS::EC2::SecurityGroupIngress", "Properties" : { "GroupName" : { "Ref" : "DBFromSiteSecurityGroup" }, "IpProtocol" : "tcp", "ToPort" : "3306", "FromPort" : "3306", "SourceSecurityGroupName" : { "Ref" : "DBFromSiteSecurityGroup" } } } } } 

The db_model parameter that I pass is "db.t2.medium". The cluster is created successfully in the cloudformation console, but creating AWS :: RDS :: DBInstance fails with the following error

 "DeletionPolicy:Snapshot cannot be specified for a cluster instance, use deletion policy on the cluster instead." 

What's even weirder, when I try to run the same CF template in the "eu london" section, it works great! Is there something wrong with the ireland and aurora of the EU?

+5
source share
2 answers

AWS Support

This is a known issue that other clients also report. The service team is currently working on a fix, but there is no ETA when it is clicked.

At the same time, the job is to specify a DeletionPolicy inside the resource definition of a DB instance that is not created with the value Delete. [1]

Example below:

 "Resources": { "Database1": { "DeletionPolicy": "Delete", "Properties": {...}, "Type": "AWS::RDS::DBInstance" } } 

References: [1] DeletionPolicy - http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#w2ab2c19c23c11c17

+8
source

Update from AWS Support :

When you create an Amazon Aurora DBInstance in a DB cluster using AWS CloudFormation, CloudFormation applies the default delete policy to Delete if no delete policy is specified. If the "Snapshot" deletion policy is specified for Amazon Aurora DBInstance, CloudFormation returns an error because the instances in the DB cluster cannot have a snapshot separately; Snapshot should be taken at DB Cluster Level.

As part of a recent deployment, we inadvertently changed the default delete policy for Amazon Aurora DBInstance to Snapshot. This is what our template check failed. To fix this, CloudFormation returns the default DeletionPolicy for Amazon Aurora DBInstances to "Delete." This hotfix will be completed by July 21, 2017. Until the hotfix is ​​fully deployed, customers can explicitly override our incorrect default values ​​by specifying the delete policy "Delete" for Amazon Aurora DBInstances.

We fixed the gap in our tests that led to this situation and will continue to improve our testing to prevent a recurrence. We recognize how important it is for us to maintain existing behavior for our customers and apologize for this inconvenience.

+1
source

Source: https://habr.com/ru/post/1269851/


All Articles