Configuration in this directory creates a set of RDS resources including DB instance, DB subnet group and DB parameter group.
To run this example you need to execute:
$ terraform init
$ terraform plan
$ terraform apply
To see blue/green deployment, update the engine_version
argument in module.postgres
to 15.4 and/or engine_version
in module.mysql to 8.0.34 after initial apply then execute:
$ terraform plan
$ terraform apply
Note that this example may create resources which cost money. Run terraform destroy
when you don't need these resources.
Name | Version |
---|---|
terraform | >= 1.0 |
aws | >= 5.62 |
Name | Version |
---|---|
aws | >= 5.62 |
Name | Source | Version |
---|---|---|
mysql | ../../ | n/a |
mysql_security_group | terraform-aws-modules/security-group/aws | ~> 5.0 |
postgres | ../../ | n/a |
postgres_security_group | terraform-aws-modules/security-group/aws | ~> 5.0 |
vpc | terraform-aws-modules/vpc/aws | ~> 5.0 |
Name | Type |
---|---|
aws_availability_zones.available | data source |
No inputs.
Name | Description |
---|---|
db_instance_status | The RDS instance status |
mysql_db_instance_address | The address of the RDS instance |
mysql_db_instance_arn | The ARN of the RDS instance |
mysql_db_instance_availability_zone | The availability zone of the RDS instance |
mysql_db_instance_cloudwatch_log_groups | Map of CloudWatch log groups created and their attributes |
mysql_db_instance_endpoint | The connection endpoint |
mysql_db_instance_engine | The database engine |
mysql_db_instance_engine_version_actual | The running version of the database |
mysql_db_instance_hosted_zone_id | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) |
mysql_db_instance_identifier | The RDS instance identifier |
mysql_db_instance_name | The database name |
mysql_db_instance_port | The database port |
mysql_db_instance_resource_id | The RDS Resource ID of this instance |
mysql_db_instance_username | The master username for the database |
mysql_db_parameter_group_arn | The ARN of the db parameter group |
mysql_db_parameter_group_id | The db parameter group id |
mysql_db_subnet_group_arn | The ARN of the db subnet group |
mysql_db_subnet_group_id | The db subnet group name |
postgres_db_instance_address | The address of the RDS instance |
postgres_db_instance_arn | The ARN of the RDS instance |
postgres_db_instance_availability_zone | The availability zone of the RDS instance |
postgres_db_instance_cloudwatch_log_groups | Map of CloudWatch log groups created and their attributes |
postgres_db_instance_endpoint | The connection endpoint |
postgres_db_instance_engine | The database engine |
postgres_db_instance_engine_version_actual | The running version of the database |
postgres_db_instance_hosted_zone_id | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) |
postgres_db_instance_identifier | The RDS instance identifier |
postgres_db_instance_name | The database name |
postgres_db_instance_port | The database port |
postgres_db_instance_resource_id | The RDS Resource ID of this instance |
postgres_db_instance_status | The RDS instance status |
postgres_db_instance_username | The master username for the database |
postgres_db_parameter_group_arn | The ARN of the db parameter group |
postgres_db_parameter_group_id | The db parameter group id |
postgres_db_subnet_group_arn | The ARN of the db subnet group |
postgres_db_subnet_group_id | The db subnet group name |