Module: rds-cluster
Terraform module to provision an RDS Aurora cluster for MySQL or Postgres.
Supports Amazon Aurora Serverless.
Usage
For a complete example, see examples/complete.
For automated tests of the complete example using bats and Terratest (which tests and deploys the example on AWS), see test.
module "rds_cluster_aurora_postgres" {
source = "cloudposse/rds-cluster/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
name = "postgres"
engine = "aurora-postgresql"
cluster_family = "aurora-postgresql9.6"
# 1 writer, 1 reader
cluster_size = 2
# 1 writer, 3 reader
# cluster_size = 4
# 1 writer, 5 reader
# cluster_size = 6
namespace = "eg"
stage = "dev"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = 5432
instance_type = "db.r4.large"
vpc_id = "vpc-xxxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
}
module "rds_cluster_aurora_mysql_serverless" {
source = "cloudposse/rds-cluster/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
namespace = "eg"
stage = "dev"
name = "db"
engine = "aurora"
engine_mode = "serverless"
cluster_family = "aurora5.6"
cluster_size = 0
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = 3306
instance_type = "db.t2.small"
vpc_id = "vpc-xxxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
enable_http_endpoint = true
scaling_configuration = [
{
auto_pause = true
max_capacity = 256
min_capacity = 2
seconds_until_auto_pause = 300
}
]
}
Serverless Aurora 2.07.1 MySQL 5.7
module "rds_cluster_aurora_mysql_serverless" {
source = "cloudposse/rds-cluster/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
namespace = "eg"
stage = "dev"
name = "db"
engine = "aurora-mysql"
engine_mode = "serverless"
engine_version = "5.7.mysql_aurora.2.07.1"
cluster_family = "aurora-mysql5.7"
cluster_size = 0
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = 3306
vpc_id = "vpc-xxxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
enable_http_endpoint = true
scaling_configuration = [
{
auto_pause = true
max_capacity = 16
min_capacity = 1
seconds_until_auto_pause = 300
timeout_action = "ForceApplyCapacityChange"
}
]
}
module "rds_cluster_aurora_mysql" {
source = "cloudposse/rds-cluster/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
engine = "aurora"
cluster_family = "aurora-mysql5.7"
cluster_size = 2
namespace = "eg"
stage = "dev"
name = "db"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
instance_type = "db.t2.small"
vpc_id = "vpc-xxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
cluster_parameters = [
{
name = "character_set_client"
value = "utf8"
},
{
name = "character_set_connection"
value = "utf8"
},
{
name = "character_set_database"
value = "utf8"
},
{
name = "character_set_results"
value = "utf8"
},
{
name = "character_set_server"
value = "utf8"
},
{
name = "collation_connection"
value = "utf8_bin"
},
{
name = "collation_server"
value = "utf8_bin"
},
{
name = "lower_case_table_names"
value = "1"
apply_method = "pending-reboot"
},
{
name = "skip-character-set-client-handshake"
value = "1"
apply_method = "pending-reboot"
}
]
}
# create IAM role for monitoring
resource "aws_iam_role" "enhanced_monitoring" {
name = "rds-cluster-example-1"
assume_role_policy = data.aws_iam_policy_document.enhanced_monitoring.json
}
# Attach Amazon's managed policy for RDS enhanced monitoring
resource "aws_iam_role_policy_attachment" "enhanced_monitoring" {
role = aws_iam_role.enhanced_monitoring.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonRDSEnhancedMonitoringRole"
}
# allow rds to assume this role
data "aws_iam_policy_document" "enhanced_monitoring" {
statement {
actions = [
"sts:AssumeRole",
]
effect = "Allow"
principals {
type = "Service"
identifiers = ["monitoring.rds.amazonaws.com"]
}
}
}
module "rds_cluster_aurora_postgres" {
source = "cloudposse/rds-cluster/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
engine = "aurora-postgresql"
cluster_family = "aurora-postgresql9.6"
cluster_size = 2
namespace = "eg"
stage = "dev"
name = "db"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = 5432
instance_type = "db.r4.large"
vpc_id = "vpc-xxxxxxx"
security_groups = ["sg-xxxxxxxx"]
subnets = ["subnet-xxxxxxxx", "subnet-xxxxxxxx"]
zone_id = "Zxxxxxxxx"
# enable monitoring every 30 seconds
rds_monitoring_interval = 30
# reference iam role created above
rds_monitoring_role_arn = aws_iam_role.enhanced_monitoring.arn
}
Examples
Review the complete example to see how to use this module.
Variables
Required Variables
subnets(list(string)) requiredList of VPC subnet IDs
vpc_id(string) requiredVPC ID to create the cluster in (e.g.
vpc-a22222ee)
Optional Variables
activity_stream_enabled(bool) optionalWhether to enable Activity Streams
Default value:
falseactivity_stream_kms_key_id(string) optionalThe ARN for the KMS key to encrypt Activity Stream Data data. When specifying
activity_stream_kms_key_id,activity_stream_enabledneeds to be set to trueDefault value:
""activity_stream_mode(string) optionalThe mode for the Activity Streams.
asyncandsyncare supported. Defaults toasyncDefault value:
"async"admin_password(string) optionalPassword for the master DB user. Ignored if snapshot_identifier or replication_source_identifier is provided
Default value:
""admin_user(string) optionalUsername for the master DB user. Ignored if snapshot_identifier or replication_source_identifier is provided
Default value:
"admin"admin_user_secret_kms_key_id(string) optionalAmazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.
To use a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN.
If not specified, the default KMS key for your Amazon Web Services account is used.Default value:
nullallocated_storage(number) optionalThe allocated storage in GBs
Default value:
nullallow_major_version_upgrade(bool) optionalEnable to allow major engine version upgrades when changing engine versions. Defaults to false.
Default value:
falseallowed_cidr_blocks(list(string)) optionalList of CIDR blocks allowed to access the cluster
Default value:
[ ]allowed_ipv6_cidr_blocks(list(string)) optionalList of IPv6 CIDR blocks allowed to access the cluster
Default value:
[ ]apply_immediately(bool) optionalSpecifies whether any cluster modifications are applied immediately, or during the next maintenance window
Default value:
trueauto_minor_version_upgrade(bool) optionalIndicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window
Default value:
trueautoscaling_enabled(bool) optionalWhether to enable cluster autoscaling
Default value:
falseautoscaling_max_capacity(number) optionalMaximum number of instances to be maintained by the autoscaler
Default value:
5autoscaling_min_capacity(number) optionalMinimum number of instances to be maintained by the autoscaler
Default value:
1autoscaling_policy_type(string) optionalAutoscaling policy type.
TargetTrackingScalingandStepScalingare supportedDefault value:
"TargetTrackingScaling"autoscaling_scale_in_cooldown(number) optionalThe amount of time, in seconds, after a scaling activity completes and before the next scaling down activity can start. Default is 300s
Default value:
300autoscaling_scale_out_cooldown(number) optionalThe amount of time, in seconds, after a scaling activity completes and before the next scaling up activity can start. Default is 300s
Default value:
300autoscaling_target_metrics(string) optionalThe metrics type to use. If this value isn't provided the default is CPU utilization
Default value:
"RDSReaderAverageCPUUtilization"autoscaling_target_value(number) optionalThe target value to scale with respect to target metrics
Default value:
75backtrack_window(number) optionalThe target backtrack window, in seconds. Only available for aurora engine currently. Must be between 0 and 259200 (72 hours)
Default value:
0backup_window(string) optionalDaily time range during which the backups happen
Default value:
"07:00-09:00"ca_cert_identifier(string) optionalThe identifier of the CA certificate for the DB instance
Default value:
nullcluster_dns_name(string) optionalName of the cluster CNAME record to create in the parent DNS zone specified by
zone_id. If left empty, the name will be auto-asigned using the formatmaster.var.nameDefault value:
""cluster_family(string) optionalThe family of the DB cluster parameter group
Default value:
"aurora5.6"cluster_identifier(string) optionalThe RDS Cluster Identifier. Will use generated label ID if not supplied
Default value:
""cluster_parametersoptionalList of DB cluster parameters to apply
Type:
list(object({
apply_method = string
name = string
value = string
}))Default value:
[ ]cluster_size(number) optionalNumber of DB instances to create in the cluster
Default value:
2cluster_type(string) optionalEither
regionalorglobal.
Ifregionalwill be created as a normal, standalone DB.
Ifglobal, will be made part of a Global cluster (requiresglobal_cluster_identifier).Default value:
"regional"copy_tags_to_snapshot(bool) optionalCopy tags to backup snapshots
Default value:
falsedatabase_insights_mode(string) optionalThe database insights mode for the RDS cluster. Valid values are
standard,advanced. See https://registry.terraform.io/providers/hashicorp/aws/6.16.0/docs/resources/rds_cluster#database_insights_mode-1Default value:
nulldb_cluster_instance_class(string) optionalThis setting is required to create a provisioned Multi-AZ DB cluster
Default value:
nulldb_name(string) optionalDatabase name (default is not to create a database)
Default value:
""db_parameter_group_name(string) optionalThe name to give to the created
aws_db_parameter_groupresource.
If omitted, the module will generate a name.Default value:
""db_port(number) optionalDatabase port
Default value:
3306deletion_protection(bool) optionalIf the DB instance should have deletion protection enabled
Default value:
falseegress_enabled(bool) optionalWhether or not to apply the egress security group rule to default security group, defaults to
trueDefault value:
trueenable_global_write_forwarding(bool) optionalSet to
true, to forward writes to an associated global cluster.Default value:
nullenable_http_endpoint(bool) optionalEnable HTTP endpoint (data API). Only valid when engine_mode is set to serverless
Default value:
falseenable_local_write_forwarding(bool) optionalSet to
true, to forward writes sent to a reader to the writer instance.Default value:
nullenabled_cloudwatch_logs_exports(list(string)) optionalList of log types to export to cloudwatch. The following log types are supported: audit, error, general, slowquery
Default value:
[ ]engine(string) optionalThe name of the database engine to be used for this DB cluster. Valid values:
aurora,aurora-mysql,aurora-postgresqlDefault value:
"aurora"engine_mode(string) optionalThe database engine mode. Valid values:
parallelquery,provisioned,serverlessDefault value:
"provisioned"engine_version(string) optionalThe version of the database engine to use. See
aws rds describe-db-engine-versionsDefault value:
""enhanced_monitoring_attributes(list(string)) optionalThe attributes for the enhanced monitoring IAM role
Default value:
[
"enhanced-monitoring"
]enhanced_monitoring_role_enabled(bool) optionalA boolean flag to enable/disable the creation of the enhanced monitoring IAM role. If set to
false, the module will not create a new role and will userds_monitoring_role_arnfor enhanced monitoringDefault value:
falseglobal_cluster_identifier(string) optionalID of the Aurora global cluster
Default value:
""iam_database_authentication_enabled(bool) optionalSpecifies whether or mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled
Default value:
falseiam_roles(list(string)) optionalIam roles for the Aurora cluster
Default value:
[ ]instance_availability_zone(string) optionalOptional parameter to place cluster instances in a specific availability zone. If left empty, will place randomly
Default value:
""instance_parametersoptionalList of DB instance parameters to apply
Type:
list(object({
apply_method = string
name = string
value = string
}))Default value:
[ ]instance_type(string) optionalInstance type to use
Default value:
"db.t2.small"intra_security_group_traffic_enabled(bool) optionalWhether to allow traffic between resources inside the database's security group.
Default value:
falseiops(number) optionalThe amount of provisioned IOPS. Setting this implies a storage_type of 'io1'. This setting is required to create a Multi-AZ DB cluster. Check TF docs for values based on db engine
Default value:
nullkms_key_arn(string) optionalThe ARN for the KMS encryption key. When specifying
kms_key_arn,storage_encryptedneeds to be set totrueDefault value:
""maintenance_window(string) optionalWeekly time range during which system maintenance can occur, in UTC
Default value:
"wed:03:00-wed:04:00"manage_admin_user_password(bool) optionalSet to true to allow RDS to manage the master user password in Secrets Manager. Cannot be set if master_password is provided
Default value:
falsenetwork_type(string) optionalThe network type of the cluster. Valid values: IPV4, DUAL.
Default value:
"IPV4"parameter_group_name_prefix_enabled(bool) optionalSet to
trueto usename_prefixto name the cluster and database parameter groups. Set tofalseto usenameinsteadDefault value:
trueperformance_insights_enabled(bool) optionalWhether to enable Performance Insights
Default value:
falseperformance_insights_kms_key_id(string) optionalThe ARN for the KMS key to encrypt Performance Insights data. When specifying
performance_insights_kms_key_id,performance_insights_enabledneeds to be set to trueDefault value:
""performance_insights_retention_period(number) optionalAmount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 (2 years)
Default value:
nullpromotion_tier(number) optionalFailover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.
Readers in promotion tiers 0 and 1 scale at the same time as the writer. Readers in promotion tiers 2–15 scale independently from the writer. For more information, see: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.how-it-works.html#aurora-serverless-v2.how-it-works.scaling
Default value:
0publicly_accessible(bool) optionalSet to true if you want your cluster to be publicly accessible (such as via QuickSight)
Default value:
falserds_cluster_parameter_group_name(string) optionalThe name to give to the created
aws_rds_cluster_parameter_groupresource.
If omitted, the module will generate a name.Default value:
""rds_monitoring_interval(number) optionalThe interval, in seconds, between points when enhanced monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60
Default value:
0rds_monitoring_role_arn(string) optionalThe ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs
Default value:
nullrds_ri_duration(number) optionalThe number of years to reserve the instance. Values can be 1 or 3 (or in seconds, 31536000 or 94608000)
Default value:
1rds_ri_offering_type(string) optionalOffering type of reserved DB instances. Valid values are 'No Upfront', 'Partial Upfront', 'All Upfront'.
Default value:
""rds_ri_reservation_id(string) optionalCustomer-specified identifier to track the reservation of the reserved DB instance.
Default value:
nullreader_dns_name(string) optionalName of the reader endpoint CNAME record to create in the parent DNS zone specified by
zone_id. If left empty, the name will be auto-asigned using the formatreplicas.var.nameDefault value:
""replication_source_identifier(string) optionalARN of a source DB cluster or DB instance if this DB cluster is to be created as a Read Replica
Default value:
""restore_to_point_in_timeoptionalList of point-in-time recovery options. Valid parameters are:
source_cluster_identifier
Identifier of the source database cluster from which to restore.
restore_type:
Type of restore to be performed. Valid options are "full-copy" and "copy-on-write".
use_latest_restorable_time:
Set to true to restore the database cluster to the latest restorable backup time. Conflicts withrestore_to_time.
restore_to_time:
Date and time in UTC format to restore the database cluster to. Conflicts withuse_latest_restorable_time.Type:
list(object({
source_cluster_identifier = string
restore_type = optional(string, "copy-on-write")
use_latest_restorable_time = optional(bool, true)
restore_to_time = optional(string, null)
}))Default value:
[ ]retention_period(number) optionalNumber of days to retain backups for
Default value:
5s3_importoptionalRestore from a Percona Xtrabackup in S3. The
bucket_nameis required to be in the same region as the resource.Type:
object({
bucket_name = string
bucket_prefix = string
ingestion_role = string
source_engine = string
source_engine_version = string
})Default value:
nullscaling_configurationoptionalList of nested attributes with scaling properties. Only valid when
engine_modeis set toserverlessType:
list(object({
auto_pause = bool
max_capacity = number
min_capacity = number
seconds_until_auto_pause = number
timeout_action = string
}))Default value:
[ ]security_groups(list(string)) optionalList of security groups to be allowed to connect to the DB instance
Default value:
[ ]serverlessv2_scaling_configurationoptionalserverlessv2 scaling properties
Type:
object({
min_capacity = number
max_capacity = number
seconds_until_auto_pause = optional(number, null)
})Default value:
nullskip_final_snapshot(bool) optionalDetermines whether a final DB snapshot is created before the DB cluster is deleted
Default value:
truesnapshot_identifier(string) optionalSpecifies whether or not to create this cluster from a snapshot
Default value:
nullsource_region(string) optionalSource Region of primary cluster, needed when using encrypted storage and region replicas
Default value:
""storage_encrypted(bool) optionalSpecifies whether the DB cluster is encrypted. The default is
falseforprovisionedengine_modeandtrueforserverlessengine_modeDefault value:
falsestorage_type(string) optionalOne of 'standard' (magnetic), 'gp2' (general purpose SSD), 'io1' (provisioned IOPS SSD), 'aurora', or 'aurora-iopt1'
Default value:
nullsubnet_group_name(string) optionalDatabase subnet group name. Will use generated label ID if not supplied.
Default value:
""timeouts_configurationoptionalList of timeout values per action. Only valid actions are
create,updateanddeleteType:
list(object({
create = string
update = string
delete = string
}))Default value:
[ ]use_reserved_instances(bool) optionalWARNING: Observe your plans and applies carefully when using this feature.
It has potential to be very expensive if not used correctly.
Also, it is not clear what happens when the reservation expires.Whether to use reserved instances.
Default value:
falsevpc_security_group_ids(list(string)) optionalAdditional security group IDs to apply to the cluster, in addition to the provisioned default security group with ingress traffic from existing CIDR blocks and existing security groups
Default value:
[ ]zone_id(any) optionalRoute53 DNS Zone ID as list of string (0 or 1 items). If empty, no custom DNS name will be published.
If the list contains a single Zone ID, a custom DNS name will be pulished in that zone.
Can also be a plain string, but that use is DEPRECATED because of Terraform issues.Default value:
[ ]
Context Variables
The following variables are defined in the context.tf file of this module and part of the terraform-null-label pattern.
context.tf file of this module and part of the terraform-null-label pattern.additional_tag_map(map(string)) optionalAdditional key-value pairs to add to each map in
tags_as_list_of_maps. Not added totagsorid.
This is for some rare cases where resources want additional configuration of tags
and therefore take a list of maps with tag key, value, and additional configuration.Required: No
Default value:
{ }attributes(list(string)) optionalID element. Additional attributes (e.g.
workersorcluster) to add toid,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by thedelimiter
and treated as a single ID element.Required: No
Default value:
[ ]context(any) optionalSingle object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables asnullto use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional_tag_map, which are merged.Required: No
Default value:
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}delimiter(string) optionalDelimiter to be used between ID elements.
Defaults to-(hyphen). Set to""to use no delimiter at all.Required: No
Default value:
nulldescriptor_formats(any) optionalDescribe additional descriptors to be output in the
descriptorsoutput map.
Map of maps. Keys are names of descriptors. Values are maps of the form
\{<br/> format = string<br/> labels = list(string)<br/> \}
(Type isanyso the map values can later be enhanced to provide additional options.)
formatis a Terraform format string to be passed to theformat()function.
labelsis a list of labels, in order, to pass toformat()function.
Label values will be normalized before being passed toformat()so they will be
identical to how they appear inid.
Default is{}(descriptorsoutput will be empty).Required: No
Default value:
{ }enabled(bool) optionalSet to false to prevent the module from creating any resources
Required: NoDefault value:
nullenvironment(string) optionalID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT'
Required: NoDefault value:
nullid_length_limit(number) optionalLimit
idto this many characters (minimum 6).
Set to0for unlimited length.
Set tonullfor keep the existing setting, which defaults to0.
Does not affectid_full.Required: No
Default value:
nulllabel_key_case(string) optionalControls the letter case of the
tagskeys (label names) for tags generated by this module.
Does not affect keys of tags passed in via thetagsinput.
Possible values:lower,title,upper.
Default value:title.Required: No
Default value:
nulllabel_order(list(string)) optionalThe order in which the labels (ID elements) appear in the
id.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present.Required: No
Default value:
nulllabel_value_case(string) optionalControls the letter case of ID elements (labels) as included in
id,
set as tag values, and output by this module individually.
Does not affect values of tags passed in via thetagsinput.
Possible values:lower,title,upperandnone(no transformation).
Set this totitleand setdelimiterto""to yield Pascal Case IDs.
Default value:lower.Required: No
Default value:
nulllabels_as_tags(set(string)) optionalSet of labels (ID elements) to include as tags in the
tagsoutput.
Default is to include all labels.
Tags with empty values will not be included in thetagsoutput.
Set to[]to suppress all generated tags.
Notes:
The value of thenametag, if included, will be theid, not thename.
Unlike othernull-labelinputs, the initial setting oflabels_as_tagscannot be
changed in later chained modules. Attempts to change it will be silently ignored.Required: No
Default value:
[
"default"
]name(string) optionalID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
This is the only ID element not also included as atag.
The "name" tag is set to the fullidstring. There is no tag with the value of thenameinput.Required: No
Default value:
nullnamespace(string) optionalID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique
Required: NoDefault value:
nullregex_replace_chars(string) optionalTerraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set,"/[^a-zA-Z0-9-]/"is used to remove all characters other than hyphens, letters and digits.Required: No
Default value:
nullstage(string) optionalID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release'
Required: NoDefault value:
nulltags(map(string)) optionalAdditional tags (e.g.
{'BusinessUnit': 'XYZ'}).
Neither the tag keys nor the tag values will be modified by this module.Required: No
Default value:
{ }tenant(string) optionalID element (Rarely used, not included by default). A customer identifier, indicating who this instance of a resource is for
Required: NoDefault value:
null
Outputs
activity_stream_arnActivity Stream ARN
activity_stream_nameActivity Stream Name
admin_user_secretThe secret manager attributes for the managed admin user password (
master_user_secret).arnAmazon Resource Name (ARN) of the cluster
cluster_identifierCluster Identifier
cluster_resource_idThe region-unique, immutable identifie of the cluster
cluster_security_groupsDefault RDS cluster security groups
database_nameDatabase name
dbi_resource_idsList of the region-unique, immutable identifiers for the DB instances in the cluster
endpointThe DNS address of the RDS instance
instance_endpointsList of DNS addresses for the DB instances in the cluster
master_hostDB Master hostname
master_usernameUsername for the master DB user
portDB port
reader_endpointA read-only endpoint for the Aurora cluster, automatically load-balanced across replicas
replicas_hostReplicas hostname
reserved_instanceAll information about the reserved instance(s) if created.
security_group_arnSecurity Group ARN
security_group_idSecurity Group ID
security_group_nameSecurity Group name
Dependencies
Requirements
terraform, version:>= 1.0.0aws, version:>= 5.81.0null, version:>= 2.0random, version:>= 2.0
Providers
aws, version:>= 5.81.0random, version:>= 2.0
Modules
| Name | Version | Source | Description |
|---|---|---|---|
dns_master | 0.13.0 | cloudposse/route53-cluster-hostname/aws | n/a |
dns_replicas | 0.13.0 | cloudposse/route53-cluster-hostname/aws | n/a |
enhanced_monitoring_label | 0.25.0 | cloudposse/label/null | n/a |
rds_identifier | 0.25.0 | cloudposse/label/null | n/a |
this | 0.25.0 | cloudposse/label/null | n/a |
Resources
The following resources are used by this module:
aws_appautoscaling_policy.replicas(resource)aws_appautoscaling_target.replicas(resource)aws_db_parameter_group.default(resource)aws_db_subnet_group.default(resource)aws_iam_role.enhanced_monitoring(resource)aws_iam_role_policy_attachment.enhanced_monitoring(resource)aws_rds_cluster.primary(resource)aws_rds_cluster.secondary(resource)aws_rds_cluster_activity_stream.primary(resource)aws_rds_cluster_instance.default(resource)aws_rds_cluster_parameter_group.default(resource)aws_rds_reserved_instance.default(resource)aws_security_group.default(resource)aws_security_group_rule.egress(resource)aws_security_group_rule.egress_ipv6(resource)aws_security_group_rule.ingress_cidr_blocks(resource)aws_security_group_rule.ingress_ipv6_cidr_blocks(resource)aws_security_group_rule.ingress_security_groups(resource)aws_security_group_rule.traffic_inside_security_group(resource)random_pet.instance(resource)
Data Sources
The following data sources are used by this module:
aws_iam_policy_document.enhanced_monitoring(data source)aws_partition.current(data source)aws_rds_reserved_instance_offering.default(data source)