AWS CloudFormation
User Guide (Version )

AWS::DocDB::DBInstance

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

Syntax

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

JSON

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

YAML

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

Properties

AutoMinorVersionUpgrade

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

AvailabilityZone

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

DBClusterIdentifier

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

Required: Yes

Type: String

Update requires: Replacement

DBInstanceClass

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

DBInstanceIdentifier

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

Constraints:

  • 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

PreferredMaintenanceWindow

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

Tags

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

Ref

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.

Fn::GetAtt

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.

Endpoint

The connection endpoint for the instance. For example: sample-cluster.cluster-abcdefghijkl.us-east-1.docdb.amazonaws.com.

Port

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

Examples

JSON

{ "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" }] } }

YAML

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