AWS CloudFormation
User Guide (API Version 2010-05-15)

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 version patches are applied automatically.

Required: No

Type: Boolean

Update requires: No interruption

AvailabilityZone

Specifies the name of the Availability Zone the DB instance is located in.

Required: No

Type: String

Update requires: Replacement

DBClusterIdentifier

Specifies the DB cluster this DB instance is a member of.

Required: Yes

Type: String

Update requires: Replacement

DBInstanceClass

Contains the name of the compute and memory capacity class of the DB instance.

Required: Yes

Type: String

Update requires: Some interruption

DBInstanceIdentifier

The unique identifier for this DB instance.

Required: No

Type: String

Update requires: Replacement

PreferredMaintenanceWindow

Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

Required: No

Type: String

Update requires: No interruption

Tags

A list of up to 50 tags. A tag is metadata assigned to an Amazon DocumentDB (with MongoDB compatibility) resource consisting of a key-value pair.

Required: No

Type: List of Resource Tag property types

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of an AWS::DocDB::DBInstance resource to the intrinsic Ref function, the function returns the DBInstanceIdentifier, such as sample-db-instance.

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

Fn::GetAtt

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

Endpoint

The connection endpoint for the DB 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.

For more information about using Fn::GetAtt, see Fn::GetAtt.

Example

JSON

{ "AWSTemplateFormatVersion" : "2010-09-09", "Resources" : { "myDBInstance" : { "Type" : "AWS::DocDB::DBInstance", "Properties" : { "AutoMinorVersionUpgrade" : "true", "Availabilityzone" : "us-east-1a", "DBClusterIdentifier" : "sample-cluster", "DBInstanceClass" : "db.r4.large", "DBInstanceIdentifier" : "sample-instance", "PreferredMaintenanceWindow" : "sat:04:51-sat:05:21", "Tags" : [ {"Key" : "String", "Value" : "String"} ] } } } }

YAML

AWSTemplateFormatVersion: "2010-09-09" Resources: myDBInstance: Type: "AWS::DocDB::DBInstance" Properties: AutoMinorVersionUpgrade: true AvailabilityZone: "us-east-1a" DBClusterIdentifier: "sample-cluster" DBInstanceClass: "db.r4.large" DBInstanceIdentifier: "sample-instance" PreferredMaintenanceWindow: "sat:04:51-sat:05:21" Tags: - Key: "String" Value: "String"

See Also

For more information, see the following topics in the Amazon DocumentDB Developers Guide.