AWS CloudFormation
User Guide (Version )

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.


The AWS::DocDB::DBInstance Amazon DocumentDB (with MongoDB compatibility) resource describes a DBInstance. For more information, see DBInstance in the Amazon DocumentDB Developer Guide.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::DocDB::DBInstance", "Properties" : { "AutoMinorVersionUpgrade" : Boolean, "AvailabilityZone" : String, "DBClusterIdentifier" : String, "DBInstanceClass" : String, "DBInstanceIdentifier" : String, "PreferredMaintenanceWindow" : String, "Tags" : [ Tag, ... ] } }


Type: AWS::DocDB::DBInstance Properties: AutoMinorVersionUpgrade: Boolean AvailabilityZone: String DBClusterIdentifier: String DBInstanceClass: String DBInstanceIdentifier: String PreferredMaintenanceWindow: String Tags: - Tag



Indicates that minor engine upgrades are applied automatically to the instance during the maintenance window.

Default: true

Required: No

Type: Boolean

Update requires: No interruption


The Amazon EC2 Availability Zone that the instance is created in.

Default: A random, system-chosen Availability Zone in the endpoint's AWS Region.

Example: us-east-1d

Constraint: The AvailabilityZone parameter can't be specified if the MultiAZ parameter is set to true. The specified Availability Zone must be in the same AWS Region as the current endpoint.

Required: No

Type: String

Update requires: Replacement


The identifier of the cluster that the instance will belong to.

Required: Yes

Type: String

Update requires: Replacement


The compute and memory capacity of the instance; for example, db.m4.large. If you change the class of an instance there can be some interruption in the cluster's service.

Required: Yes

Type: String

Update requires: No interruption


The instance identifier. This parameter is stored as a lowercase string.


  • Must contain from 1 to 63 letters, numbers, or hyphens.

  • The first character must be a letter.

  • Cannot end with a hyphen or contain two consecutive hyphens.

Example: mydbinstance

Required: No

Type: String

Update requires: Replacement


The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC).

Format: ddd:hh24:mi-ddd:hh24:mi

The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week.

Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun

Constraints: Minimum 30-minute window.

Required: No

Type: String

Update requires: No interruption


The tags to be assigned to the instance. You can assign up to 10 tags to an instance.

Required: No

Type: List of Tag

Update requires: No interruption

Return Values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the DBInstance's name, such as sample-cluster-instance.

For more information about using the Ref function, see Ref.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


The connection endpoint for the instance. For example:


The port number on which the database accepts connections, such as 27017.



{ "Type" : "AWS::DocDB::DBInstance", "Properties" : { "AutoMinorVersionUpgrade" : true, "AvailabilityZone" : "us-east-1c", "DBClusterIdentifier" : "sample-cluster", "DBInstanceClass" : "db.r5.large", "DBInstanceIdentifier" : "sample-cluster-instance-0", "PreferredMaintenanceWindow" : "sat:06:54-sat:07:24", "Tags" : [{ "Key": "String","Value": "String" }] } }


Type: "AWS::DocDB::DBInstance" Properties: AutoMinorVersionUpgrade: true AvailabilityZone: "us-east-1c" DBClusterIdentifier: "sample-cluster" DBInstanceClass: "db.r5.large" DBInstanceIdentifier: "sample-cluster-instance-0" PreferredMaintenanceWindow: "sat:06:54-sat:07:24" Tags: - Key: "String" Value: "String"

See Also