Skip to content

CMS-Enterprise/batcave-tf-mysql

Repository files navigation

batcave-tf-mysql

This repository contains the Terraform code to create a MySQL database.

Requirements

Name Version
terraform >= 1.2
aws >= 4.61.0

Providers

Name Version
aws >= 4.61.0

Modules

Name Source Version
aurora terraform-aws-modules/rds-aurora/aws 6.1.4

Resources

Name Type
aws_db_parameter_group.db_parameter_group resource
aws_rds_cluster_parameter_group.db_cluster_parameter_group resource
aws_route53_record.www resource
aws_security_group_rule.db-egress-cluster_primary_security_group resource
aws_security_group_rule.db-egress-cluster_security_group resource
aws_security_group_rule.db-egress-worker_security_group resource

Inputs

Name Description Type Default Required
allowed_security_groups n/a list(string) n/a yes
apply_immediately n/a bool false no
auto_minor_version_upgrade n/a bool true no
backup_retention_period The days to retain backups for. Default 7 number 35 no
ca_cert_identifier Specifies the identifier of the CA certificate for the DB instance string "rds-ca-rsa2048-g1" no
cluster_primary_security_group_id n/a string n/a yes
cluster_security_group_id n/a string n/a yes
create_db_subnet_group n/a bool true no
create_security_group n/a bool true no
database_name n/a string n/a yes
db_cluster_parameter_group_parameters n/a list(map(string))
[
{
"name": "group_concat_max_len",
"value": "4096"
}
]
no
db_parameter_group_parameters n/a list(map(string))
[
{
"name": "general_log",
"value": "1"
},
{
"name": "group_concat_max_len",
"value": "4096"
},
{
"name": "log_bin_trust_function_creators",
"value": "1"
},
{
"name": "max_allowed_packet",
"value": "1073741824"
},
{
"name": "transaction_isolation",
"value": "READ-COMMITTED"
}
]
no
enabled_cloudwatch_logs_exports n/a list(any)
[
"audit",
"error",
"general",
"slowquery"
]
no
engine n/a string "aurora-mysql" no
engine_version n/a string "8.0" no
iam_database_authentication_enabled n/a bool true no
instance_class n/a string "db.r5.xlarge" no
master_username n/a string n/a yes
name n/a string n/a yes
publicly_accessible n/a string "false" no
route53_record_name n/a string n/a yes
route53_zone_id n/a string n/a yes
security_group_allowed_cidrs n/a list(string) [] no
skip_final_snapshot n/a bool false no
snapshot_identifier If specified creates this database from a snapshot. Default is null. Be warned that modifying this value on an already created database WILL destroy/recreate the whole cluster. string null no
subnets n/a list(string) n/a yes
tags n/a map(string)
{
"Owner": "Batcave"
}
no
vpc_id n/a string n/a yes
worker_security_group_id n/a string n/a yes

Outputs

Name Description
additional_cluster_endpoints A map of additional cluster endpoints and their attributes
cluster_arn Amazon Resource Name (ARN) of cluster
cluster_database_name Name for an automatically created database on cluster creation
cluster_endpoint Writer endpoint for the cluster
cluster_engine_version_actual The running version of the cluster database
cluster_hosted_zone_id The Route53 Hosted Zone ID of the endpoint
cluster_id The RDS Cluster Identifier
cluster_instances A map of cluster instances and their attributes
cluster_master_password The database master password
cluster_master_username The database master username
cluster_members List of RDS Instances that are a part of this cluster
cluster_port The database port
cluster_reader_endpoint A read-only endpoint for the cluster, automatically load-balanced across replicas
cluster_resource_id The RDS Cluster Resource ID
cluster_role_associations A map of IAM roles associated with the cluster and their attributes
db_subnet_group_name The db subnet group name
enhanced_monitoring_iam_role_arn The Amazon Resource Name (ARN) specifying the enhanced monitoring role
enhanced_monitoring_iam_role_name The name of the enhanced monitoring role
enhanced_monitoring_iam_role_unique_id Stable and unique string identifying the enhanced monitoring role
security_group_id The security group ID of the cluster