Commit d86b10ba authored by Anton Babenko's avatar Anton Babenko Committed by GitHub

Merge pull request #3 from jensendw/final_snapshot_identifier

support final_snapshot_identifier
parents a60ed816 66b65f2d
......@@ -23,19 +23,19 @@ module "db" {
source = "terraform-aws-modules/rds/aws"
identifier = "demodb"
engine = "mysql"
engine_version = "5.7.11"
instance_class = "db.t2.large"
allocated_storage = 5
name = "demodb"
username = "user"
password = "YourPwdShouldBeLongAndSecure!"
port = "3306"
vpc_security_group_ids = ["sg-12345678"]
maintenance_window = "Mon:00:00-Mon:03:00"
backup_window = "03:00-06:00"
......@@ -47,19 +47,22 @@ module "db" {
Owner = "user"
Environment = "dev"
}
# DB subnet group
subnet_ids = ["subnet-12345678", "subnet-87654321"]
# DB parameter group
family = "mysql5.7"
# Snapshot name upon DB deletion
final_snapshot_identifier = "demodb"
parameters = [
{
{
name = "character_set_client"
value = "utf8"
},
{
{
name = "character_set_server"
value = "utf8"
}
......@@ -93,4 +96,4 @@ Module managed by [Anton Babenko](https://github.com/antonbabenko).
License
-------
Apache 2 Licensed. See LICENSE for full details.
\ No newline at end of file
Apache 2 Licensed. See LICENSE for full details.
......@@ -50,4 +50,7 @@ module "db" {
subnet_ids = ["${data.aws_subnet_ids.all.ids}"]
# DB parameter group
family = "mysql5.7"
# Snapshot name upon DB deletion
final_snapshot_identifier = "demodb"
}
......@@ -61,6 +61,7 @@ module "db_instance" {
maintenance_window = "${var.maintenance_window}"
skip_final_snapshot = "${var.skip_final_snapshot}"
copy_tags_to_snapshot = "${var.copy_tags_to_snapshot}"
final_snapshot_identifier = "${var.final_snapshot_identifier}"
backup_retention_period = "${var.backup_retention_period}"
backup_window = "${var.backup_window}"
......
......@@ -33,6 +33,7 @@ resource "aws_db_instance" "this" {
maintenance_window = "${var.maintenance_window}"
skip_final_snapshot = "${var.skip_final_snapshot}"
copy_tags_to_snapshot = "${var.copy_tags_to_snapshot}"
final_snapshot_identifier = "${var.final_snapshot_identifier}"
backup_retention_period = "${var.backup_retention_period}"
backup_window = "${var.backup_window}"
......
......@@ -49,6 +49,11 @@ variable "port" {
description = "The port on which the DB accepts connections"
}
variable "final_snapshot_identifier" {
description = "The name of your final DB snapshot when this DB instance is deleted."
default = ""
}
variable "vpc_security_group_ids" {
description = "List of VPC security groups to associate"
default = []
......
......@@ -29,6 +29,11 @@ variable "engine_version" {
description = "The engine version to use"
}
variable "final_snapshot_identifier" {
description = "The name of your final DB snapshot when this DB instance is deleted."
default = ""
}
variable "instance_class" {
description = "The instance type of the RDS instance"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment