AWS Amazon DocumentDB Cluster Instance
This page shows how to write Terraform and CloudFormation for Amazon DocumentDB Cluster Instance and write them securely.
aws_docdb_cluster_instance (Terraform)
The Cluster Instance in Amazon DocumentDB can be configured in Terraform with the resource name aws_docdb_cluster_instance. The following sections describe 3 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_docdb_cluster_instance" "db" {
cluster_identifier = "fake123"
instance_class = "db.t3.medium"
}
resource "aws_docdb_cluster_instance" "medium" {
resource "aws_docdb_cluster_instance" "db" {
cluster_identifier = "fake123"
instance_class = "db.t3.medium"
}
resource "aws_docdb_cluster_instance" "medium" {
resource "aws_docdb_cluster_instance" "gibson" {
identifier = "instruments-gibson-instance"
cluster_identifier = aws_docdb_cluster.gibson.id
instance_class = vars.docdb_instance
}
Parameters
-
apply_immediatelyoptional computed - bool -
arnoptional computed - string -
auto_minor_version_upgradeoptional - bool -
availability_zoneoptional computed - string -
ca_cert_identifieroptional computed - string -
cluster_identifierrequired - string -
db_subnet_group_nameoptional computed - string -
dbi_resource_idoptional computed - string -
endpointoptional computed - string -
engineoptional - string -
engine_versionoptional computed - string -
idoptional computed - string -
identifieroptional computed - string -
identifier_prefixoptional computed - string -
instance_classrequired - string -
kms_key_idoptional computed - string -
portoptional computed - number -
preferred_backup_windowoptional computed - string -
preferred_maintenance_windowoptional computed - string -
promotion_tieroptional - number -
publicly_accessibleoptional computed - bool -
storage_encryptedoptional computed - bool -
tagsoptional - map from string to string -
writeroptional computed - bool -
timeoutssingle block
Explanation in Terraform Registry
Provides an DocDB Cluster Resource Instance. A Cluster Instance Resource defines attributes that are specific to a single instance in a [DocDB Cluster][1]. You do not designate a primary and subsequent replicas. Instead, you simply add DocDB Instances and DocDB manages the replication. You can use the [count][3] meta-parameter to make multiple instances and join them all to the same DocDB Cluster, or you may specify different Cluster Instance resources with various
instance_classsizes.
Tips: Best Practices for The Other AWS Amazon DocumentDB Resources
In addition to the aws_docdb, AWS Amazon DocumentDB has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
aws_docdb_cluster
Ensure AWS DocumentDB logging is enabled
It is better to enable AWS DocumentDB logging for auditing and following compliance requirements.
AWS::DocDB::DBInstance (CloudFormation)
The DBInstance in DocDB can be configured in CloudFormation with the resource name AWS::DocDB::DBInstance. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
DBInstanceClassrequired - String -
DBClusterIdentifierrequired - String -
AvailabilityZoneoptional - String -
PreferredMaintenanceWindowoptional - String -
AutoMinorVersionUpgradeoptional - Boolean -
DBInstanceIdentifieroptional - String -
Tagsoptional - List of Tag
Explanation in CloudFormation Registry
The
AWS::DocDB::DBInstanceAmazon DocumentDB (with MongoDB compatibility) resource describes a DBInstance. For more information, see DBInstance in the Amazon DocumentDB Developer Guide.
Frequently asked questions
What is AWS Amazon DocumentDB Cluster Instance?
AWS Amazon DocumentDB Cluster Instance is a resource for Amazon DocumentDB of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon DocumentDB Cluster Instance?
For Terraform, the gilyas/infracost, infracost/infracost and MattEding/InstrumentDB source code examples are useful. See the Terraform Example section for further details.