diff --git a/modules/mysql/rds/0.1/facets.yaml b/modules/mysql/rds/0.1/facets.yaml index 55753ee1a..c51164e37 100644 --- a/modules/mysql/rds/0.1/facets.yaml +++ b/modules/mysql/rds/0.1/facets.yaml @@ -1,9 +1,23 @@ intent: mysql flavor: rds -version: "0.1" +version: '0.1' description: Adds MYSQL module of flavor rds clouds: - - aws +- aws +inputs: + network_details: + optional: false + type: '@outputs/aws_vpc' + default: + resource_type: network + resource_name: default +outputs: + default: + type: '@outputs/mysql' +imports: +- name: mysql_master_instance + resource_address: module.rds-mysql-master.module.db_instance.aws_db_instance.this[0] + required: true spec: title: RDS type: object @@ -13,10 +27,10 @@ spec: title: MySQL Version description: Version of MySQL minLength: 1 - x-ui-placeholder: "Ex. 8.0" + x-ui-placeholder: Ex. 8.0 enum: - - "8.0" - - "5.7" + - '8.0' + - '5.7' size: type: object title: Size @@ -32,20 +46,20 @@ spec: title: Instance Type description: Type of Instance for Reader enum: - - db.t4g.medium - - db.t3.medium - - db.t3.small - - db.t3.micro - - db.t3.large - - db.t3.xlarge - - db.t3.2xlarge - - db.t2.micro - - db.t2.small - - db.t2.medium - - db.t2.large - x-ui-placeholder: "Select writer instance type" + - db.t4g.medium + - db.t3.medium + - db.t3.small + - db.t3.micro + - db.t3.large + - db.t3.xlarge + - db.t3.2xlarge + - db.t2.micro + - db.t2.small + - db.t2.medium + - db.t2.large + x-ui-placeholder: Select writer instance type required: - - instance + - instance reader: type: object title: Reader @@ -56,49 +70,50 @@ spec: title: Instance Type description: Type of Instance for Reader enum: - - db.t4g.medium - - db.t3.medium - - db.t3.small - - db.t3.micro - - db.t3.large - - db.t3.xlarge - - db.t3.2xlarge - - db.t2.micro - - db.t2.small - - db.t2.medium - - db.t2.large - x-ui-placeholder: "Select reader instance type" + - db.t4g.medium + - db.t3.medium + - db.t3.small + - db.t3.micro + - db.t3.large + - db.t3.xlarge + - db.t3.2xlarge + - db.t2.micro + - db.t2.small + - db.t2.medium + - db.t2.large + x-ui-placeholder: Select reader instance type instance_count: type: integer title: Instance Count description: Number of Reader Instances - x-ui-placeholder: "Enter reader instance count" - x-ui-error-message: "Instance count must be a non-negative integer" + x-ui-placeholder: Enter reader instance count + x-ui-error-message: Instance count must be a non-negative integer minimum: 0 maximum: 20 required: - - instance + - instance apply_immediately: type: boolean title: Apply Immediately - description: This specifies whether any modifications are applied immediately, or during the next maintenance window. Default is false + description: This specifies whether any modifications are applied immediately, + or during the next maintenance window. Default is false required: - - size - - mysql_version + - size + - mysql_version x-ui-order: - - mysql_version - - size + - mysql_version + - size sample: - $schema: "https://facets-cloud.github.io/facets-schemas/schemas/mysql/mysql.schema.json" + $schema: https://facets-cloud.github.io/facets-schemas/schemas/mysql/mysql.schema.json kind: mysql flavor: rds - version: "0.1" + version: '0.1' disabled: true metadata: tags: managed-by: facets spec: - mysql_version: "8.0" + mysql_version: '8.0' apply_immediately: false size: writer: @@ -106,3 +121,6 @@ sample: reader: instance: db.t4g.medium instance_count: 0 +iac: + validated_files: + - variables.tf diff --git a/modules/mysql/rds/0.1/generate_resource_details/main.tf b/modules/mysql/rds/0.1/generate_resource_details/main.tf new file mode 100644 index 000000000..9fcb53943 --- /dev/null +++ b/modules/mysql/rds/0.1/generate_resource_details/main.tf @@ -0,0 +1,24 @@ +locals { + data = base64encode(jsonencode({ + name = var.name + resource_type = var.resource_type + resource_name = var.resource_name + key = var.key + value = var.value + })) +} + +resource "null_resource" "generate-resource-details" { + triggers = { + name = var.name + resource_type = var.resource_type + resource_name = var.resource_name + key = var.key + value = var.value + always = timestamp() + } + + provisioner "local-exec" { + command = "mkdir -p resource-details; echo ${local.data} | base64 -d > resource-details/${md5(local.data)}.json" + } +} \ No newline at end of file diff --git a/modules/mysql/rds/0.1/generate_resource_details/variables.tf b/modules/mysql/rds/0.1/generate_resource_details/variables.tf new file mode 100644 index 000000000..5339ecd87 --- /dev/null +++ b/modules/mysql/rds/0.1/generate_resource_details/variables.tf @@ -0,0 +1,21 @@ +variable "name" { + type = string +} + +variable "resource_type" { + type = string +} + +variable "resource_name" { + type = string + default = "NA" +} + +variable "key" { + type = string + default = "NA" +} + +variable "value" { + type = string +} \ No newline at end of file diff --git a/modules/mysql/rds/0.1/main.tf b/modules/mysql/rds/0.1/main.tf new file mode 100644 index 000000000..c9ea5772b --- /dev/null +++ b/modules/mysql/rds/0.1/main.tf @@ -0,0 +1,193 @@ +locals { + reader_count = lookup(var.instance.spec.size, "reader", {}) == {} ? 0 : lookup(lookup(var.instance.spec.size, "reader", {}), "replica_count", lookup(lookup(var.instance.spec.size, "reader", {}), "instance_count", 0)) + reader_db_instances = local.reader_count > 0 ? { + for index in range(local.reader_count) : + "replica-${index}" => { + instance_class = var.instance.spec.size.reader.instance + } + } : {} + writer_db_instances = { + "master" = { + instance_class = var.instance.spec.size.writer.instance + } + } + db_cluster_name = length(lower("${var.environment.unique_name}-${var.instance_name}")) >= 30 ? substr("fc-${md5(lower("${var.environment.unique_name}-${var.instance_name}"))}", 0, 20) : lower("${var.environment.unique_name}-${var.instance_name}") + + advanced = lookup(lookup(var.instance, "advanced", {}), "rds", {}) + advanced_rds_mysql = lookup(local.advanced, "rds-mysql", {}) + + version = lookup(var.instance.spec, "mysql_version", null) + metadata = lookup(var.instance, "metadata", {}) + user_defined_tags = lookup(local.metadata, "tags", {}) + iops = local.storage_type == "gp2" ? null : local.storage_type == "gp3" && local.allocated_storage < 400 ? null : lookup(local.advanced_rds_mysql, "iops", 12000) < 12000 ? 12000 : lookup(local.advanced_rds_mysql, "iops", 12000) + tags = merge(local.user_defined_tags, var.environment.cloud_tags) + multi_az = lookup(local.advanced_rds_mysql, "multi_az", false) + storage_type = lookup(local.advanced_rds_mysql, "storage_type", "gp3") + allocated_storage = lookup(local.advanced_rds_mysql, "allocated_storage", 50) + max_allocated_storage = lookup(local.advanced_rds_mysql, "max_allocated_storage", 200) + availability_zone = lookup(local.advanced_rds_mysql, "availability_zone", null) == null ? var.inputs.network_details.attributes.legacy_outputs.vpc_details.azs[0] : lookup(local.advanced_rds_mysql, "availability_zone", null) + snapshot = lookup(local.advanced_rds_mysql, "snapshot_identifier", null) != null ? true : false + + max_connections = lookup(var.instance.spec, "max_connections", {}) + db_parameter_group_parameters = lookup(local.advanced_rds_mysql, "parameters", []) + db_parameter_group_parameters_map = { for param in local.db_parameter_group_parameters : param.name => param } + reader_db_parameter_group_parameters_map = lookup(local.max_connections, "reader", null) == null ? local.db_parameter_group_parameters_map : merge(local.db_parameter_group_parameters_map, { + max_connections = { + name = "max_connections" + value = lookup(local.max_connections, "reader") + } + }) + writer_db_parameter_group_parameters_map = lookup(local.max_connections, "writer", null) == null ? local.db_parameter_group_parameters_map : merge(local.db_parameter_group_parameters_map, { + max_connections = { + name = "max_connections" + value = lookup(local.max_connections, "writer") + } + }) + reader_db_parameter_group_parameters = [ + for k, v in local.reader_db_parameter_group_parameters_map : v + ] + writer_db_parameter_group_parameters = [ + for k, v in local.writer_db_parameter_group_parameters_map : v + ] +} + +module "mysql-password" { + source = "github.com/Facets-cloud/facets-utility-modules//password" + length = 20 +} + +module "mysql_security_group" { + source = "terraform-aws-modules/security-group/aws" + version = "~> 4.0" + + name = local.db_cluster_name + description = "MySQL security group for ${local.db_cluster_name}" + vpc_id = var.inputs.network_details.attributes.legacy_outputs.vpc_details.vpc_id + + # ingress + ingress_with_cidr_blocks = [ + { + from_port = 3306 + to_port = 3306 + protocol = "tcp" + description = "MySQL access from within VPC since db is private" + cidr_blocks = var.inputs.network_details.attributes.legacy_outputs.vpc_details.vpc_cidr + }, + ] + + tags = local.tags +} + +module "rds-mysql-master" { + source = "./terraform-aws-rds-master" + identifier = "${local.db_cluster_name}-writer" + instance_class = lookup(local.writer_db_instances.master, "instance_class", "db.t4g.medium") + engine = "mysql" + engine_version = local.version + db_name = lookup(local.advanced_rds_mysql, "db_name", "") + family = "mysql${local.version}" + subnet_ids = var.inputs.network_details.attributes.legacy_outputs.vpc_details.private_subnet_objects.id + major_engine_version = local.version + storage_encrypted = lookup(local.advanced_rds_mysql, "storage_encrypted", true) + allocated_storage = local.allocated_storage + max_allocated_storage = local.max_allocated_storage + storage_type = local.storage_type + iops = local.iops + username = lookup(local.advanced_rds_mysql, "username", "root") + monitoring_interval = lookup(local.advanced_rds_mysql, "monitoring_interval", 10) + password = module.mysql-password.result + port = 3306 + create_db_subnet_group = true + multi_az = local.multi_az + availability_zone = local.availability_zone + domain_iam_role_name = lookup(local.advanced_rds_mysql, "domain_iam_role_name", null) + vpc_security_group_ids = [module.mysql_security_group.security_group_id] + monitoring_role_name = "${local.db_cluster_name}-writer-monitoring-role" + create_monitoring_role = true + backup_retention_period = lookup(local.advanced_rds_mysql, "backup_retention_period", 1) + deletion_protection = lookup(local.advanced_rds_mysql, "deletion_protection", false) + skip_final_snapshot = lookup(local.advanced_rds_mysql, "skip_final_snapshot", true) + maintenance_window = lookup(local.advanced_rds_mysql, "maintenance_window", "sun:01:00-sun:02:00") + backup_window = lookup(local.advanced_rds_mysql, "backup_window", "03:00-06:00") + snapshot_identifier = lookup(local.advanced_rds_mysql, "snapshot_identifier", null) + s3_import = lookup(local.advanced_rds_mysql, "s3_import", null) + tags = local.tags + db_instance_tags = lookup(local.advanced_rds_mysql, "db_instance_tags", {}) + options = lookup(local.advanced_rds_mysql, "options", []) + enabled_cloudwatch_logs_exports = lookup(local.advanced_rds_mysql, "enabled_cloudwatch_logs_exports", ["general"]) + performance_insights_enabled = lookup(local.advanced_rds_mysql, "performance_insights_enabled", false) + performance_insights_retention_period = lookup(local.advanced_rds_mysql, "performance_insights_retention_period", 7) + create_random_password = false + create_cloudwatch_log_group = lookup(local.advanced_rds_mysql, "create_cloudwatch_log_group", true) + parameters = local.writer_db_parameter_group_parameters + parameter_group_name = lookup(local.advanced_rds_mysql, "parameter_group_name", null) + apply_immediately = lookup(var.instance.spec, "apply_immediately", false) + timeouts = { + create = "120m" + delete = "60m" + update = "60m" + } +} + +module "rds-mysql-replica" { + for_each = local.reader_db_instances + replicate_source_db = module.rds-mysql-master.db_instance_id + source = "./terraform-aws-rds-master" + identifier = "${local.db_cluster_name}-${each.key}" + instance_class = lookup(local.reader_db_instances["${each.key}"], "instance_class", "db.t4g.medium") + engine = "mysql" + engine_version = local.version + family = "mysql${local.version}" + subnet_ids = var.inputs.network_details.attributes.legacy_outputs.vpc_details.private_subnet_objects.id + major_engine_version = local.version + storage_encrypted = lookup(local.advanced_rds_mysql, "storage_encrypted", true) + iops = local.iops + # allocated_storage = lookup(local.advanced_rds_mysql, "allocated_storage", 20) + max_allocated_storage = local.max_allocated_storage + storage_type = local.storage_type + username = lookup(local.advanced_rds_mysql, "username", "root") + monitoring_interval = lookup(local.advanced_rds_mysql, "monitoring_interval", 10) + password = module.mysql-password.result + port = 3306 + create_db_subnet_group = false + multi_az = local.multi_az + availability_zone = local.availability_zone + domain_iam_role_name = lookup(local.advanced_rds_mysql, "domain_iam_role_name", null) + vpc_security_group_ids = [module.mysql_security_group.security_group_id] + monitoring_role_name = "${local.db_cluster_name}-reader-${each.key}-monitoring-role" + create_monitoring_role = true + backup_retention_period = lookup(local.advanced_rds_mysql, "backup_retention_period", 0) + deletion_protection = lookup(local.advanced_rds_mysql, "deletion_protection", false) + skip_final_snapshot = lookup(local.advanced_rds_mysql, "skip_final_snapshot", true) + maintenance_window = lookup(local.advanced_rds_mysql, "maintenance_window", "sun:01:00-sun:02:00") + backup_window = lookup(local.advanced_rds_mysql, "backup_window", "03:00-06:00") + snapshot_identifier = lookup(local.advanced_rds_mysql, "snapshot_identifier", null) + s3_import = lookup(local.advanced_rds_mysql, "s3_import", null) + tags = local.tags + db_instance_tags = lookup(local.advanced_rds_mysql, "db_instance_tags", {}) + options = lookup(local.advanced_rds_mysql, "options", []) + enabled_cloudwatch_logs_exports = lookup(local.advanced_rds_mysql, "enabled_cloudwatch_logs_exports", ["general"]) + performance_insights_enabled = lookup(local.advanced_rds_mysql, "performance_insights_enabled", false) + performance_insights_retention_period = lookup(local.advanced_rds_mysql, "performance_insights_retention_period", 7) + create_random_password = false + create_cloudwatch_log_group = lookup(local.advanced_rds_mysql, "create_cloudwatch_log_group", true) + parameter_group_name = lookup(local.advanced_rds_mysql, "parameter_group_name", null) + parameters = local.reader_db_parameter_group_parameters + apply_immediately = lookup(var.instance.spec, "apply_immediately", false) + timeouts = { + create = "120m" + delete = "60m" + update = "60m" + } +} + + + +module "mysql-root-password" { + source = "./generate_resource_details" + name = "Basic Authentication Password for Mysql RDS" + value = module.mysql-password.result + resource_type = "Databases" + resource_name = local.db_cluster_name + key = "DB-Name: ${local.db_cluster_name}" +} diff --git a/modules/mysql/rds/0.1/outputs.tf b/modules/mysql/rds/0.1/outputs.tf new file mode 100644 index 000000000..e2ba0bbc8 --- /dev/null +++ b/modules/mysql/rds/0.1/outputs.tf @@ -0,0 +1,99 @@ +locals { + writer_hostname = split(":", module.rds-mysql-master.db_instance_endpoint)[0] + # reader_hostname = split(":", module.rds-mysql-replica["replica-0"].db_instance_endpoint)[0] + writer_dbs = { + "writer-0" = { + name = module.rds-mysql-master.db_instance_id + host = local.writer_hostname + username = module.rds-mysql-master.db_instance_username + password = module.rds-mysql-master.db_instance_password + port = module.rds-mysql-master.db_instance_port + } + } + + reader_dbs = local.reader_count > 0 ? { + for index in range(local.reader_count) : + "reader-${index}" => { + name = module.rds-mysql-replica["replica-${index}"].db_instance_id + host = split(":", module.rds-mysql-replica["replica-${index}"].db_instance_endpoint)[0] + username = module.rds-mysql-replica["replica-${index}"].db_instance_username + password = module.rds-mysql-replica["replica-${index}"].db_instance_password + port = module.rds-mysql-replica["replica-${index}"].db_instance_port + } + } : {} + + output_interfaces = { + "writer" = { + host = local.writer_hostname + username = module.rds-mysql-master.db_instance_username + password = sensitive(module.rds-mysql-master.db_instance_password) + port = module.rds-mysql-master.db_instance_port + connection_string = sensitive("mysql://${module.rds-mysql-master.db_instance_username}:${module.rds-mysql-master.db_instance_password}@${local.writer_hostname}:${module.rds-mysql-master.db_instance_port}/") + name = "writer" + secrets = ["password", "connection_string"] + } + "reader" = local.reader_count > 0 ? { + host = split(":", module.rds-mysql-replica["replica-0"].db_instance_endpoint)[0] + username = module.rds-mysql-replica["replica-0"].db_instance_username + password = sensitive(module.rds-mysql-replica["replica-0"].db_instance_password) + port = module.rds-mysql-replica["replica-0"].db_instance_port + connection_string = sensitive("mysql://${module.rds-mysql-master.db_instance_username}:${module.rds-mysql-master.db_instance_password}@${split(":", module.rds-mysql-replica["replica-0"].db_instance_endpoint)[0]}:${module.rds-mysql-replica["replica-0"].db_instance_port}/") + secrets = ["password", "connection_string"] + name = "reader" + } : { + host = local.writer_hostname + username = module.rds-mysql-master.db_instance_username + password = sensitive(module.rds-mysql-master.db_instance_password) + port = module.rds-mysql-master.db_instance_port + connection_string = sensitive("mysql://${module.rds-mysql-master.db_instance_username}:${module.rds-mysql-master.db_instance_password}@${local.writer_hostname}:${module.rds-mysql-master.db_instance_port}/") + secrets = ["password", "connection_string"] + name = "writer" + } + } + + output_attributes = { + resource_type = "mysql" + resource_name = var.instance_name + instances = merge(local.writer_dbs, local.reader_dbs) + secrets = ["instances"] + } +} + +output "instances" { + value = tomap(merge(local.writer_dbs, local.reader_dbs)) + # sensitive = true +} + +# For old module compatibility + +output "writer_host" { + value = local.writer_hostname +} +output "writer_port" { + value = module.rds-mysql-master.db_instance_port +} +output "writer_username" { + value = module.rds-mysql-master.db_instance_username + # sensitive = true +} +output "writer_password" { + value = module.rds-mysql-master.db_instance_password + # sensitive = true +} +output "writer_connection_string" { + value = "mysql://${local.writer_hostname}:${module.rds-mysql-master.db_instance_port}/" +} +output "reader_host" { + value = local.reader_count > 0 ? split(":", module.rds-mysql-replica["replica-0"].db_instance_endpoint)[0] : null +} +output "reader_port" { + value = local.reader_count > 0 ? module.rds-mysql-replica["replica-0"].db_instance_port : null +} +output "reader_username" { + value = local.reader_count > 0 ? module.rds-mysql-replica["replica-0"].db_instance_username : null + # sensitive = true +} +output "reader_password" { + value = local.reader_count > 0 ? module.rds-mysql-replica["replica-0"].db_instance_password : null + # sensitive = true +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/.editorconfig b/modules/mysql/rds/0.1/terraform-aws-rds-master/.editorconfig new file mode 100644 index 000000000..88cb25190 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/.editorconfig @@ -0,0 +1,30 @@ +# EditorConfig is awesome: http://EditorConfig.org +# Uses editorconfig to maintain consistent coding styles + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +max_line_length = 80 +trim_trailing_whitespace = true + +[*.{tf,tfvars}] +indent_size = 2 +indent_style = space + +[*.md] +max_line_length = 0 +trim_trailing_whitespace = false + +[Makefile] +tab_width = 2 +indent_style = tab + +[COMMIT_EDITMSG] +max_line_length = 0 diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/lock.yml b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/lock.yml new file mode 100644 index 000000000..d887a660f --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/lock.yml @@ -0,0 +1,21 @@ +name: 'Lock Threads' + +on: + schedule: + - cron: '50 1 * * *' + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + issue-comment: > + I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. + If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. + issue-inactive-days: '30' + pr-comment: > + I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. + If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. + pr-inactive-days: '30' diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/pr-title.yml b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/pr-title.yml new file mode 100644 index 000000000..cb32a0f81 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/pr-title.yml @@ -0,0 +1,52 @@ +name: 'Validate PR title' + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + # Please look up the latest version from + # https://github.com/amannn/action-semantic-pull-request/releases + - uses: amannn/action-semantic-pull-request@v5.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Configure which types are allowed. + # Default: https://github.com/commitizen/conventional-commit-types + types: | + fix + feat + docs + ci + chore + # Configure that a scope must always be provided. + requireScope: false + # Configure additional validation for the subject based on a regex. + # This example ensures the subject starts with an uppercase character. + subjectPattern: ^[A-Z].+$ + # If `subjectPattern` is configured, you can use this property to override + # the default error message that is shown when the pattern doesn't match. + # The variables `subject` and `title` can be used within the message. + subjectPatternError: | + The subject "{subject}" found in the pull request title "{title}" + didn't match the configured pattern. Please ensure that the subject + starts with an uppercase character. + # For work-in-progress PRs you can typically use draft pull requests + # from Github. However, private repositories on the free plan don't have + # this option and therefore this action allows you to opt-in to using the + # special "[WIP]" prefix to indicate this state. This will avoid the + # validation of the PR title and the pull request checks remain pending. + # Note that a second check will be reported if this is enabled. + wip: true + # When using "Squash and merge" on a PR with only one commit, GitHub + # will suggest using that commit message instead of the PR title for the + # merge commit, and it's easy to commit this by mistake. Enable this option + # to also validate the commit message for one commit PRs. + validateSingleCommit: false diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/pre-commit.yml b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..cb8267134 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/pre-commit.yml @@ -0,0 +1,83 @@ +name: Pre-Commit + +on: + pull_request: + branches: + - main + - master + +env: + TERRAFORM_DOCS_VERSION: v0.16.0 + TFLINT_VERSION: v0.44.1 + +jobs: + collectInputs: + name: Collect workflow inputs + runs-on: ubuntu-latest + outputs: + directories: ${{ steps.dirs.outputs.directories }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get root directories + id: dirs + uses: clowdhaus/terraform-composite-actions/directories@v1.8.3 + + preCommitMinVersions: + name: Min TF pre-commit + needs: collectInputs + runs-on: ubuntu-latest + strategy: + matrix: + directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Terraform min/max versions + id: minMax + uses: clowdhaus/terraform-min-max@v1.2.4 + with: + directory: ${{ matrix.directory }} + + - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} + # Run only validate pre-commit check on min version supported + if: ${{ matrix.directory != '.' }} + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 + with: + terraform-version: ${{ steps.minMax.outputs.minVersion }} + tflint-version: ${{ env.TFLINT_VERSION }} + args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' + + - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} + # Run only validate pre-commit check on min version supported + if: ${{ matrix.directory == '.' }} + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 + with: + terraform-version: ${{ steps.minMax.outputs.minVersion }} + tflint-version: ${{ env.TFLINT_VERSION }} + args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)' + + preCommitMaxVersion: + name: Max TF pre-commit + runs-on: ubuntu-latest + needs: collectInputs + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{github.event.pull_request.head.repo.full_name}} + + - name: Terraform min/max versions + id: minMax + uses: clowdhaus/terraform-min-max@v1.2.4 + + - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 + with: + terraform-version: ${{ steps.minMax.outputs.maxVersion }} + tflint-version: ${{ env.TFLINT_VERSION }} + terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }} + install-hcledit: true diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/release.yml b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/release.yml new file mode 100644 index 000000000..d2556e081 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + workflow_dispatch: + push: + branches: + - master + paths: + - '**/*.tpl' + - '**/*.py' + - '**/*.tf' + - '.github/workflows/release.yml' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + # Skip running release workflow on forks + if: github.repository_owner == 'terraform-aws-modules' + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Release + uses: cycjimmy/semantic-release-action@v2 + with: + semantic_version: 18.0.0 + extra_plugins: | + @semantic-release/changelog@6.0.0 + @semantic-release/git@10.0.0 + conventional-changelog-conventionalcommits@4.6.3 + env: + GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/stale-actions.yaml b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/stale-actions.yaml new file mode 100644 index 000000000..50379957f --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/.github/workflows/stale-actions.yaml @@ -0,0 +1,32 @@ +name: 'Mark or close stale issues and PRs' +on: + schedule: + - cron: '0 0 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + # Staling issues and PR's + days-before-stale: 30 + stale-issue-label: stale + stale-pr-label: stale + stale-issue-message: | + This issue has been automatically marked as stale because it has been open 30 days + with no activity. Remove stale label or comment or this issue will be closed in 10 days + stale-pr-message: | + This PR has been automatically marked as stale because it has been open 30 days + with no activity. Remove stale label or comment or this PR will be closed in 10 days + # Not stale if have this labels or part of milestone + exempt-issue-labels: bug,wip,on-hold + exempt-pr-labels: bug,wip,on-hold + exempt-all-milestones: true + # Close issue operations + # Label will be automatically removed if the issues are no longer closed nor locked. + days-before-close: 10 + delete-branch: true + close-issue-message: This issue was automatically closed because of stale in 10 days + close-pr-message: This PR was automatically closed because of stale in 10 days diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/.gitignore b/modules/mysql/rds/0.1/terraform-aws-rds-master/.gitignore new file mode 100644 index 000000000..397af3228 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/.gitignore @@ -0,0 +1,29 @@ +# Local .terraform directories +**/.terraform/* + +# Terraform lockfile +.terraform.lock.hcl + +# .tfstate files +*.tfstate +*.tfstate.* + +# Crash log files +crash.log + +# Exclude all .tfvars files, which are likely to contain sentitive data, such as +# password, private keys, and other secrets. These should not be part of version +# control as they are data points which are potentially sensitive and subject +# to change depending on the environment. +*.tfvars + +# Ignore override files as they are usually used to override resources locally and so +# are not checked in +override.tf +override.tf.json +*_override.tf +*_override.tf.json + +# Ignore CLI configuration files +.terraformrc +terraform.rc diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/.pre-commit-config.yaml b/modules/mysql/rds/0.1/terraform-aws-rds-master/.pre-commit-config.yaml new file mode 100644 index 000000000..d5886a6d3 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +repos: + - repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.77.0 + hooks: + - id: terraform_fmt + - id: terraform_validate + - id: terraform_docs + args: + - '--args=--lockfile=false' + - id: terraform_tflint + args: + - '--args=--only=terraform_deprecated_interpolation' + - '--args=--only=terraform_deprecated_index' + - '--args=--only=terraform_unused_declarations' + - '--args=--only=terraform_comment_syntax' + - '--args=--only=terraform_documented_outputs' + - '--args=--only=terraform_documented_variables' + - '--args=--only=terraform_typed_variables' + - '--args=--only=terraform_module_pinned_source' + - '--args=--only=terraform_naming_convention' + - '--args=--only=terraform_required_version' + - '--args=--only=terraform_required_providers' + - '--args=--only=terraform_standard_module_structure' + - '--args=--only=terraform_workspace_remote' + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-merge-conflict + - id: end-of-file-fixer diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/.releaserc.json b/modules/mysql/rds/0.1/terraform-aws-rds-master/.releaserc.json new file mode 100644 index 000000000..66b3eefd6 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/.releaserc.json @@ -0,0 +1,45 @@ +{ + "branches": [ + "main", + "master" + ], + "ci": false, + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/github", + { + "successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:", + "labels": false, + "releasedLabels": false + } + ], + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md", + "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file." + } + ], + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md" + ], + "message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/CHANGELOG.md b/modules/mysql/rds/0.1/terraform-aws-rds-master/CHANGELOG.md new file mode 100644 index 000000000..f57e3cf6c --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/CHANGELOG.md @@ -0,0 +1,999 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +### [5.2.3](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v5.2.2...v5.2.3) (2023-01-03) + + +### Bug Fixes + +* Ensure that passing values for option group with PostgreSQL does not cause errors ([#467](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/467)) ([696acbb](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/696acbb237352988562f78b30897f29cfe8da58a)) + +### [5.2.2](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v5.2.1...v5.2.2) (2022-12-20) + + +### Bug Fixes + +* Default value of iops in main module ([#462](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/462)) ([d84b4b4](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/d84b4b4b4184cf2a32cf313b4fe294590cbdcd12)) + +### [5.2.1](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v5.2.0...v5.2.1) (2022-12-14) + + +### Bug Fixes + +* Change RDS variable `iops` default value from `0` to `null` ([#456](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/456)) ([9c8d21f](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/9c8d21fc07d798203b1e96fa893e68d1fa04058e)) + +## [5.2.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v5.1.1...v5.2.0) (2022-12-05) + + +### Features + +* Add support for `storage_throughput` ([#453](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/453)) ([d81bf1f](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/d81bf1f351be2d4939f7aae4625f20cc047de7a5)) + +### [5.1.1](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v5.1.0...v5.1.1) (2022-11-12) + + +### Bug Fixes + +* Update CI configuration files to use latest version ([#438](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/438)) ([113a08b](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/113a08b0d4972b953b105879a487c71c9a542b3c)) + +## [5.1.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v5.0.3...v5.1.0) (2022-09-11) + + +### Features + +* Add support for `network_type` ([#431](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/431)) ([a277924](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/a27792484f9634462827baf2feb663a8800e2ce4)) + +### [5.0.3](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v5.0.2...v5.0.3) (2022-08-15) + + +### Bug Fixes + +* Fixed example of cross-region replica where KMS key was missing ([#428](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/428)) ([88418a7](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/88418a71bb6338cc176858cea926fade3a4eb6f8)) + +### [5.0.2](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v5.0.1...v5.0.2) (2022-08-11) + + +### Bug Fixes + +* Replace deprecated name property in outputs ([#426](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/426)) ([c6e87d1](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/c6e87d1c47b0b556000719a969dd8ab62322085e)) + +### [5.0.1](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v5.0.0...v5.0.1) (2022-07-25) + + +### Bug Fixes + +* Cloudwatch Log Group deletion db_instance dependency ([#423](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/423)) ([e6351a3](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/e6351a3f2bc57db305be68c78cfdce65bbb82aaf)) + +## [5.0.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.7.0...v5.0.0) (2022-07-21) + + +### ⚠ BREAKING CHANGES + +* Update Terraform and provider versions to v1.x and v4.x, mark password input as sensitive (#420) + +### Features + +* Update Terraform and provider versions to v1.x and v4.x, mark password input as sensitive ([#420](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/420)) ([808407d](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/808407dfb4944ca2701d3c9d25d8f4347238dddd)) + +## [4.7.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.6.0...v4.7.0) (2022-07-14) + + +### Features + +* Add support for `aws_db_instance_automated_backups_replication` ([#413](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/413)) ([f1e15a1](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/f1e15a16a30fa291a33ff9719cc72687124e96d0)) + +## [4.6.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.5.0...v4.6.0) (2022-07-13) + + +### Features + +* Support `name_prefix` in `iam_role.enhanced_monitoring` ([#418](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/418)) ([644d255](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/644d25528017bc6a7d0c73fbb9b91243ff51933b)) + +## [4.5.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.4.0...v4.5.0) (2022-07-06) + + +### Features + +* Add support for `identifier_prefix` ([#416](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/416)) ([125c426](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/125c426fc00cd1f2744189a30f9225778169cefb)) + +## [4.4.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.3.0...v4.4.0) (2022-05-27) + + +### Features + +* Add `engine` and `engine_version_actual` outputs ([#404](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/404)) ([00b9858](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/00b98589d2e8e37a24118887241d74d2b8d0715c)) + +## [4.3.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.2.0...v4.3.0) (2022-04-27) + + +### Features + +* Support `source_db_instance_automated_backups_arn` parameter in `restore_to_point_in_time` block ([#398](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/398)) ([559e6b1](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/559e6b11b76b428e8752e094366c36bea2c2c298)) + +## [4.2.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.1.3...v4.2.0) (2022-03-12) + + +### Features + +* Made it clear that we stand with Ukraine ([e8dfedb](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/e8dfedb8792dce34cd029fa46cf1bf071cfc7faa)) + +### [4.1.3](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.1.2...v4.1.3) (2022-02-23) + + +### Bug Fixes + +* Correct random password lifecycle by eagerly creating random password value ([#388](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/388)) ([b41a0a5](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/b41a0a5ef6d3b8ee590ec22507c3af85df985521)) + +### [4.1.2](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.1.1...v4.1.2) (2022-02-18) + + +### Bug Fixes + +* Correct usage of `password` and allow restored snapshots to set password, username, etc. ([#384](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/384)) ([81db512](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/81db51292cbbb1a23b3649814691498514fbd273)) + +### [4.1.1](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.1.0...v4.1.1) (2022-02-17) + + +### Bug Fixes + +* Remove check for `is_mssql` which is no longer valid ([#382](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/382)) ([f4481e6](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/f4481e6f4c21452840627b8cd229753229c04e5c)) + +## [4.1.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v4.0.0...v4.1.0) (2022-02-17) + + +### Features + +* Add support for managing CloudWatch log groups ([#380](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/380)) ([761fb7f](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/761fb7f5b8d7bb8ae99c54d8fa143c40d0772c0a)) + +## [4.0.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v3.5.0...v4.0.0) (2022-02-16) + + +### ⚠ BREAKING CHANGES + +* Update default values for security posture improvement (#369) + +### Features + +* Update default values for security posture improvement ([#369](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/369)) ([9149ec1](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/9149ec147327fbe5a7675ac48e9e641b5d7ec6e1)) + +## [3.5.0](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v3.4.2...v3.5.0) (2022-01-12) + + +### Features + +* Added `latest_restorable_time` to ignore_changes ([#356](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/356)) ([77902c2](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/77902c21414f24026d720e72068e589b3855fab8)) + +### [3.4.2](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v3.4.1...v3.4.2) (2022-01-10) + + +### Bug Fixes + +* update CI/CD process to align auto-release workflow ([#366](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/366)) ([e38aace](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/e38aaced17278567973dad4980fae8757d6a1265)) + +# Changelog + +All notable changes to this project will be documented in this file + +## [3.4.1](https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v3.4.0...v3.4.1) (2021-11-07) + + +### Bug Fixes + +* update CI/CD process to use composite actions and auto-release workflow ([#361](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/361)) ([123ea2a](https://github.com/terraform-aws-modules/terraform-aws-rds/commit/123ea2a136c913de0588d4820b291eb4d1d74d61)) + + +## [v3.4.0] - 2021-09-07 + +- feat: Add new parameter monitoring_role_description ([#350](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/350)) +- docs: create_option_group -> create_db_option_group in README ([#348](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/348)) + + + +## [v3.3.0] - 2021-07-07 + +- feat: allow the creation of cross-region rds replicas ([#346](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/346)) + + + +## [v3.2.0] - 2021-06-28 + +- feat: Add restore_to_point_in_time support for databases ([#338](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/338)) + + + +## [v3.1.0] - 2021-05-26 + +- fix: add default values to allow for completely disabling module with bare minimum input ([#342](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/342)) +- chore: Update README.md to current version ([#339](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/339)) +- chore: update CI/CD to use stable `terraform-docs` release artifact and discoverable Apache2.0 license ([#332](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/332)) +- chore: Updated versions&comments in examples + + + +## [v3.0.0] - 2021-04-26 + +- feat: Shorten outputs (removing this_) ([#330](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/330)) + + + +## [v2.35.0] - 2021-04-24 + +- fix: mark sensitive outputs to support Terraform 0.15.x ([#329](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/329)) +- chore: update documentation and pin `terraform_docs` version to avoid future changes ([#323](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/323)) + + + +## [v2.34.0] - 2021-03-19 + +- feat: Support different tags per resource ([#319](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/319)) + + + +## [v2.33.0] - 2021-03-18 + +- fix: correct monitoring role ARN lookup ([#318](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/318)) + + + +## [v2.32.0] - 2021-03-18 + +- feat: support for random password ([#306](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/306)) + + + +## [v2.31.0] - 2021-03-16 + +- chore: correct examples and scenario where replicas are used ([#317](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/317)) + + + +## [v2.30.0] - 2021-03-15 + +- chore: remove default values and replace with null to use upstream default settings ([#315](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/315)) + + + +## [v2.29.0] - 2021-03-14 + +- fix: set snapshot identifier and backup retention period to null to default to AWS provider settings ([#314](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/314)) +- chore: Use utf8mb4 in mysql examples ([#313](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/313)) + + + +## [v2.28.0] - 2021-03-14 + +- fix: update subnet group to fix name vs name_prefix ([#312](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/312)) + + + +## [v2.27.0] - 2021-03-11 + +- feat: Add support for character_set_name with MSSQL Server ([#281](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/281)) + + + +## [v2.26.0] - 2021-03-10 + +- fix: default to AWS provided option and parameter groups when not creating nor providing ([#308](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/308)) + + + +## [v2.25.0] - 2021-03-09 + +- fix: update parameter group to fix name vs. name_prefix ([#304](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/304)) + + + +## [v2.24.0] - 2021-03-08 + +- fix: update option group to fix name vs. name_prefix and conditional creation for postgresql ([#302](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/302)) +- chore: update README.md documentation ([#300](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/300)) + + + +## [v2.23.0] - 2021-03-08 + +- chore: update example projects ([#298](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/298)) +- chore: align ci-cd static checks to use individual minimum Terraform versions ([#297](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/297)) + + + +## [v2.22.0] - 2021-03-01 + +- feat: Add support for performance_insights_kms_key_id ([#253](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/253)) + + + +## [v2.21.0] - 2021-02-22 + +- feat: add S3 import functionality which is supported for MySQL instances ([#289](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/289)) +- chore: add `terraform_validate` hook to pre-commit checks ([#293](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/293)) +- chore: add ci-cd workflow for pre-commit checks ([#292](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/292)) +- chore: update documentation based on latest `terraform-docs` which includes module and resource sections ([#288](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/288)) +- fix: documentation for default storage type ([#277](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/277)) + + + +## [v2.20.0] - 2020-10-15 + +- fix: Added possibility to specify partition used in iam role policy attachment ([#256](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/256)) + + + +## [v2.19.0] - 2020-10-15 + +- fix: Added tflint and fixes in README ([#265](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/265)) +- docs: Change accound to account ([#261](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/261)) + + + +## [v2.18.0] - 2020-08-13 + +- feat: Bump version of AWS provider to support v3 + + + +## [v2.17.0] - 2020-07-20 + +- Upgraded Terraform version supported +- feat: add Windows authentication ([#177](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/177)) + + + +## [v2.16.0] - 2020-06-13 + +- feat: add handling for delete_automated_backups flag ([#215](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/215)) + + + +## [v2.15.0] - 2020-05-13 + +- fix: Update minimum provider version to account for ca_cert_identifier ([#226](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/226)) +- Updated pre-commit-terraform +- Updated pre-commit-terraform +- Updated pre-commit-terraform +- Fix / CA Cert Instance Default ([#189](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/189)) +- Added delete timeout for db_option_group ([#186](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/186)) +- Fix for issue when MonitoringRoleARN is required ([#143](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/143)) +- Fix `enable_create_db_option_group` to use override first & computed second ([#170](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/170)) +- Add outputs for the monitoring role arn ([#181](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/181)) +- Update CA Certificate identifier default to 'rds-ca-2019' ([#182](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/182)) +- Mark password as sensitive (closes [#98](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/98)) +- Added ca_cert_identifier to outputs +- Updated formatting after PR [#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174) +- Add support for ca_cert_identifier option ([#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174)) +- Disable perf insights ret period when disabled ([#153](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/153)) +- Update documentation a bit after merge +- Add support for performance insights retention period ([#147](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/147)) +- Update documentation a bit after merge +- Support for max_allocated_storage ([#146](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/146)) +- Added performance_insights support ([#139](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/139)) +- Updated pre-commit +- Fixed variable default for parameters ([#138](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/138)) +- Upgraded module to support Terraform 0.12 ([#126](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/126)) + + + +## [v1.37.0] - 2020-02-21 + +- Updated pre-commit hooks +- Set ca_cert_identifier default for internal module ([#196](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/196)) +- Added delete timeout for db_option_group ([#187](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/187)) +- Fix for issue when MonitoringRoleARN is required ([#140](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/140)) +- Fixed default value for CA certificate identifier ([#183](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/183)) +- Updated formatting after PR [#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175) +- Add support for ca_cert_identifier option ([#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175)) +- Fix formatting for 0.11.14 ([#161](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/161)) +- feat(storage): added support for max_allocated_storage ([#155](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/155)) +- Use boolean value in condition ([#148](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/148)) +- Update documentation a bit after merge +- Use false instead of 0 in enable_create_db_option_group flag ([#137](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/137)) +- Add support of performance_insights_enabled ([#132](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/132)) +- Use false instead of 0 in enable_create_db_option_group flag + + + +## [v2.14.0] - 2020-02-10 + +- Updated pre-commit-terraform +- Updated pre-commit-terraform +- Fix / CA Cert Instance Default ([#189](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/189)) +- Added delete timeout for db_option_group ([#186](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/186)) +- Fix for issue when MonitoringRoleARN is required ([#143](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/143)) +- Fix `enable_create_db_option_group` to use override first & computed second ([#170](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/170)) +- Add outputs for the monitoring role arn ([#181](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/181)) +- Update CA Certificate identifier default to 'rds-ca-2019' ([#182](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/182)) +- Mark password as sensitive (closes [#98](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/98)) +- Added ca_cert_identifier to outputs +- Updated formatting after PR [#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174) +- Add support for ca_cert_identifier option ([#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174)) +- Disable perf insights ret period when disabled ([#153](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/153)) +- Update documentation a bit after merge +- Add support for performance insights retention period ([#147](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/147)) +- Update documentation a bit after merge +- Support for max_allocated_storage ([#146](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/146)) +- Added performance_insights support ([#139](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/139)) +- Updated pre-commit +- Fixed variable default for parameters ([#138](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/138)) +- Upgraded module to support Terraform 0.12 ([#126](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/126)) + + + +## [v1.36.0] - 2020-01-09 + +- Added delete timeout for db_option_group ([#187](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/187)) +- Fix for issue when MonitoringRoleARN is required ([#140](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/140)) +- Fixed default value for CA certificate identifier ([#183](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/183)) +- Updated formatting after PR [#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175) +- Add support for ca_cert_identifier option ([#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175)) +- Fix formatting for 0.11.14 ([#161](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/161)) +- feat(storage): added support for max_allocated_storage ([#155](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/155)) +- Use boolean value in condition ([#148](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/148)) +- Update documentation a bit after merge +- Use false instead of 0 in enable_create_db_option_group flag ([#137](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/137)) +- Add support of performance_insights_enabled ([#132](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/132)) +- Use false instead of 0 in enable_create_db_option_group flag + + + +## [v2.13.0] - 2020-01-09 + +- Added delete timeout for db_option_group ([#186](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/186)) +- Fix for issue when MonitoringRoleARN is required ([#143](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/143)) +- Fix `enable_create_db_option_group` to use override first & computed second ([#170](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/170)) +- Add outputs for the monitoring role arn ([#181](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/181)) +- Update CA Certificate identifier default to 'rds-ca-2019' ([#182](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/182)) +- Mark password as sensitive (closes [#98](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/98)) +- Added ca_cert_identifier to outputs +- Updated formatting after PR [#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174) +- Add support for ca_cert_identifier option ([#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174)) +- Disable perf insights ret period when disabled ([#153](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/153)) +- Update documentation a bit after merge +- Add support for performance insights retention period ([#147](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/147)) +- Update documentation a bit after merge +- Support for max_allocated_storage ([#146](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/146)) +- Added performance_insights support ([#139](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/139)) +- Updated pre-commit +- Fixed variable default for parameters ([#138](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/138)) +- Upgraded module to support Terraform 0.12 ([#126](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/126)) + + + +## [v1.35.0] - 2020-01-07 + +- Fix for issue when MonitoringRoleARN is required ([#140](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/140)) +- Fixed default value for CA certificate identifier ([#183](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/183)) +- Updated formatting after PR [#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175) +- Add support for ca_cert_identifier option ([#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175)) +- Fix formatting for 0.11.14 ([#161](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/161)) +- feat(storage): added support for max_allocated_storage ([#155](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/155)) +- Use boolean value in condition ([#148](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/148)) +- Update documentation a bit after merge +- Use false instead of 0 in enable_create_db_option_group flag ([#137](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/137)) +- Add support of performance_insights_enabled ([#132](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/132)) +- Use false instead of 0 in enable_create_db_option_group flag + + + +## [v2.12.0] - 2020-01-07 + +- Fix for issue when MonitoringRoleARN is required ([#143](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/143)) +- Fix `enable_create_db_option_group` to use override first & computed second ([#170](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/170)) +- Add outputs for the monitoring role arn ([#181](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/181)) +- Update CA Certificate identifier default to 'rds-ca-2019' ([#182](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/182)) +- Mark password as sensitive (closes [#98](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/98)) +- Added ca_cert_identifier to outputs +- Updated formatting after PR [#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174) +- Add support for ca_cert_identifier option ([#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174)) +- Disable perf insights ret period when disabled ([#153](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/153)) +- Update documentation a bit after merge +- Add support for performance insights retention period ([#147](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/147)) +- Update documentation a bit after merge +- Support for max_allocated_storage ([#146](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/146)) +- Added performance_insights support ([#139](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/139)) +- Updated pre-commit +- Fixed variable default for parameters ([#138](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/138)) +- Upgraded module to support Terraform 0.12 ([#126](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/126)) + + + +## [v1.34.0] - 2020-01-07 + +- Fixed default value for CA certificate identifier ([#183](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/183)) +- Updated formatting after PR [#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175) +- Add support for ca_cert_identifier option ([#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175)) +- Fix formatting for 0.11.14 ([#161](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/161)) +- feat(storage): added support for max_allocated_storage ([#155](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/155)) +- Use boolean value in condition ([#148](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/148)) +- Update documentation a bit after merge +- Use false instead of 0 in enable_create_db_option_group flag ([#137](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/137)) +- Add support of performance_insights_enabled ([#132](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/132)) +- Use false instead of 0 in enable_create_db_option_group flag + + + +## [v2.11.0] - 2020-01-07 + +- Fix `enable_create_db_option_group` to use override first & computed second ([#170](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/170)) + + + +## [v2.10.0] - 2020-01-07 + +- Add outputs for the monitoring role arn ([#181](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/181)) + + + +## [v2.9.0] - 2020-01-07 + +- Update CA Certificate identifier default to 'rds-ca-2019' ([#182](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/182)) + + + +## [v2.8.0] - 2019-12-20 + +- Mark password as sensitive (closes [#98](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/98)) + + + +## [v2.7.0] - 2019-12-20 + +- Added ca_cert_identifier to outputs + + + +## [v2.6.0] - 2019-12-20 + +- Updated formatting after PR [#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174) +- Add support for ca_cert_identifier option ([#174](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/174)) +- Disable perf insights ret period when disabled ([#153](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/153)) +- Update documentation a bit after merge +- Add support for performance insights retention period ([#147](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/147)) +- Update documentation a bit after merge +- Support for max_allocated_storage ([#146](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/146)) +- Added performance_insights support ([#139](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/139)) +- Updated pre-commit +- Fixed variable default for parameters ([#138](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/138)) +- Upgraded module to support Terraform 0.12 ([#126](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/126)) + + + +## [v1.33.0] - 2019-12-20 + +- Updated formatting after PR [#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175) +- Add support for ca_cert_identifier option ([#175](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/175)) + + + +## [v1.32.0] - 2019-08-27 + +- Fix formatting for 0.11.14 ([#161](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/161)) + + + +## [v1.31.0] - 2019-07-28 + +- feat(storage): added support for max_allocated_storage ([#155](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/155)) +- Use boolean value in condition ([#148](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/148)) +- Update documentation a bit after merge +- Use false instead of 0 in enable_create_db_option_group flag ([#137](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/137)) +- Add support of performance_insights_enabled ([#132](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/132)) +- Use false instead of 0 in enable_create_db_option_group flag + + + +## [v2.5.0] - 2019-07-21 + +- Disable perf insights ret period when disabled ([#153](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/153)) + + + +## [v2.4.0] - 2019-07-17 + +- Update documentation a bit after merge +- Add support for performance insights retention period ([#147](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/147)) +- Update documentation a bit after merge +- Support for max_allocated_storage ([#146](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/146)) +- Added performance_insights support ([#139](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/139)) +- Updated pre-commit +- Fixed variable default for parameters ([#138](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/138)) +- Upgraded module to support Terraform 0.12 ([#126](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/126)) + + + +## [v1.30.0] - 2019-07-17 + +- Use boolean value in condition ([#148](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/148)) +- Update documentation a bit after merge +- Use false instead of 0 in enable_create_db_option_group flag ([#137](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/137)) +- Add support of performance_insights_enabled ([#132](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/132)) +- Use false instead of 0 in enable_create_db_option_group flag + + + +## [v2.3.0] - 2019-07-17 + +- Update documentation a bit after merge +- Support for max_allocated_storage ([#146](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/146)) + + + +## [v2.2.0] - 2019-06-28 + +- Added performance_insights support ([#139](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/139)) +- Updated pre-commit +- Fixed variable default for parameters ([#138](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/138)) +- Upgraded module to support Terraform 0.12 ([#126](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/126)) + + + +## [v1.29.0] - 2019-06-28 + +- Update documentation a bit after merge +- Use false instead of 0 in enable_create_db_option_group flag ([#137](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/137)) +- Add support of performance_insights_enabled ([#132](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/132)) +- Use false instead of 0 in enable_create_db_option_group flag + + + +## [v2.1.0] - 2019-06-28 + +- Updated pre-commit +- Fixed variable default for parameters ([#138](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/138)) + + + +## [v2.0.0] - 2019-06-11 + +- Upgraded module to support Terraform 0.12 ([#126](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/126)) +- Fixed formatting + + + +## [v1.28.0] - 2019-03-29 + +- Updates cloudwatch logs exports for PostgreSQL ([#110](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/110)) + + + +## [v1.27.0] - 2019-03-22 + +- Remove unused submodule output ([#108](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/108)) + + + +## [v1.26.0] - 2019-03-18 + +- allowing custom parameter_group to pass down the stack ([#106](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/106)) + + + +## [v1.25.0] - 2019-03-16 + +- Add tags to enhanced_monitoring iam_role ([#102](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/102)) + + + +## [v1.24.0] - 2019-03-11 + +- Added changelog after changelog feature is added +- Add Changelog ([#100](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/100)) + + + +## [v1.23.0] - 2019-03-10 + +- Allow create of parameter group with custom name ([#99](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/99)) + + + +## [v1.22.0] - 2018-10-06 + +- Fixed documentation after [#83](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/83) +- Add deletion protection argument ([#83](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/83)) +- Sort values of enabled_cloudwatch_logs_exports in example + + + +## [v1.21.0] - 2018-08-18 + +- Added support for enabled cloudwatch logs exports (fixes [#70](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/70)) ([#74](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/74)) + + + +## [v1.20.0] - 2018-08-18 + +- Minor updates after [#64](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/64) ([#73](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/73)) + + + +## [v1.19.0] - 2018-06-20 + +- Updated example to show usage of options group (fixed [#63](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/63)) + + + +## [v1.18.0] - 2018-06-06 + +- Disable creation of db option group for Postgres (fixes [#62](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/62)) + + + +## [v1.17.0] - 2018-06-04 + +- Minor fixes for db_option_group ([#55](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/55)) and prepared release +- Simplified outputs +- Add option group support ([#55](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/55)) +- fixing small spelling mistake ([#61](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/61)) + + + +## [v1.16.0] - 2018-05-16 + +- Added pre-commit hook to autogenerate terraform-docs ([#59](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/59)) + + + +## [v1.15.0] - 2018-04-03 + +- Minor change to mssql example +- MSSQL: Adding two missing arguments for aws_db_instance: timezone & character_set_name ([#51](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/51)) + + + +## [v1.14.0] - 2018-03-14 + +- Updated readme with conditional creatino section +- Enable db_parameter_group_name variable ([#47](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/47)) + + + +## [v1.13.0] - 2018-03-06 + +- Updated examples +- Renamed count to created in submodules ([#44](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/44)) + + + +## [v1.12.0] - 2018-02-15 + +- Added availability_zone to root module ([#40](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/40)) + + + +## [v1.11.0] - 2018-02-09 + +- Enable db_subnet_group_name variable ([#38](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/38)) + + + +## [v1.10.0] - 2018-01-31 + +- Support conditional creation for the database too. ([#36](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/36)) + + + +## [v1.9.0] - 2018-01-30 + +- Make name optional (fixes [#37](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/37)) + + + +## [v1.8.0] - 2018-01-23 + +- Add availability zone to instance ressource module ([#35](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/35)) + + + +## [v1.7.0] - 2018-01-15 + +- Fix enhanced monitoring policy attachment ([#34](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/34)) + + + +## [v1.6.0] - 2017-12-08 + +- Add create_before_destroy to parameter group ([#30](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/30)) + + + +## [v1.5.0] - 2017-12-08 + +- Fixed warning in output (fixes [#32](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/32) and [#31](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/31)) + + + +## [v1.4.0] - 2017-11-16 + +- db_subnet_group: fix failing output expressions ([#22](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/22)) + + + +## [v1.3.0] - 2017-11-13 + +- Automatically create enhanced monitoring role ([#21](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/21)) + + + +## [v1.2.0] - 2017-10-22 + +- Adds support for snapshot_identifier ([#18](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/18)) + + + +## [v1.1.1] - 2017-10-18 + +- Added variable "source_db" for RDS replica option ([#13](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/13)) + + + +## [v1.1.0] - 2017-10-18 + +- Added iam_database_authentication_enabled and license_model model (fixed [#15](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/15) and [#14](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/14)) + + + +## [v1.0.8] - 2017-10-12 + +- Fixed [#12](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/12), final_snapshot_identifier default can't be empty actually + + + +## [v1.0.7] - 2017-10-12 + +- Added skip_final_snapshot=true in module also (remaining from [#3](https://github.com/terraform-aws-modules/terraform-aws-rds/issues/3)) + + + +## [v1.0.6] - 2017-10-12 + +- Set final_snapshot_identifier in Postgres RDS example +- Merge branch 'master' of https://github.com/terraform-aws-modules/terraform-aws-rds +- Updated README.md for MySQL RDS example +- Updated README.md for Postgres RDS example +- fianl-snapshot_identifier should default to nothing +- Add enhanced monitoring example to README, and add current contributors link +- Merge branch 'master' into final_snapshot_identifier +- Updated links using upstream path +- Update README.md +- Added comments for default DB username value +- Added complete example for Postgres RDS +- support final_snapshot_identifier + + + +## [v1.0.4] - 2017-10-11 + + + + +## [v1.0.5] - 2017-10-11 + +- Tweak README.md examples +- Add complete enhanced monitoring example +- Add enhanced monitoring + + + +## [v1.0.3] - 2017-09-28 + +- Set example storage_encrypted value to false +- Removed unused variable +- Improved kms_key_id description +- Cleaned duplicated attributes & variables +- Merge branch 'encryption' of github.com:fmartingr/terraform-aws-rds into encryption +- Added parameters to example +- Added kms_key_id parameter +- Using `encrypted` to set the db_instance.storage_encrypted +- Using `encrypted` to set the db_instance.storage_encrypted + + + +## [v1.0.2] - 2017-09-21 + +- db parameters can now be passed db_parameter_group mode + + + +## [v1.0.1] - 2017-09-14 + +- Added monitoring_interval parameter + + + +## v1.0.0 - 2017-09-13 + +- Updated comment +- Added code for RDS modules +- Initial commit + + +[Unreleased]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v3.4.0...HEAD +[v3.4.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v3.3.0...v3.4.0 +[v3.3.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v3.2.0...v3.3.0 +[v3.2.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v3.1.0...v3.2.0 +[v3.1.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v3.0.0...v3.1.0 +[v3.0.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.35.0...v3.0.0 +[v2.35.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.34.0...v2.35.0 +[v2.34.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.33.0...v2.34.0 +[v2.33.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.32.0...v2.33.0 +[v2.32.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.31.0...v2.32.0 +[v2.31.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.30.0...v2.31.0 +[v2.30.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.29.0...v2.30.0 +[v2.29.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.28.0...v2.29.0 +[v2.28.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.27.0...v2.28.0 +[v2.27.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.26.0...v2.27.0 +[v2.26.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.25.0...v2.26.0 +[v2.25.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.24.0...v2.25.0 +[v2.24.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.23.0...v2.24.0 +[v2.23.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.22.0...v2.23.0 +[v2.22.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.21.0...v2.22.0 +[v2.21.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.20.0...v2.21.0 +[v2.20.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.19.0...v2.20.0 +[v2.19.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.18.0...v2.19.0 +[v2.18.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.17.0...v2.18.0 +[v2.17.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.16.0...v2.17.0 +[v2.16.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.15.0...v2.16.0 +[v2.15.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.37.0...v2.15.0 +[v1.37.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.14.0...v1.37.0 +[v2.14.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.36.0...v2.14.0 +[v1.36.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.13.0...v1.36.0 +[v2.13.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.35.0...v2.13.0 +[v1.35.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.12.0...v1.35.0 +[v2.12.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.34.0...v2.12.0 +[v1.34.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.11.0...v1.34.0 +[v2.11.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.10.0...v2.11.0 +[v2.10.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.9.0...v2.10.0 +[v2.9.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.8.0...v2.9.0 +[v2.8.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.7.0...v2.8.0 +[v2.7.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.6.0...v2.7.0 +[v2.6.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.33.0...v2.6.0 +[v1.33.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.32.0...v1.33.0 +[v1.32.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.31.0...v1.32.0 +[v1.31.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.5.0...v1.31.0 +[v2.5.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.4.0...v2.5.0 +[v2.4.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.30.0...v2.4.0 +[v1.30.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.3.0...v1.30.0 +[v2.3.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.2.0...v2.3.0 +[v2.2.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.29.0...v2.2.0 +[v1.29.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.1.0...v1.29.0 +[v2.1.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v2.0.0...v2.1.0 +[v2.0.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.28.0...v2.0.0 +[v1.28.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.27.0...v1.28.0 +[v1.27.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.26.0...v1.27.0 +[v1.26.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.25.0...v1.26.0 +[v1.25.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.24.0...v1.25.0 +[v1.24.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.23.0...v1.24.0 +[v1.23.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.22.0...v1.23.0 +[v1.22.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.21.0...v1.22.0 +[v1.21.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.20.0...v1.21.0 +[v1.20.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.19.0...v1.20.0 +[v1.19.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.18.0...v1.19.0 +[v1.18.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.17.0...v1.18.0 +[v1.17.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.16.0...v1.17.0 +[v1.16.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.15.0...v1.16.0 +[v1.15.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.14.0...v1.15.0 +[v1.14.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.13.0...v1.14.0 +[v1.13.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.12.0...v1.13.0 +[v1.12.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.11.0...v1.12.0 +[v1.11.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.10.0...v1.11.0 +[v1.10.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.9.0...v1.10.0 +[v1.9.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.8.0...v1.9.0 +[v1.8.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.7.0...v1.8.0 +[v1.7.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.6.0...v1.7.0 +[v1.6.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.5.0...v1.6.0 +[v1.5.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.4.0...v1.5.0 +[v1.4.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.3.0...v1.4.0 +[v1.3.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.2.0...v1.3.0 +[v1.2.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.1.1...v1.2.0 +[v1.1.1]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.1.0...v1.1.1 +[v1.1.0]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.0.8...v1.1.0 +[v1.0.8]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.0.7...v1.0.8 +[v1.0.7]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.0.6...v1.0.7 +[v1.0.6]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.0.4...v1.0.6 +[v1.0.4]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.0.5...v1.0.4 +[v1.0.5]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.0.3...v1.0.5 +[v1.0.3]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.0.2...v1.0.3 +[v1.0.2]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.0.1...v1.0.2 +[v1.0.1]: https://github.com/terraform-aws-modules/terraform-aws-rds/compare/v1.0.0...v1.0.1 diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/LICENSE b/modules/mysql/rds/0.1/terraform-aws-rds-master/LICENSE new file mode 100644 index 000000000..d9a10c0d8 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/README.md b/modules/mysql/rds/0.1/terraform-aws-rds-master/README.md new file mode 100644 index 000000000..45ec5b560 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/README.md @@ -0,0 +1,371 @@ +# AWS RDS Terraform module + +Terraform module which creates RDS resources on AWS. + +[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md) + +Root module calls these modules which can also be used separately to create independent resources: + +- [db_instance](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/modules/db_instance) - creates RDS DB instance +- [db_subnet_group](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/modules/db_subnet_group) - creates RDS DB subnet group +- [db_parameter_group](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/modules/db_parameter_group) - creates RDS DB parameter group +- [db_option_group](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/modules/db_option_group) - creates RDS DB option group + +## Usage + +```hcl +module "db" { + source = "terraform-aws-modules/rds/aws" + + identifier = "demodb" + + engine = "mysql" + engine_version = "5.7" + instance_class = "db.t3a.large" + allocated_storage = 5 + + db_name = "demodb" + username = "user" + port = "3306" + + iam_database_authentication_enabled = true + + vpc_security_group_ids = ["sg-12345678"] + + maintenance_window = "Mon:00:00-Mon:03:00" + backup_window = "03:00-06:00" + + # Enhanced Monitoring - see example for details on how to create the role + # by yourself, in case you don't want to create it automatically + monitoring_interval = "30" + monitoring_role_name = "MyRDSMonitoringRole" + create_monitoring_role = true + + tags = { + Owner = "user" + Environment = "dev" + } + + # DB subnet group + create_db_subnet_group = true + subnet_ids = ["subnet-12345678", "subnet-87654321"] + + # DB parameter group + family = "mysql5.7" + + # DB option group + major_engine_version = "5.7" + + # Database Deletion Protection + deletion_protection = true + + parameters = [ + { + name = "character_set_client" + value = "utf8mb4" + }, + { + name = "character_set_server" + value = "utf8mb4" + } + ] + + options = [ + { + option_name = "MARIADB_AUDIT_PLUGIN" + + option_settings = [ + { + name = "SERVER_AUDIT_EVENTS" + value = "CONNECT" + }, + { + name = "SERVER_AUDIT_FILE_ROTATIONS" + value = "37" + }, + ] + }, + ] +} +``` + +## Conditional creation + +The following values are provided to toggle on/off creation of the associated resources as desired: + +```hcl +module "db" { + source = "terraform-aws-modules/rds/aws" + + # Disable creation of RDS instance(s) + create_db_instance = false + + # Disable creation of option group - provide an option group or default AWS default + create_db_option_group = false + + # Disable creation of parameter group - provide a parameter group or default to AWS default + create_db_parameter_group = false + + # Enable creation of subnet group (disabled by default) + create_db_subnet_group = true + + # Enable creation of monitoring IAM role + create_monitoring_role = true + + # ... omitted +} +``` + +## Option Groups + +[Reference](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithOptionGroups.html) + +Users have the ability to: + +- Create an option group with the name provided: + +```hcl + option_group_name = "prod-instance-mysql-8.0" + option_group_use_name_prefix = false +``` + +- Create an option group using a unique prefix beginning with the name provided: + +```hcl + option_group_name = "prod-instance-mysql-8.0" +``` + +- Pass the name of an option group to use that has been created outside of the module: + +```hcl + create_db_option_group = false + option_group_name = "prod-instance-mysql-8.0" # must already exist in AWS +``` + +- Skip creating an option group for PostgreSQL entirely as that is not supported + +```hcl + engine = "postgres" + option_group_name = "prod-instance-postgresql-11.0" # this will be ignored, no option group created +``` + +- Use a default option group provided by AWS + +```hcl + create_db_option_group = false +``` + +## Parameter Groups + +[Reference](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html) + +Users have the ability to: + +- Create a parameter group with the name provided: + +```hcl + parameter_group_name = "prod-instance-mysql-8.0" + parameter_group_use_name_prefix = false +``` + +- Create a parameter group using a unique prefix beginning with the name provided: + +```hcl + parameter_group_name = "prod-instance-mysql-8.0" +``` + +- Pass the name of a parameter group to use that has been created outside of the module: + +```hcl + create_db_parameter_group = false + parameter_group_name = "prod-instance-mysql-8.0" # must already exist in AWS +``` + +- Use a default parameter group provided by AWS + +```hcl + create_db_parameter_group = false +``` + +## Examples + +- [Complete RDS example for MSSQL](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples/complete-mssql) +- [Complete RDS example for MySQL](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples/complete-mysql) +- [Complete RDS example for Oracle](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples/complete-oracle) +- [Complete RDS example for PostgreSQL](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples/complete-postgres) +- [Enhanced monitoring example](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples/enhanced-monitoring) +- [Replica RDS example for MySQL](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples/replica-mysql) +- [Replica RDS example for PostgreSQL](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples/replica-postgres) +- [S3 import example for MySQL](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples/s3-import-mysql) + +## Notes + +1. This module does not create RDS security group. Use [terraform-aws-security-group](https://github.com/terraform-aws-modules/terraform-aws-security-group) module for this. +2. By default, the variable `create_random_password` is set to true. Therefore, even if the user provides a password, it will not be read. The `create_random_password` variable should be set to false and the `password` variable should have a non-null value to be read and used. +3. For an RDS instance with `storage_type` using `gp3`, be aware that `iops` and `storage_throughput` cannot be specified if the `allocated_storage` value is below a per-`engine` threshold. See the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#gp3-storage) for details. + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0 | +| [aws](#requirement\_aws) | >= 4.45 | +| [random](#requirement\_random) | >= 3.1 | + +## Providers + +| Name | Version | +|------|---------| +| [random](#provider\_random) | >= 3.1 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [db\_instance](#module\_db\_instance) | ./modules/db_instance | n/a | +| [db\_option\_group](#module\_db\_option\_group) | ./modules/db_option_group | n/a | +| [db\_parameter\_group](#module\_db\_parameter\_group) | ./modules/db_parameter_group | n/a | +| [db\_subnet\_group](#module\_db\_subnet\_group) | ./modules/db_subnet_group | n/a | + +## Resources + +| Name | Type | +|------|------| +| [random_password.master_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [allocated\_storage](#input\_allocated\_storage) | The allocated storage in gigabytes | `string` | `null` | no | +| [allow\_major\_version\_upgrade](#input\_allow\_major\_version\_upgrade) | Indicates that major version upgrades are allowed. Changing this parameter does not result in an outage and the change is asynchronously applied as soon as possible | `bool` | `false` | no | +| [apply\_immediately](#input\_apply\_immediately) | Specifies whether any database modifications are applied immediately, or during the next maintenance window | `bool` | `false` | no | +| [auto\_minor\_version\_upgrade](#input\_auto\_minor\_version\_upgrade) | Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window | `bool` | `true` | no | +| [availability\_zone](#input\_availability\_zone) | The Availability Zone of the RDS instance | `string` | `null` | no | +| [backup\_retention\_period](#input\_backup\_retention\_period) | The days to retain backups for | `number` | `null` | no | +| [backup\_window](#input\_backup\_window) | The daily time range (in UTC) during which automated backups are created if they are enabled. Example: '09:46-10:16'. Must not overlap with maintenance\_window | `string` | `null` | no | +| [ca\_cert\_identifier](#input\_ca\_cert\_identifier) | Specifies the identifier of the CA certificate for the DB instance | `string` | `null` | no | +| [character\_set\_name](#input\_character\_set\_name) | The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS and Collations and Character Sets for Microsoft SQL Server for more information. This can only be set on creation | `string` | `null` | no | +| [cloudwatch\_log\_group\_kms\_key\_id](#input\_cloudwatch\_log\_group\_kms\_key\_id) | The ARN of the KMS Key to use when encrypting log data | `string` | `null` | no | +| [cloudwatch\_log\_group\_retention\_in\_days](#input\_cloudwatch\_log\_group\_retention\_in\_days) | The number of days to retain CloudWatch logs for the DB instance | `number` | `7` | no | +| [copy\_tags\_to\_snapshot](#input\_copy\_tags\_to\_snapshot) | On delete, copy all Instance tags to the final snapshot | `bool` | `false` | no | +| [create\_cloudwatch\_log\_group](#input\_create\_cloudwatch\_log\_group) | Determines whether a CloudWatch log group is created for each `enabled_cloudwatch_logs_exports` | `bool` | `false` | no | +| [create\_db\_instance](#input\_create\_db\_instance) | Whether to create a database instance | `bool` | `true` | no | +| [create\_db\_option\_group](#input\_create\_db\_option\_group) | Create a database option group | `bool` | `true` | no | +| [create\_db\_parameter\_group](#input\_create\_db\_parameter\_group) | Whether to create a database parameter group | `bool` | `true` | no | +| [create\_db\_subnet\_group](#input\_create\_db\_subnet\_group) | Whether to create a database subnet group | `bool` | `false` | no | +| [create\_monitoring\_role](#input\_create\_monitoring\_role) | Create IAM role with a defined name that permits RDS to send enhanced monitoring metrics to CloudWatch Logs | `bool` | `false` | no | +| [create\_random\_password](#input\_create\_random\_password) | Whether to create random password for RDS primary cluster | `bool` | `true` | no | +| [db\_instance\_tags](#input\_db\_instance\_tags) | Additional tags for the DB instance | `map(string)` | `{}` | no | +| [db\_name](#input\_db\_name) | The DB name to create. If omitted, no database is created initially | `string` | `null` | no | +| [db\_option\_group\_tags](#input\_db\_option\_group\_tags) | Additional tags for the DB option group | `map(string)` | `{}` | no | +| [db\_parameter\_group\_tags](#input\_db\_parameter\_group\_tags) | Additional tags for the DB parameter group | `map(string)` | `{}` | no | +| [db\_subnet\_group\_description](#input\_db\_subnet\_group\_description) | Description of the DB subnet group to create | `string` | `null` | no | +| [db\_subnet\_group\_name](#input\_db\_subnet\_group\_name) | Name of DB subnet group. DB instance will be created in the VPC associated with the DB subnet group. If unspecified, will be created in the default VPC | `string` | `null` | no | +| [db\_subnet\_group\_tags](#input\_db\_subnet\_group\_tags) | Additional tags for the DB subnet group | `map(string)` | `{}` | no | +| [db\_subnet\_group\_use\_name\_prefix](#input\_db\_subnet\_group\_use\_name\_prefix) | Determines whether to use `subnet_group_name` as is or create a unique name beginning with the `subnet_group_name` as the prefix | `bool` | `true` | no | +| [delete\_automated\_backups](#input\_delete\_automated\_backups) | Specifies whether to remove automated backups immediately after the DB instance is deleted | `bool` | `true` | no | +| [deletion\_protection](#input\_deletion\_protection) | The database can't be deleted when this value is set to true | `bool` | `false` | no | +| [domain](#input\_domain) | The ID of the Directory Service Active Directory domain to create the instance in | `string` | `null` | no | +| [domain\_iam\_role\_name](#input\_domain\_iam\_role\_name) | (Required if domain is provided) The name of the IAM role to be used when making API calls to the Directory Service | `string` | `null` | no | +| [enabled\_cloudwatch\_logs\_exports](#input\_enabled\_cloudwatch\_logs\_exports) | List of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be exported. Valid values (depending on engine): alert, audit, error, general, listener, slowquery, trace, postgresql (PostgreSQL), upgrade (PostgreSQL) | `list(string)` | `[]` | no | +| [engine](#input\_engine) | The database engine to use | `string` | `null` | no | +| [engine\_version](#input\_engine\_version) | The engine version to use | `string` | `null` | no | +| [family](#input\_family) | The family of the DB parameter group | `string` | `null` | no | +| [final\_snapshot\_identifier\_prefix](#input\_final\_snapshot\_identifier\_prefix) | The name which is prefixed to the final snapshot on cluster destroy | `string` | `"final"` | no | +| [iam\_database\_authentication\_enabled](#input\_iam\_database\_authentication\_enabled) | Specifies whether or not the mappings of AWS Identity and Access Management (IAM) accounts to database accounts are enabled | `bool` | `false` | no | +| [identifier](#input\_identifier) | The name of the RDS instance | `string` | n/a | yes | +| [instance\_class](#input\_instance\_class) | The instance type of the RDS instance | `string` | `null` | no | +| [instance\_use\_identifier\_prefix](#input\_instance\_use\_identifier\_prefix) | Determines whether to use `identifier` as is or create a unique identifier beginning with `identifier` as the specified prefix | `bool` | `false` | no | +| [iops](#input\_iops) | The amount of provisioned IOPS. Setting this implies a storage\_type of 'io1' or `gp3`. See `notes` for limitations regarding this variable for `gp3` | `number` | `null` | no | +| [kms\_key\_id](#input\_kms\_key\_id) | The ARN for the KMS encryption key. If creating an encrypted replica, set this to the destination KMS ARN. If storage\_encrypted is set to true and kms\_key\_id is not specified the default KMS key created in your account will be used. Be sure to use the full ARN, not a key alias. | `string` | `null` | no | +| [license\_model](#input\_license\_model) | License model information for this DB instance. Optional, but required for some DB engines, i.e. Oracle SE1 | `string` | `null` | no | +| [maintenance\_window](#input\_maintenance\_window) | The window to perform maintenance in. Syntax: 'ddd:hh24:mi-ddd:hh24:mi'. Eg: 'Mon:00:00-Mon:03:00' | `string` | `null` | no | +| [major\_engine\_version](#input\_major\_engine\_version) | Specifies the major version of the engine that this option group should be associated with | `string` | `null` | no | +| [max\_allocated\_storage](#input\_max\_allocated\_storage) | Specifies the value for Storage Autoscaling | `number` | `0` | no | +| [monitoring\_interval](#input\_monitoring\_interval) | The 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 | `number` | `0` | no | +| [monitoring\_role\_arn](#input\_monitoring\_role\_arn) | The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. Must be specified if monitoring\_interval is non-zero | `string` | `null` | no | +| [monitoring\_role\_description](#input\_monitoring\_role\_description) | Description of the monitoring IAM role | `string` | `null` | no | +| [monitoring\_role\_name](#input\_monitoring\_role\_name) | Name of the IAM role which will be created when create\_monitoring\_role is enabled | `string` | `"rds-monitoring-role"` | no | +| [monitoring\_role\_use\_name\_prefix](#input\_monitoring\_role\_use\_name\_prefix) | Determines whether to use `monitoring_role_name` as is or create a unique identifier beginning with `monitoring_role_name` as the specified prefix | `bool` | `false` | no | +| [multi\_az](#input\_multi\_az) | Specifies if the RDS instance is multi-AZ | `bool` | `false` | no | +| [network\_type](#input\_network\_type) | The type of network stack to use | `string` | `null` | no | +| [option\_group\_description](#input\_option\_group\_description) | The description of the option group | `string` | `null` | no | +| [option\_group\_name](#input\_option\_group\_name) | Name of the option group | `string` | `null` | no | +| [option\_group\_timeouts](#input\_option\_group\_timeouts) | Define maximum timeout for deletion of `aws_db_option_group` resource | `map(string)` | `{}` | no | +| [option\_group\_use\_name\_prefix](#input\_option\_group\_use\_name\_prefix) | Determines whether to use `option_group_name` as is or create a unique name beginning with the `option_group_name` as the prefix | `bool` | `true` | no | +| [options](#input\_options) | A list of Options to apply | `any` | `[]` | no | +| [parameter\_group\_description](#input\_parameter\_group\_description) | Description of the DB parameter group to create | `string` | `null` | no | +| [parameter\_group\_name](#input\_parameter\_group\_name) | Name of the DB parameter group to associate or create | `string` | `null` | no | +| [parameter\_group\_use\_name\_prefix](#input\_parameter\_group\_use\_name\_prefix) | Determines whether to use `parameter_group_name` as is or create a unique name beginning with the `parameter_group_name` as the prefix | `bool` | `true` | no | +| [parameters](#input\_parameters) | A list of DB parameters (map) to apply | `list(map(string))` | `[]` | no | +| [password](#input\_password) | Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file.
The password provided will not be used if the variable create\_random\_password is set to true. | `string` | `null` | no | +| [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Specifies whether Performance Insights are enabled | `bool` | `false` | no | +| [performance\_insights\_kms\_key\_id](#input\_performance\_insights\_kms\_key\_id) | The ARN for the KMS key to encrypt Performance Insights data | `string` | `null` | no | +| [performance\_insights\_retention\_period](#input\_performance\_insights\_retention\_period) | The amount of time in days to retain Performance Insights data. Valid values are `7`, `731` (2 years) or a multiple of `31` | `number` | `7` | no | +| [port](#input\_port) | The port on which the DB accepts connections | `string` | `null` | no | +| [publicly\_accessible](#input\_publicly\_accessible) | Bool to control if instance is publicly accessible | `bool` | `false` | no | +| [putin\_khuylo](#input\_putin\_khuylo) | Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo! | `bool` | `true` | no | +| [random\_password\_length](#input\_random\_password\_length) | Length of random password to create | `number` | `16` | no | +| [replica\_mode](#input\_replica\_mode) | Specifies whether the replica is in either mounted or open-read-only mode. This attribute is only supported by Oracle instances. Oracle replicas operate in open-read-only mode unless otherwise specified | `string` | `null` | no | +| [replicate\_source\_db](#input\_replicate\_source\_db) | Specifies that this resource is a Replicate database, and to use this value as the source database. This correlates to the identifier of another Amazon RDS Database to replicate | `string` | `null` | no | +| [restore\_to\_point\_in\_time](#input\_restore\_to\_point\_in\_time) | Restore to a point in time (MySQL is NOT supported) | `map(string)` | `null` | no | +| [s3\_import](#input\_s3\_import) | Restore from a Percona Xtrabackup in S3 (only MySQL is supported) | `map(string)` | `null` | no | +| [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB instance is deleted | `bool` | `false` | no | +| [snapshot\_identifier](#input\_snapshot\_identifier) | Specifies whether or not to create this database from a snapshot. This correlates to the snapshot ID you'd find in the RDS console, e.g: rds:production-2015-06-26-06-05 | `string` | `null` | no | +| [storage\_encrypted](#input\_storage\_encrypted) | Specifies whether the DB instance is encrypted | `bool` | `true` | no | +| [storage\_throughput](#input\_storage\_throughput) | Storage throughput value for the DB instance. See `notes` for limitations regarding this variable for `gp3` | `number` | `null` | no | +| [storage\_type](#input\_storage\_type) | One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not. If you specify 'io1' or 'gp3' , you must also include a value for the 'iops' parameter | `string` | `null` | no | +| [subnet\_ids](#input\_subnet\_ids) | A list of VPC subnet IDs | `list(string)` | `[]` | no | +| [tags](#input\_tags) | A mapping of tags to assign to all resources | `map(string)` | `{}` | no | +| [timeouts](#input\_timeouts) | Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times | `map(string)` | `{}` | no | +| [timezone](#input\_timezone) | Time zone of the DB instance. timezone is currently only supported by Microsoft SQL Server. The timezone can only be set on creation. See MSSQL User Guide for more information | `string` | `null` | no | +| [username](#input\_username) | Username for the master DB user | `string` | `null` | no | +| [vpc\_security\_group\_ids](#input\_vpc\_security\_group\_ids) | List of VPC security groups to associate | `list(string)` | `[]` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [db\_instance\_address](#output\_db\_instance\_address) | The address of the RDS instance | +| [db\_instance\_arn](#output\_db\_instance\_arn) | The ARN of the RDS instance | +| [db\_instance\_availability\_zone](#output\_db\_instance\_availability\_zone) | The availability zone of the RDS instance | +| [db\_instance\_ca\_cert\_identifier](#output\_db\_instance\_ca\_cert\_identifier) | Specifies the identifier of the CA certificate for the DB instance | +| [db\_instance\_cloudwatch\_log\_groups](#output\_db\_instance\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | +| [db\_instance\_domain](#output\_db\_instance\_domain) | The ID of the Directory Service Active Directory domain the instance is joined to | +| [db\_instance\_domain\_iam\_role\_name](#output\_db\_instance\_domain\_iam\_role\_name) | The name of the IAM role to be used when making API calls to the Directory Service. | +| [db\_instance\_endpoint](#output\_db\_instance\_endpoint) | The connection endpoint | +| [db\_instance\_engine](#output\_db\_instance\_engine) | The database engine | +| [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | +| [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | +| [db\_instance\_id](#output\_db\_instance\_id) | The RDS instance ID | +| [db\_instance\_name](#output\_db\_instance\_name) | The database name | +| [db\_instance\_password](#output\_db\_instance\_password) | The database password (this password may be old, because Terraform doesn't track it after initial creation) | +| [db\_instance\_port](#output\_db\_instance\_port) | The database port | +| [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | +| [db\_instance\_status](#output\_db\_instance\_status) | The RDS instance status | +| [db\_instance\_username](#output\_db\_instance\_username) | The master username for the database | +| [db\_option\_group\_arn](#output\_db\_option\_group\_arn) | The ARN of the db option group | +| [db\_option\_group\_id](#output\_db\_option\_group\_id) | The db option group id | +| [db\_parameter\_group\_arn](#output\_db\_parameter\_group\_arn) | The ARN of the db parameter group | +| [db\_parameter\_group\_id](#output\_db\_parameter\_group\_id) | The db parameter group id | +| [db\_subnet\_group\_arn](#output\_db\_subnet\_group\_arn) | The ARN of the db subnet group | +| [db\_subnet\_group\_id](#output\_db\_subnet\_group\_id) | The db subnet group name | +| [enhanced\_monitoring\_iam\_role\_arn](#output\_enhanced\_monitoring\_iam\_role\_arn) | The Amazon Resource Name (ARN) specifying the monitoring role | +| [enhanced\_monitoring\_iam\_role\_name](#output\_enhanced\_monitoring\_iam\_role\_name) | The name of the monitoring role | + + +## Authors + +Module is maintained by [Anton Babenko](https://github.com/antonbabenko) with help from [these awesome contributors](https://github.com/terraform-aws-modules/terraform-aws-rds/graphs/contributors). + +## License + +Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/LICENSE) for full details. + +## Additional information for users from Russia and Belarus + +* Russia has [illegally annexed Crimea in 2014](https://en.wikipedia.org/wiki/Annexation_of_Crimea_by_the_Russian_Federation) and [brought the war in Donbas](https://en.wikipedia.org/wiki/War_in_Donbas) followed by [full-scale invasion of Ukraine in 2022](https://en.wikipedia.org/wiki/2022_Russian_invasion_of_Ukraine). +* Russia has brought sorrow and devastations to millions of Ukrainians, killed hundreds of innocent people, damaged thousands of buildings, and forced several million people to flee. +* [Putin khuylo!](https://en.wikipedia.org/wiki/Putin_khuylo!) diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/UPGRADE-4.0.md b/modules/mysql/rds/0.1/terraform-aws-rds-master/UPGRADE-4.0.md new file mode 100644 index 000000000..129e73334 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/UPGRADE-4.0.md @@ -0,0 +1,109 @@ +# Upgrade from v3.x to v4.x + +If you have any questions regarding this upgrade process, please consult the [`examples/`](https://github.com/terraform-aws-modules/terraform-aws-rds/tree/master/examples) projects: + +If you find a bug, please open an issue with supporting configuration to reproduce. + +## List of backwards incompatible changes + +- Support for Terraform `<=v0.12.x` has been dropped; `v0.13.1` is now the minimum supported version +- Terraform AWS provider minimum version is now `v4.0.0` in order to support the replacement of `var.name`(deprecated) for `var.db_name` +- Separate RDS instance resource for MSSQL/SQLServer has been removed - all engines are supported under one resource +- `storage_encrypted` is now set to `true` by default; was previously `false` +- `create_random_password` is now set to `true` by default; was previously `false` +- `create_db_subnet_group` is now set to `false` by default; was previously `true`; typically a shared DB subnet group will be used, most likely from the VPC module +- `random_password_length` is now set to `16` by default, was previously `10` +- Random provider minimum version supported is now `v3.1.0` +- `final_snapshot_identifier` no longer coalesces `var.final_snapshot_identifier` and instead relies on `var.final_snapshot_identifier_prefix` with a random suffix to avoid name collisions + +## Additional changes + +### Added + +- `latest_restorable_time` added to ignored changes +- `replica_mode` support added to DB instance + +### Modified + +- `username`, `password`, and `engine` are set to `null` when a `replicate_source_db` or `snapshot_identifier` is provided; these values are already provided in the respective source +- `engine_version` is set to `null` when a value is provided for `replicate_source_db` +- `db_subnet_group_name` has been updated to use full name when prefix is enabled +- `Name` tag removed from instance resource; name is set via `identifier` and not through tags; users can add back into the tags they provide if desired +- Outputs have been updated to use `try()` syntax; local variable usage has been removed within outputs +- `engine`, `major_engine_version`, `family`, `password`, `db_subnet_group_name`,`db_subnet_group_description`,`parameter_group_name`, +`parameter_group_description`, `option_group_name`, `option_group_description` is now set to `null` by default; was previously `""` +- `timeouts` is now set to `{}` by default; was previously a copy+paste of default value used by provider. This is a no-op but will show up in plans as a diff + +### Variable and output changes + +1. Removed variables: + + - `final_snapshot_identifier` + +2. Renamed variables: + + - `name` (deprecated) -> `db_name` + - `master_password` -> `password` + +3. Added variables: + + - `replica_mode` + +4. Removed outputs: + + - None + +5. Renamed outputs: + + - `db_instance_master_password` -> `db_instance_password` + +6. Added outputs: + + - None + +## Upgrade Migrations + +The following examples demonstrate some of the changes that users can elect to make to avoid any potential disruptions when upgrading. + +### Before 3.x Example + +```hcl +module "rds" { + source = "terraform-aws-modules/rds/aws" + version = "~> 3.0" + + master_password = "MySuperStrongPassword!" + + # Previously on read-replicas or restored from snapshot instances you needed to explicitly set these to null + # These can now be safely removed and instead on the module to resolve these appropriately + username = null + password = null + engine = null +} +``` + +### After 4.x Example + +```hcl +module "asg" { + source = "terraform-aws-modules/rds/aws" + version = "~> 4.0" + + password = "MySuperStrongPassword!" + # Set random password creation to false if providing your own password as input + create_random_password = false + + # If you did not have storage encrypted in `v3.x`, you can explicitly disable in `v4.x` to avoid disruption + storage_encrypted = false +} +``` + +#### MSSQL/SQLServer + +For MSSSQL/SQLServer, users will want to rename the resource in their Terraform state to align with the flattened DB instance resource module in v4.x: + +```bash +terraform state mv 'module..module.db_instance.aws_db_instance.this_mssql[0]' 'module..module.db_instance.aws_db_instance.this[0]' +``` + +Where `` is the name of your module definition. diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/main.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/main.tf new file mode 100644 index 000000000..b80449b07 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/main.tf @@ -0,0 +1,149 @@ +locals { + create_db_subnet_group = var.create_db_subnet_group && var.putin_khuylo + create_db_parameter_group = var.create_db_parameter_group && var.putin_khuylo + create_db_instance = var.create_db_instance && var.putin_khuylo + + create_random_password = local.create_db_instance && var.create_random_password + password = local.create_random_password ? random_password.master_password[0].result : var.password + + db_subnet_group_name = var.create_db_subnet_group ? module.db_subnet_group.db_subnet_group_id : var.db_subnet_group_name + parameter_group_name_id = var.create_db_parameter_group ? module.db_parameter_group.db_parameter_group_id : var.parameter_group_name + + create_db_option_group = var.create_db_option_group && var.engine != "postgres" + option_group = local.create_db_option_group ? module.db_option_group.db_option_group_id : var.option_group_name +} + +resource "random_password" "master_password" { + count = local.create_random_password ? 1 : 0 + + length = var.random_password_length + special = false +} + +module "db_subnet_group" { + source = "./modules/db_subnet_group" + + create = local.create_db_subnet_group + + name = coalesce(var.db_subnet_group_name, var.identifier) + use_name_prefix = var.db_subnet_group_use_name_prefix + description = var.db_subnet_group_description + subnet_ids = var.subnet_ids + + tags = merge(var.tags, var.db_subnet_group_tags) +} + +module "db_parameter_group" { + source = "./modules/db_parameter_group" + + create = local.create_db_parameter_group + + name = coalesce(var.parameter_group_name, var.identifier) + use_name_prefix = var.parameter_group_use_name_prefix + description = var.parameter_group_description + family = var.family + + parameters = var.parameters + + tags = merge(var.tags, var.db_parameter_group_tags) +} + +module "db_option_group" { + source = "./modules/db_option_group" + + create = local.create_db_option_group + + name = coalesce(var.option_group_name, var.identifier) + use_name_prefix = var.option_group_use_name_prefix + option_group_description = var.option_group_description + engine_name = var.engine + major_engine_version = var.major_engine_version + + options = var.options + + timeouts = var.option_group_timeouts + + tags = merge(var.tags, var.db_option_group_tags) +} + +module "db_instance" { + source = "./modules/db_instance" + + create = local.create_db_instance + identifier = var.identifier + use_identifier_prefix = var.instance_use_identifier_prefix + + engine = var.engine + engine_version = var.engine_version + instance_class = var.instance_class + allocated_storage = var.allocated_storage + storage_type = var.storage_type + storage_encrypted = var.storage_encrypted + kms_key_id = var.kms_key_id + license_model = var.license_model + + db_name = var.db_name + username = var.username + password = local.password + port = var.port + domain = var.domain + domain_iam_role_name = var.domain_iam_role_name + iam_database_authentication_enabled = var.iam_database_authentication_enabled + + vpc_security_group_ids = var.vpc_security_group_ids + db_subnet_group_name = local.db_subnet_group_name + parameter_group_name = local.parameter_group_name_id + option_group_name = var.engine != "postgres" ? local.option_group : null + network_type = var.network_type + + availability_zone = var.availability_zone + multi_az = var.multi_az + iops = var.iops + storage_throughput = var.storage_throughput + publicly_accessible = var.publicly_accessible + ca_cert_identifier = var.ca_cert_identifier + + allow_major_version_upgrade = var.allow_major_version_upgrade + auto_minor_version_upgrade = var.auto_minor_version_upgrade + apply_immediately = var.apply_immediately + maintenance_window = var.maintenance_window + + snapshot_identifier = var.snapshot_identifier + copy_tags_to_snapshot = var.copy_tags_to_snapshot + skip_final_snapshot = var.skip_final_snapshot + final_snapshot_identifier_prefix = var.final_snapshot_identifier_prefix + + performance_insights_enabled = var.performance_insights_enabled + performance_insights_retention_period = var.performance_insights_retention_period + performance_insights_kms_key_id = var.performance_insights_enabled ? var.performance_insights_kms_key_id : null + + replicate_source_db = var.replicate_source_db + replica_mode = var.replica_mode + backup_retention_period = var.backup_retention_period + backup_window = var.backup_window + max_allocated_storage = var.max_allocated_storage + monitoring_interval = var.monitoring_interval + monitoring_role_arn = var.monitoring_role_arn + monitoring_role_name = var.monitoring_role_name + monitoring_role_use_name_prefix = var.monitoring_role_use_name_prefix + monitoring_role_description = var.monitoring_role_description + create_monitoring_role = var.create_monitoring_role + + character_set_name = var.character_set_name + timezone = var.timezone + + enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports + create_cloudwatch_log_group = var.create_cloudwatch_log_group + cloudwatch_log_group_retention_in_days = var.cloudwatch_log_group_retention_in_days + cloudwatch_log_group_kms_key_id = var.cloudwatch_log_group_kms_key_id + + timeouts = var.timeouts + + deletion_protection = var.deletion_protection + delete_automated_backups = var.delete_automated_backups + + restore_to_point_in_time = var.restore_to_point_in_time + s3_import = var.s3_import + + tags = merge(var.tags, var.db_instance_tags) +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/README.md b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/README.md new file mode 100644 index 000000000..a56fe45c0 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/README.md @@ -0,0 +1,127 @@ +# aws_db_instance + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0 | +| [aws](#requirement\_aws) | >= 4.45 | +| [random](#requirement\_random) | >= 3.1 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 4.45 | +| [random](#provider\_random) | >= 3.1 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource | +| [aws_db_instance.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance) | resource | +| [aws_iam_role.enhanced_monitoring](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role_policy_attachment.enhanced_monitoring](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [random_id.snapshot_identifier](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource | +| [aws_iam_policy_document.enhanced_monitoring](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [allocated\_storage](#input\_allocated\_storage) | The allocated storage in gigabytes | `string` | `null` | no | +| [allow\_major\_version\_upgrade](#input\_allow\_major\_version\_upgrade) | Indicates that major version upgrades are allowed. Changing this parameter does not result in an outage and the change is asynchronously applied as soon as possible | `bool` | `false` | no | +| [apply\_immediately](#input\_apply\_immediately) | Specifies whether any database modifications are applied immediately, or during the next maintenance window | `bool` | `false` | no | +| [auto\_minor\_version\_upgrade](#input\_auto\_minor\_version\_upgrade) | Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window | `bool` | `true` | no | +| [availability\_zone](#input\_availability\_zone) | The Availability Zone of the RDS instance | `string` | `null` | no | +| [backup\_retention\_period](#input\_backup\_retention\_period) | The days to retain backups for | `number` | `null` | no | +| [backup\_window](#input\_backup\_window) | The daily time range (in UTC) during which automated backups are created if they are enabled. Example: '09:46-10:16'. Must not overlap with maintenance\_window | `string` | `null` | no | +| [ca\_cert\_identifier](#input\_ca\_cert\_identifier) | Specifies the identifier of the CA certificate for the DB instance | `string` | `null` | no | +| [character\_set\_name](#input\_character\_set\_name) | The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS and Collations and Character Sets for Microsoft SQL Server for more information. This can only be set on creation. | `string` | `null` | no | +| [cloudwatch\_log\_group\_kms\_key\_id](#input\_cloudwatch\_log\_group\_kms\_key\_id) | The ARN of the KMS Key to use when encrypting log data | `string` | `null` | no | +| [cloudwatch\_log\_group\_retention\_in\_days](#input\_cloudwatch\_log\_group\_retention\_in\_days) | The number of days to retain CloudWatch logs for the DB instance | `number` | `7` | no | +| [copy\_tags\_to\_snapshot](#input\_copy\_tags\_to\_snapshot) | On delete, copy all Instance tags to the final snapshot | `bool` | `false` | no | +| [create](#input\_create) | Whether to create this resource or not? | `bool` | `true` | no | +| [create\_cloudwatch\_log\_group](#input\_create\_cloudwatch\_log\_group) | Determines whether a CloudWatch log group is created for each `enabled_cloudwatch_logs_exports` | `bool` | `false` | no | +| [create\_monitoring\_role](#input\_create\_monitoring\_role) | Create IAM role with a defined name that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. | `bool` | `false` | no | +| [db\_name](#input\_db\_name) | The DB name to create. If omitted, no database is created initially | `string` | `null` | no | +| [db\_subnet\_group\_name](#input\_db\_subnet\_group\_name) | Name of DB subnet group. DB instance will be created in the VPC associated with the DB subnet group. If unspecified, will be created in the default VPC | `string` | `null` | no | +| [delete\_automated\_backups](#input\_delete\_automated\_backups) | Specifies whether to remove automated backups immediately after the DB instance is deleted | `bool` | `true` | no | +| [deletion\_protection](#input\_deletion\_protection) | The database can't be deleted when this value is set to true. | `bool` | `false` | no | +| [domain](#input\_domain) | The ID of the Directory Service Active Directory domain to create the instance in | `string` | `null` | no | +| [domain\_iam\_role\_name](#input\_domain\_iam\_role\_name) | (Required if domain is provided) The name of the IAM role to be used when making API calls to the Directory Service | `string` | `null` | no | +| [enabled\_cloudwatch\_logs\_exports](#input\_enabled\_cloudwatch\_logs\_exports) | List of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be exported. Valid values (depending on engine): alert, audit, error, general, listener, slowquery, trace, postgresql (PostgreSQL), upgrade (PostgreSQL). | `list(string)` | `[]` | no | +| [engine](#input\_engine) | The database engine to use | `string` | `null` | no | +| [engine\_version](#input\_engine\_version) | The engine version to use | `string` | `null` | no | +| [final\_snapshot\_identifier\_prefix](#input\_final\_snapshot\_identifier\_prefix) | The name which is prefixed to the final snapshot on cluster destroy | `string` | `"final"` | no | +| [iam\_database\_authentication\_enabled](#input\_iam\_database\_authentication\_enabled) | Specifies whether or mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled | `bool` | `false` | no | +| [identifier](#input\_identifier) | The name of the RDS instance | `string` | n/a | yes | +| [instance\_class](#input\_instance\_class) | The instance type of the RDS instance | `string` | `null` | no | +| [iops](#input\_iops) | The amount of provisioned IOPS. Setting this implies a storage\_type of 'io1' or `gp3`. See `notes` for limitations regarding this variable for `gp3` | `number` | `null` | no | +| [kms\_key\_id](#input\_kms\_key\_id) | The ARN for the KMS encryption key. If creating an encrypted replica, set this to the destination KMS ARN. If storage\_encrypted is set to true and kms\_key\_id is not specified the default KMS key created in your account will be used | `string` | `null` | no | +| [license\_model](#input\_license\_model) | License model information for this DB instance. Optional, but required for some DB engines, i.e. Oracle SE1 | `string` | `null` | no | +| [maintenance\_window](#input\_maintenance\_window) | The window to perform maintenance in. Syntax: 'ddd:hh24:mi-ddd:hh24:mi'. Eg: 'Mon:00:00-Mon:03:00' | `string` | `null` | no | +| [max\_allocated\_storage](#input\_max\_allocated\_storage) | Specifies the value for Storage Autoscaling | `number` | `0` | no | +| [monitoring\_interval](#input\_monitoring\_interval) | The 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. | `number` | `0` | no | +| [monitoring\_role\_arn](#input\_monitoring\_role\_arn) | The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. Must be specified if monitoring\_interval is non-zero. | `string` | `null` | no | +| [monitoring\_role\_description](#input\_monitoring\_role\_description) | Description of the monitoring IAM role | `string` | `null` | no | +| [monitoring\_role\_name](#input\_monitoring\_role\_name) | Name of the IAM role which will be created when create\_monitoring\_role is enabled. | `string` | `"rds-monitoring-role"` | no | +| [monitoring\_role\_use\_name\_prefix](#input\_monitoring\_role\_use\_name\_prefix) | Determines whether to use `monitoring_role_name` as is or create a unique identifier beginning with `monitoring_role_name` as the specified prefix | `bool` | `false` | no | +| [multi\_az](#input\_multi\_az) | Specifies if the RDS instance is multi-AZ | `bool` | `false` | no | +| [network\_type](#input\_network\_type) | The type of network stack | `string` | `null` | no | +| [option\_group\_name](#input\_option\_group\_name) | Name of the DB option group to associate. | `string` | `null` | no | +| [parameter\_group\_name](#input\_parameter\_group\_name) | Name of the DB parameter group to associate | `string` | `null` | no | +| [password](#input\_password) | Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file | `string` | `null` | no | +| [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Specifies whether Performance Insights are enabled | `bool` | `false` | no | +| [performance\_insights\_kms\_key\_id](#input\_performance\_insights\_kms\_key\_id) | The ARN for the KMS key to encrypt Performance Insights data. | `string` | `null` | no | +| [performance\_insights\_retention\_period](#input\_performance\_insights\_retention\_period) | The amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 (2 years). | `number` | `7` | no | +| [port](#input\_port) | The port on which the DB accepts connections | `string` | `null` | no | +| [publicly\_accessible](#input\_publicly\_accessible) | Bool to control if instance is publicly accessible | `bool` | `false` | no | +| [replica\_mode](#input\_replica\_mode) | Specifies whether the replica is in either mounted or open-read-only mode. This attribute is only supported by Oracle instances. Oracle replicas operate in open-read-only mode unless otherwise specified | `string` | `null` | no | +| [replicate\_source\_db](#input\_replicate\_source\_db) | Specifies that this resource is a Replicate database, and to use this value as the source database. This correlates to the identifier of another Amazon RDS Database to replicate. | `string` | `null` | no | +| [restore\_to\_point\_in\_time](#input\_restore\_to\_point\_in\_time) | Restore to a point in time (MySQL is NOT supported) | `map(string)` | `null` | no | +| [s3\_import](#input\_s3\_import) | Restore from a Percona Xtrabackup in S3 (only MySQL is supported) | `map(string)` | `null` | no | +| [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB instance is deleted | `bool` | `false` | no | +| [snapshot\_identifier](#input\_snapshot\_identifier) | Specifies whether or not to create this database from a snapshot. This correlates to the snapshot ID you'd find in the RDS console, e.g: rds:production-2015-06-26-06-05. | `string` | `null` | no | +| [storage\_encrypted](#input\_storage\_encrypted) | Specifies whether the DB instance is encrypted | `bool` | `true` | no | +| [storage\_throughput](#input\_storage\_throughput) | Storage throughput value for the DB instance. This setting applies only to the `gp3` storage type. See `notes` for limitations regarding this variable for `gp3` | `number` | `null` | no | +| [storage\_type](#input\_storage\_type) | One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not. If you specify 'io1' or 'gp3' , you must also include a value for the 'iops' parameter | `string` | `null` | no | +| [tags](#input\_tags) | A mapping of tags to assign to all resources | `map(string)` | `{}` | no | +| [timeouts](#input\_timeouts) | Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times | `map(string)` | `{}` | no | +| [timezone](#input\_timezone) | Time zone of the DB instance. timezone is currently only supported by Microsoft SQL Server. The timezone can only be set on creation. See MSSQL User Guide for more information. | `string` | `null` | no | +| [use\_identifier\_prefix](#input\_use\_identifier\_prefix) | Determines whether to use `identifier` as is or create a unique identifier beginning with `identifier` as the specified prefix | `bool` | `false` | no | +| [username](#input\_username) | Username for the master DB user | `string` | `null` | no | +| [vpc\_security\_group\_ids](#input\_vpc\_security\_group\_ids) | List of VPC security groups to associate | `list(string)` | `[]` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [db\_instance\_address](#output\_db\_instance\_address) | The address of the RDS instance | +| [db\_instance\_arn](#output\_db\_instance\_arn) | The ARN of the RDS instance | +| [db\_instance\_availability\_zone](#output\_db\_instance\_availability\_zone) | The availability zone of the RDS instance | +| [db\_instance\_ca\_cert\_identifier](#output\_db\_instance\_ca\_cert\_identifier) | Specifies the identifier of the CA certificate for the DB instance | +| [db\_instance\_cloudwatch\_log\_groups](#output\_db\_instance\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | +| [db\_instance\_domain](#output\_db\_instance\_domain) | The ID of the Directory Service Active Directory domain the instance is joined to | +| [db\_instance\_domain\_iam\_role\_name](#output\_db\_instance\_domain\_iam\_role\_name) | The name of the IAM role to be used when making API calls to the Directory Service. | +| [db\_instance\_endpoint](#output\_db\_instance\_endpoint) | The connection endpoint | +| [db\_instance\_engine](#output\_db\_instance\_engine) | The database engine | +| [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | +| [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | +| [db\_instance\_id](#output\_db\_instance\_id) | The RDS instance ID | +| [db\_instance\_name](#output\_db\_instance\_name) | The database name | +| [db\_instance\_password](#output\_db\_instance\_password) | The master password | +| [db\_instance\_port](#output\_db\_instance\_port) | The database port | +| [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | +| [db\_instance\_status](#output\_db\_instance\_status) | The RDS instance status | +| [db\_instance\_username](#output\_db\_instance\_username) | The master username for the database | +| [enhanced\_monitoring\_iam\_role\_arn](#output\_enhanced\_monitoring\_iam\_role\_arn) | The Amazon Resource Name (ARN) specifying the monitoring role | +| [enhanced\_monitoring\_iam\_role\_name](#output\_enhanced\_monitoring\_iam\_role\_name) | The name of the monitoring role | + diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/main.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/main.tf new file mode 100644 index 000000000..e9ef33ec0 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/main.tf @@ -0,0 +1,189 @@ +locals { + monitoring_role_arn = var.create_monitoring_role ? aws_iam_role.enhanced_monitoring[0].arn : var.monitoring_role_arn + + final_snapshot_identifier = var.skip_final_snapshot ? null : "${var.final_snapshot_identifier_prefix}-${var.identifier}-${try(random_id.snapshot_identifier[0].hex, "")}" + + identifier = var.use_identifier_prefix ? null : var.identifier + identifier_prefix = var.use_identifier_prefix ? "${var.identifier}-" : null + + monitoring_role_name = var.monitoring_role_use_name_prefix ? null : var.monitoring_role_name + monitoring_role_name_prefix = var.monitoring_role_use_name_prefix ? "${var.monitoring_role_name}-" : null + + # Replicas will use source metadata + username = var.replicate_source_db != null ? null : var.username + password = var.replicate_source_db != null ? null : var.password + engine = var.replicate_source_db != null ? null : var.engine + engine_version = var.replicate_source_db != null ? null : var.engine_version +} + +# Ref. https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces +data "aws_partition" "current" {} + +resource "random_id" "snapshot_identifier" { + count = var.create && !var.skip_final_snapshot ? 1 : 0 + + keepers = { + id = var.identifier + } + + byte_length = 4 +} + +resource "aws_db_instance" "this" { + count = var.create ? 1 : 0 + + identifier = local.identifier + identifier_prefix = local.identifier_prefix + + engine = local.engine + engine_version = local.engine_version + instance_class = var.instance_class + allocated_storage = var.allocated_storage + storage_type = var.storage_type + storage_encrypted = var.storage_encrypted + kms_key_id = var.kms_key_id + license_model = var.license_model + + name = var.db_name + username = local.username + password = local.password + port = var.port + domain = var.domain + domain_iam_role_name = var.domain_iam_role_name + iam_database_authentication_enabled = var.iam_database_authentication_enabled + + vpc_security_group_ids = var.vpc_security_group_ids + db_subnet_group_name = var.db_subnet_group_name + parameter_group_name = var.parameter_group_name + option_group_name = var.option_group_name + # network_type = var.network_type + + availability_zone = var.availability_zone + multi_az = var.multi_az + iops = var.iops + # storage_throughput = var.storage_throughput + publicly_accessible = var.publicly_accessible + ca_cert_identifier = var.ca_cert_identifier + + allow_major_version_upgrade = var.allow_major_version_upgrade + auto_minor_version_upgrade = var.auto_minor_version_upgrade + apply_immediately = var.apply_immediately + maintenance_window = var.maintenance_window + + snapshot_identifier = var.snapshot_identifier + copy_tags_to_snapshot = var.copy_tags_to_snapshot + skip_final_snapshot = var.skip_final_snapshot + final_snapshot_identifier = local.final_snapshot_identifier + + performance_insights_enabled = var.performance_insights_enabled + performance_insights_retention_period = var.performance_insights_enabled ? var.performance_insights_retention_period : null + performance_insights_kms_key_id = var.performance_insights_enabled ? var.performance_insights_kms_key_id : null + + replicate_source_db = var.replicate_source_db + replica_mode = var.replica_mode + backup_retention_period = var.backup_retention_period + backup_window = var.backup_window + max_allocated_storage = var.max_allocated_storage + monitoring_interval = var.monitoring_interval + monitoring_role_arn = var.monitoring_interval > 0 ? local.monitoring_role_arn : null + + character_set_name = var.character_set_name + timezone = var.timezone + enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports + + deletion_protection = var.deletion_protection + delete_automated_backups = var.delete_automated_backups + + dynamic "restore_to_point_in_time" { + for_each = var.restore_to_point_in_time != null ? [var.restore_to_point_in_time] : [] + + content { + restore_time = lookup(restore_to_point_in_time.value, "restore_time", null) + # source_db_instance_automated_backups_arn = lookup(restore_to_point_in_time.value, "source_db_instance_automated_backups_arn", null) + source_db_instance_identifier = lookup(restore_to_point_in_time.value, "source_db_instance_identifier", null) + source_dbi_resource_id = lookup(restore_to_point_in_time.value, "source_dbi_resource_id", null) + use_latest_restorable_time = lookup(restore_to_point_in_time.value, "use_latest_restorable_time", null) + } + } + + dynamic "s3_import" { + for_each = var.s3_import != null ? [var.s3_import] : [] + + content { + source_engine = "mysql" + source_engine_version = s3_import.value.source_engine_version + bucket_name = s3_import.value.bucket_name + bucket_prefix = lookup(s3_import.value, "bucket_prefix", null) + ingestion_role = s3_import.value.ingestion_role + } + } + + tags = var.tags + + depends_on = [aws_cloudwatch_log_group.this] + + timeouts { + create = lookup(var.timeouts, "create", null) + delete = lookup(var.timeouts, "delete", null) + update = lookup(var.timeouts, "update", null) + } + lifecycle { + prevent_destroy = true + ignore_changes = ["iops","identifier"] + } + +} + +################################################################################ +# CloudWatch Log Group +################################################################################ + +resource "aws_cloudwatch_log_group" "this" { + for_each = toset([for log in var.enabled_cloudwatch_logs_exports : log if var.create && var.create_cloudwatch_log_group]) + + name = "/aws/rds/instance/${var.identifier}/${each.value}" + retention_in_days = var.cloudwatch_log_group_retention_in_days + kms_key_id = var.cloudwatch_log_group_kms_key_id + + tags = var.tags +} + +################################################################################ +# Enhanced monitoring +################################################################################ + +data "aws_iam_policy_document" "enhanced_monitoring" { + statement { + actions = [ + "sts:AssumeRole", + ] + + principals { + type = "Service" + identifiers = ["monitoring.rds.amazonaws.com"] + } + } +} + +resource "aws_iam_role" "enhanced_monitoring" { + count = var.create_monitoring_role ? 1 : 0 + + name = local.monitoring_role_name + name_prefix = local.monitoring_role_name_prefix + assume_role_policy = data.aws_iam_policy_document.enhanced_monitoring.json + description = var.monitoring_role_description + + tags = merge( + { + "Name" = format("%s", var.monitoring_role_name) + }, + var.tags, + ) +} + +resource "aws_iam_role_policy_attachment" "enhanced_monitoring" { + count = var.create_monitoring_role ? 1 : 0 + + role = aws_iam_role.enhanced_monitoring[0].name + policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonRDSEnhancedMonitoringRole" +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/outputs.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/outputs.tf new file mode 100644 index 000000000..025aae0d0 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/outputs.tf @@ -0,0 +1,105 @@ +output "enhanced_monitoring_iam_role_name" { + description = "The name of the monitoring role" + value = try(aws_iam_role.enhanced_monitoring[0].name, "") +} + +output "enhanced_monitoring_iam_role_arn" { + description = "The Amazon Resource Name (ARN) specifying the monitoring role" + value = try(aws_iam_role.enhanced_monitoring[0].arn, "") +} + +output "db_instance_address" { + description = "The address of the RDS instance" + value = try(aws_db_instance.this[0].address, "") +} + +output "db_instance_arn" { + description = "The ARN of the RDS instance" + value = try(aws_db_instance.this[0].arn, "") +} + +output "db_instance_availability_zone" { + description = "The availability zone of the RDS instance" + value = try(aws_db_instance.this[0].availability_zone, "") +} + +output "db_instance_endpoint" { + description = "The connection endpoint" + value = try(aws_db_instance.this[0].endpoint, "") +} + +output "db_instance_engine" { + description = "The database engine" + value = try(aws_db_instance.this[0].engine, "") +} + +output "db_instance_engine_version_actual" { + description = "The running version of the database" + value = try(aws_db_instance.this[0].engine_version_actual, "") +} + +output "db_instance_hosted_zone_id" { + description = "The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record)" + value = try(aws_db_instance.this[0].hosted_zone_id, "") +} + +output "db_instance_id" { + description = "The RDS instance ID" + value = try(aws_db_instance.this[0].id, "") +} + +output "db_instance_resource_id" { + description = "The RDS Resource ID of this instance" + value = try(aws_db_instance.this[0].resource_id, "") +} + +output "db_instance_status" { + description = "The RDS instance status" + value = try(aws_db_instance.this[0].status, "") +} + +output "db_instance_name" { + description = "The database name" + value = try(aws_db_instance.this[0].name, "") +} + +output "db_instance_username" { + description = "The master username for the database" + value = try(aws_db_instance.this[0].username, "") + sensitive = true +} + +output "db_instance_port" { + description = "The database port" + value = try(aws_db_instance.this[0].port, "") +} + +output "db_instance_ca_cert_identifier" { + description = "Specifies the identifier of the CA certificate for the DB instance" + value = try(aws_db_instance.this[0].ca_cert_identifier, "") +} + +output "db_instance_domain" { + description = "The ID of the Directory Service Active Directory domain the instance is joined to" + value = try(aws_db_instance.this[0].domain, "") +} + +output "db_instance_domain_iam_role_name" { + description = "The name of the IAM role to be used when making API calls to the Directory Service. " + value = try(aws_db_instance.this[0].domain_iam_role_name, "") +} + +output "db_instance_password" { + description = "The master password" + value = try(aws_db_instance.this[0].password, "") + sensitive = true +} + +################################################################################ +# CloudWatch Log Group +################################################################################ + +output "db_instance_cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = aws_cloudwatch_log_group.this +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/variables.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/variables.tf new file mode 100644 index 000000000..00323c788 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/variables.tf @@ -0,0 +1,381 @@ +variable "create" { + description = "Whether to create this resource or not?" + type = bool + default = true +} + +variable "identifier" { + description = "The name of the RDS instance" + type = string +} + +variable "use_identifier_prefix" { + description = "Determines whether to use `identifier` as is or create a unique identifier beginning with `identifier` as the specified prefix" + type = bool + default = false +} + +variable "allocated_storage" { + description = "The allocated storage in gigabytes" + type = string + default = null +} + +variable "storage_type" { + description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not. If you specify 'io1' or 'gp3' , you must also include a value for the 'iops' parameter" + type = string + default = null +} + +variable "storage_throughput" { + description = "Storage throughput value for the DB instance. This setting applies only to the `gp3` storage type. See `notes` for limitations regarding this variable for `gp3`" + type = number + default = null +} + +variable "storage_encrypted" { + description = "Specifies whether the DB instance is encrypted" + type = bool + default = true +} + +variable "kms_key_id" { + description = "The ARN for the KMS encryption key. If creating an encrypted replica, set this to the destination KMS ARN. If storage_encrypted is set to true and kms_key_id is not specified the default KMS key created in your account will be used" + type = string + default = null +} + +variable "replicate_source_db" { + description = "Specifies that this resource is a Replicate database, and to use this value as the source database. This correlates to the identifier of another Amazon RDS Database to replicate." + type = string + default = null +} + +variable "license_model" { + description = "License model information for this DB instance. Optional, but required for some DB engines, i.e. Oracle SE1" + type = string + default = null +} + +variable "replica_mode" { + description = "Specifies whether the replica is in either mounted or open-read-only mode. This attribute is only supported by Oracle instances. Oracle replicas operate in open-read-only mode unless otherwise specified" + type = string + default = null +} + +variable "iam_database_authentication_enabled" { + description = "Specifies whether or mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled" + type = bool + default = false +} + +variable "domain" { + description = "The ID of the Directory Service Active Directory domain to create the instance in" + type = string + default = null +} + +variable "domain_iam_role_name" { + description = "(Required if domain is provided) The name of the IAM role to be used when making API calls to the Directory Service" + type = string + default = null +} + +variable "engine" { + description = "The database engine to use" + type = string + default = null +} + +variable "engine_version" { + description = "The engine version to use" + type = string + default = null +} + +variable "instance_class" { + description = "The instance type of the RDS instance" + type = string + default = null +} + +variable "db_name" { + description = "The DB name to create. If omitted, no database is created initially" + type = string + default = null +} + +variable "username" { + description = "Username for the master DB user" + type = string + default = null +} + +variable "password" { + description = "Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file" + type = string + default = null +} + +variable "port" { + description = "The port on which the DB accepts connections" + type = string + default = null +} + +variable "skip_final_snapshot" { + description = "Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB instance is deleted" + type = bool + default = false +} + +variable "snapshot_identifier" { + description = "Specifies whether or not to create this database from a snapshot. This correlates to the snapshot ID you'd find in the RDS console, e.g: rds:production-2015-06-26-06-05." + type = string + default = null +} + +variable "copy_tags_to_snapshot" { + description = "On delete, copy all Instance tags to the final snapshot" + type = bool + default = false +} + +variable "final_snapshot_identifier_prefix" { + description = "The name which is prefixed to the final snapshot on cluster destroy" + type = string + default = "final" +} + +variable "vpc_security_group_ids" { + description = "List of VPC security groups to associate" + type = list(string) + default = [] +} + +variable "db_subnet_group_name" { + description = "Name of DB subnet group. DB instance will be created in the VPC associated with the DB subnet group. If unspecified, will be created in the default VPC" + type = string + default = null +} + +variable "parameter_group_name" { + description = "Name of the DB parameter group to associate" + type = string + default = null +} + +variable "availability_zone" { + description = "The Availability Zone of the RDS instance" + type = string + default = null +} + +variable "multi_az" { + description = "Specifies if the RDS instance is multi-AZ" + type = bool + default = false +} + +variable "iops" { + description = "The amount of provisioned IOPS. Setting this implies a storage_type of 'io1' or `gp3`. See `notes` for limitations regarding this variable for `gp3`" + type = number + default = null +} + +variable "publicly_accessible" { + description = "Bool to control if instance is publicly accessible" + type = bool + default = false +} + +variable "monitoring_interval" { + description = "The 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." + type = number + default = 0 +} + +variable "monitoring_role_arn" { + description = "The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. Must be specified if monitoring_interval is non-zero." + type = string + default = null +} + +variable "monitoring_role_name" { + description = "Name of the IAM role which will be created when create_monitoring_role is enabled." + type = string + default = "rds-monitoring-role" +} + +variable "monitoring_role_use_name_prefix" { + description = "Determines whether to use `monitoring_role_name` as is or create a unique identifier beginning with `monitoring_role_name` as the specified prefix" + type = bool + default = false +} + +variable "monitoring_role_description" { + description = "Description of the monitoring IAM role" + type = string + default = null +} + +variable "create_monitoring_role" { + description = "Create IAM role with a defined name that permits RDS to send enhanced monitoring metrics to CloudWatch Logs." + type = bool + default = false +} + +variable "allow_major_version_upgrade" { + description = "Indicates that major version upgrades are allowed. Changing this parameter does not result in an outage and the change is asynchronously applied as soon as possible" + type = bool + default = false +} + +variable "auto_minor_version_upgrade" { + description = "Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window" + type = bool + default = true +} + +variable "apply_immediately" { + description = "Specifies whether any database modifications are applied immediately, or during the next maintenance window" + type = bool + default = false +} + +variable "maintenance_window" { + description = "The window to perform maintenance in. Syntax: 'ddd:hh24:mi-ddd:hh24:mi'. Eg: 'Mon:00:00-Mon:03:00'" + type = string + default = null +} + +variable "backup_retention_period" { + description = "The days to retain backups for" + type = number + default = null +} + +variable "backup_window" { + description = "The daily time range (in UTC) during which automated backups are created if they are enabled. Example: '09:46-10:16'. Must not overlap with maintenance_window" + type = string + default = null +} + +variable "tags" { + description = "A mapping of tags to assign to all resources" + type = map(string) + default = {} +} + +variable "option_group_name" { + description = "Name of the DB option group to associate." + type = string + default = null +} + +variable "timezone" { + description = "Time zone of the DB instance. timezone is currently only supported by Microsoft SQL Server. The timezone can only be set on creation. See MSSQL User Guide for more information." + type = string + default = null +} + +variable "character_set_name" { + description = "The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS and Collations and Character Sets for Microsoft SQL Server for more information. This can only be set on creation." + type = string + default = null +} + +variable "enabled_cloudwatch_logs_exports" { + description = "List of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be exported. Valid values (depending on engine): alert, audit, error, general, listener, slowquery, trace, postgresql (PostgreSQL), upgrade (PostgreSQL)." + type = list(string) + default = [] +} + +variable "timeouts" { + description = "Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times" + type = map(string) + default = {} +} + +variable "deletion_protection" { + description = "The database can't be deleted when this value is set to true." + type = bool + default = false +} + +variable "performance_insights_enabled" { + description = "Specifies whether Performance Insights are enabled" + type = bool + default = false +} + +variable "performance_insights_retention_period" { + description = "The amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 (2 years)." + type = number + default = 7 +} + +variable "performance_insights_kms_key_id" { + description = "The ARN for the KMS key to encrypt Performance Insights data." + type = string + default = null +} + +variable "max_allocated_storage" { + description = "Specifies the value for Storage Autoscaling" + type = number + default = 0 +} + +variable "ca_cert_identifier" { + description = "Specifies the identifier of the CA certificate for the DB instance" + type = string + default = null +} + +variable "delete_automated_backups" { + description = "Specifies whether to remove automated backups immediately after the DB instance is deleted" + type = bool + default = true +} + +variable "s3_import" { + description = "Restore from a Percona Xtrabackup in S3 (only MySQL is supported)" + type = map(string) + default = null +} + + +variable "restore_to_point_in_time" { + description = "Restore to a point in time (MySQL is NOT supported)" + type = map(string) + default = null +} + +variable "network_type" { + description = "The type of network stack" + type = string + default = null +} + +################################################################################ +# CloudWatch Log Group +################################################################################ + +variable "create_cloudwatch_log_group" { + description = "Determines whether a CloudWatch log group is created for each `enabled_cloudwatch_logs_exports`" + type = bool + default = false +} + +variable "cloudwatch_log_group_retention_in_days" { + description = "The number of days to retain CloudWatch logs for the DB instance" + type = number + default = 7 +} + +variable "cloudwatch_log_group_kms_key_id" { + description = "The ARN of the KMS Key to use when encrypting log data" + type = string + default = null +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/versions.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/versions.tf new file mode 100644 index 000000000..5ef7971da --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance/versions.tf @@ -0,0 +1,15 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + + } + + random = { + source = "hashicorp/random" + version = ">= 3.1" + } + } +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/main.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/main.tf new file mode 100644 index 000000000..046186f56 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/main.tf @@ -0,0 +1,9 @@ +resource "aws_db_instance_automated_backups_replication" "this" { + count = var.create ? 1 : 0 + + source_db_instance_arn = var.source_db_instance_arn + kms_key_id = var.kms_key_arn + pre_signed_url = var.pre_signed_url + retention_period = var.retention_period + +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/outputs.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/outputs.tf new file mode 100644 index 000000000..22f1a943c --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/outputs.tf @@ -0,0 +1,4 @@ +output "db_instance_automated_backups_replication_id" { + description = "The automated backups replication id" + value = try(aws_db_instance_automated_backups_replication.this[0].id, "") +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/variables.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/variables.tf new file mode 100644 index 000000000..ecac27ef1 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/variables.tf @@ -0,0 +1,29 @@ +variable "create" { + description = "Whether to create this resource or not?" + type = bool + default = true +} + +variable "kms_key_arn" { + description = "The KMS encryption key ARN in the destination AWS Region" + type = string + default = null +} + +variable "pre_signed_url" { + description = "A URL that contains a Signature Version 4 signed request for the StartDBInstanceAutomatedBackupsReplication action to be called in the AWS Region of the source DB instance" + type = string + default = null +} + +variable "retention_period" { + description = "The retention period for the replicated automated backups" + type = number + default = 7 +} + +variable "source_db_instance_arn" { + description = "The ARN of the source DB instance for the replicated automated backups" + type = string + default = null +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/versions.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/versions.tf new file mode 100644 index 000000000..f145ad159 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_instance_automated_backups_replication/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + } + } +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/README.md b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/README.md new file mode 100644 index 000000000..3e22ab0d4 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/README.md @@ -0,0 +1,47 @@ +# aws_db_option_group + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0 | +| [aws](#requirement\_aws) | >= 4.45 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 4.45 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_db_option_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_option_group) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [create](#input\_create) | Whether to create this resource or not? | `bool` | `true` | no | +| [engine\_name](#input\_engine\_name) | Specifies the name of the engine that this option group should be associated with | `string` | `null` | no | +| [major\_engine\_version](#input\_major\_engine\_version) | Specifies the major version of the engine that this option group should be associated with | `string` | `null` | no | +| [name](#input\_name) | The name of the option group | `string` | `""` | no | +| [option\_group\_description](#input\_option\_group\_description) | The description of the option group | `string` | `null` | no | +| [options](#input\_options) | A list of Options to apply | `any` | `[]` | no | +| [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(string)` | `{}` | no | +| [timeouts](#input\_timeouts) | Define maximum timeout for deletion of `aws_db_option_group` resource | `map(string)` | `{}` | no | +| [use\_name\_prefix](#input\_use\_name\_prefix) | Determines whether to use `name` as is or create a unique name beginning with `name` as the specified prefix | `bool` | `true` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [db\_option\_group\_arn](#output\_db\_option\_group\_arn) | The ARN of the db option group | +| [db\_option\_group\_id](#output\_db\_option\_group\_id) | The db option group id | + diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/main.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/main.tf new file mode 100644 index 000000000..6ae35840e --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/main.tf @@ -0,0 +1,50 @@ +locals { + name = var.use_name_prefix ? null : var.name + name_prefix = var.use_name_prefix ? "${var.name}-" : null + + description = coalesce(var.option_group_description, format("%s option group", var.name)) +} + +resource "aws_db_option_group" "this" { + count = var.create ? 1 : 0 + + name = local.name + name_prefix = local.name_prefix + option_group_description = local.description + engine_name = var.engine_name + major_engine_version = var.major_engine_version + + dynamic "option" { + for_each = var.options + content { + option_name = option.value.option_name + port = lookup(option.value, "port", null) + version = lookup(option.value, "version", null) + db_security_group_memberships = lookup(option.value, "db_security_group_memberships", null) + vpc_security_group_memberships = lookup(option.value, "vpc_security_group_memberships", null) + + dynamic "option_settings" { + for_each = lookup(option.value, "option_settings", []) + content { + name = lookup(option_settings.value, "name", null) + value = lookup(option_settings.value, "value", null) + } + } + } + } + + tags = merge( + var.tags, + { + "Name" = var.name + }, + ) + + timeouts { + delete = lookup(var.timeouts, "delete", null) + } + + lifecycle { + create_before_destroy = true + } +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/outputs.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/outputs.tf new file mode 100644 index 000000000..3a87a8f62 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/outputs.tf @@ -0,0 +1,9 @@ +output "db_option_group_id" { + description = "The db option group id" + value = try(aws_db_option_group.this[0].id, "") +} + +output "db_option_group_arn" { + description = "The ARN of the db option group" + value = try(aws_db_option_group.this[0].arn, "") +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/variables.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/variables.tf new file mode 100644 index 000000000..de4be1949 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/variables.tf @@ -0,0 +1,53 @@ +variable "create" { + description = "Whether to create this resource or not?" + type = bool + default = true +} + +variable "name" { + description = "The name of the option group" + type = string + default = "" +} + +variable "use_name_prefix" { + description = "Determines whether to use `name` as is or create a unique name beginning with `name` as the specified prefix" + type = bool + default = true +} + +variable "option_group_description" { + description = "The description of the option group" + type = string + default = null +} + +variable "engine_name" { + description = "Specifies the name of the engine that this option group should be associated with" + type = string + default = null +} + +variable "major_engine_version" { + description = "Specifies the major version of the engine that this option group should be associated with" + type = string + default = null +} + +variable "options" { + description = "A list of Options to apply" + type = any + default = [] +} + +variable "timeouts" { + description = "Define maximum timeout for deletion of `aws_db_option_group` resource" + type = map(string) + default = {} +} + +variable "tags" { + description = "A mapping of tags to assign to the resource" + type = map(string) + default = {} +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/versions.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/versions.tf new file mode 100644 index 000000000..f145ad159 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_option_group/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + } + } +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/README.md b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/README.md new file mode 100644 index 000000000..80d1ce59d --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/README.md @@ -0,0 +1,45 @@ +# aws_db_parameter_group + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0 | +| [aws](#requirement\_aws) | >= 4.45 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 4.45 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_db_parameter_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [create](#input\_create) | Whether to create this resource or not? | `bool` | `true` | no | +| [description](#input\_description) | The description of the DB parameter group | `string` | `null` | no | +| [family](#input\_family) | The family of the DB parameter group | `string` | `null` | no | +| [name](#input\_name) | The name of the DB parameter group | `string` | `""` | no | +| [parameters](#input\_parameters) | A list of DB parameter maps to apply | `list(map(string))` | `[]` | no | +| [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(string)` | `{}` | no | +| [use\_name\_prefix](#input\_use\_name\_prefix) | Determines whether to use `name` as is or create a unique name beginning with `name` as the specified prefix | `bool` | `true` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [db\_parameter\_group\_arn](#output\_db\_parameter\_group\_arn) | The ARN of the db parameter group | +| [db\_parameter\_group\_id](#output\_db\_parameter\_group\_id) | The db parameter group id | + diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/main.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/main.tf new file mode 100644 index 000000000..94acbe5ec --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/main.tf @@ -0,0 +1,35 @@ +locals { + name = var.use_name_prefix ? null : var.name + name_prefix = var.use_name_prefix ? "${var.name}-" : null + + description = coalesce(var.description, format("%s parameter group", var.name)) +} + +resource "aws_db_parameter_group" "this" { + count = var.create ? 1 : 0 + + name = local.name + name_prefix = local.name_prefix + description = local.description + family = var.family + + dynamic "parameter" { + for_each = var.parameters + content { + name = parameter.value.name + value = parameter.value.value + apply_method = lookup(parameter.value, "apply_method", null) + } + } + + tags = merge( + var.tags, + { + "Name" = var.name + }, + ) + + lifecycle { + create_before_destroy = true + } +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/outputs.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/outputs.tf new file mode 100644 index 000000000..e67ec7c8f --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/outputs.tf @@ -0,0 +1,9 @@ +output "db_parameter_group_id" { + description = "The db parameter group id" + value = try(aws_db_parameter_group.this[0].id, "") +} + +output "db_parameter_group_arn" { + description = "The ARN of the db parameter group" + value = try(aws_db_parameter_group.this[0].arn, "") +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/variables.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/variables.tf new file mode 100644 index 000000000..b7b7af9f8 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/variables.tf @@ -0,0 +1,41 @@ +variable "create" { + description = "Whether to create this resource or not?" + type = bool + default = true +} + +variable "name" { + description = "The name of the DB parameter group" + type = string + default = "" +} + +variable "use_name_prefix" { + description = "Determines whether to use `name` as is or create a unique name beginning with `name` as the specified prefix" + type = bool + default = true +} + +variable "description" { + description = "The description of the DB parameter group" + type = string + default = null +} + +variable "family" { + description = "The family of the DB parameter group" + type = string + default = null +} + +variable "parameters" { + description = "A list of DB parameter maps to apply" + type = list(map(string)) + default = [] +} + +variable "tags" { + description = "A mapping of tags to assign to the resource" + type = map(string) + default = {} +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/versions.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/versions.tf new file mode 100644 index 000000000..f145ad159 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_parameter_group/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + } + } +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/README.md b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/README.md new file mode 100644 index 000000000..e10d6c792 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/README.md @@ -0,0 +1,44 @@ +# aws_db_subnet_group + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0 | +| [aws](#requirement\_aws) | >= 4.45 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 4.45 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_db_subnet_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_subnet_group) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [create](#input\_create) | Whether to create this resource or not? | `bool` | `true` | no | +| [description](#input\_description) | The description of the DB subnet group | `string` | `null` | no | +| [name](#input\_name) | The name of the DB subnet group | `string` | `""` | no | +| [subnet\_ids](#input\_subnet\_ids) | A list of VPC subnet IDs | `list(string)` | `[]` | no | +| [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(string)` | `{}` | no | +| [use\_name\_prefix](#input\_use\_name\_prefix) | Determines whether to use `name` as is or create a unique name beginning with `name` as the specified prefix | `bool` | `true` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [db\_subnet\_group\_arn](#output\_db\_subnet\_group\_arn) | The ARN of the db subnet group | +| [db\_subnet\_group\_id](#output\_db\_subnet\_group\_id) | The db subnet group name | + diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/main.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/main.tf new file mode 100644 index 000000000..6eecd88ae --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/main.tf @@ -0,0 +1,22 @@ +locals { + name = var.use_name_prefix ? null : var.name + name_prefix = var.use_name_prefix ? "${var.name}-" : null + + description = coalesce(var.description, format("%s subnet group", var.name)) +} + +resource "aws_db_subnet_group" "this" { + count = var.create ? 1 : 0 + + name = local.name + name_prefix = local.name_prefix + description = local.description + subnet_ids = var.subnet_ids + + tags = merge( + var.tags, + { + "Name" = var.name + }, + ) +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/outputs.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/outputs.tf new file mode 100644 index 000000000..aa803a341 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/outputs.tf @@ -0,0 +1,9 @@ +output "db_subnet_group_id" { + description = "The db subnet group name" + value = try(aws_db_subnet_group.this[0].id, "") +} + +output "db_subnet_group_arn" { + description = "The ARN of the db subnet group" + value = try(aws_db_subnet_group.this[0].arn, "") +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/variables.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/variables.tf new file mode 100644 index 000000000..48185ab44 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/variables.tf @@ -0,0 +1,35 @@ +variable "create" { + description = "Whether to create this resource or not?" + type = bool + default = true +} + +variable "name" { + description = "The name of the DB subnet group" + type = string + default = "" +} + +variable "use_name_prefix" { + description = "Determines whether to use `name` as is or create a unique name beginning with `name` as the specified prefix" + type = bool + default = true +} + +variable "description" { + description = "The description of the DB subnet group" + type = string + default = null +} + +variable "subnet_ids" { + description = "A list of VPC subnet IDs" + type = list(string) + default = [] +} + +variable "tags" { + description = "A mapping of tags to assign to the resource" + type = map(string) + default = {} +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/versions.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/versions.tf new file mode 100644 index 000000000..f145ad159 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/modules/db_subnet_group/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + } + } +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/outputs.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/outputs.tf new file mode 100644 index 000000000..ace7495d7 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/outputs.tf @@ -0,0 +1,136 @@ +output "enhanced_monitoring_iam_role_name" { + description = "The name of the monitoring role" + value = module.db_instance.enhanced_monitoring_iam_role_name +} + +output "enhanced_monitoring_iam_role_arn" { + description = "The Amazon Resource Name (ARN) specifying the monitoring role" + value = module.db_instance.enhanced_monitoring_iam_role_arn +} + +output "db_instance_address" { + description = "The address of the RDS instance" + value = module.db_instance.db_instance_address +} + +output "db_instance_arn" { + description = "The ARN of the RDS instance" + value = module.db_instance.db_instance_arn +} + +output "db_instance_availability_zone" { + description = "The availability zone of the RDS instance" + value = module.db_instance.db_instance_availability_zone +} + +output "db_instance_endpoint" { + description = "The connection endpoint" + value = module.db_instance.db_instance_endpoint +} + +output "db_instance_engine" { + description = "The database engine" + value = module.db_instance.db_instance_engine +} + +output "db_instance_engine_version_actual" { + description = "The running version of the database" + value = module.db_instance.db_instance_engine_version_actual +} + +output "db_instance_hosted_zone_id" { + description = "The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record)" + value = module.db_instance.db_instance_hosted_zone_id +} + +output "db_instance_id" { + description = "The RDS instance ID" + value = module.db_instance.db_instance_id +} + +output "db_instance_resource_id" { + description = "The RDS Resource ID of this instance" + value = module.db_instance.db_instance_resource_id +} + +output "db_instance_status" { + description = "The RDS instance status" + value = module.db_instance.db_instance_status +} + +output "db_instance_name" { + description = "The database name" + value = module.db_instance.db_instance_name +} + +output "db_instance_username" { + description = "The master username for the database" + value = module.db_instance.db_instance_username + sensitive = true +} + +output "db_instance_password" { + description = "The database password (this password may be old, because Terraform doesn't track it after initial creation)" + value = local.password + sensitive = true +} + +output "db_instance_domain" { + description = "The ID of the Directory Service Active Directory domain the instance is joined to" + value = module.db_instance.db_instance_domain +} + +output "db_instance_domain_iam_role_name" { + description = "The name of the IAM role to be used when making API calls to the Directory Service. " + value = module.db_instance.db_instance_domain_iam_role_name +} + +output "db_instance_port" { + description = "The database port" + value = module.db_instance.db_instance_port +} + +output "db_instance_ca_cert_identifier" { + description = "Specifies the identifier of the CA certificate for the DB instance" + value = module.db_instance.db_instance_ca_cert_identifier +} + +output "db_subnet_group_id" { + description = "The db subnet group name" + value = module.db_subnet_group.db_subnet_group_id +} + +output "db_subnet_group_arn" { + description = "The ARN of the db subnet group" + value = module.db_subnet_group.db_subnet_group_arn +} + +output "db_parameter_group_id" { + description = "The db parameter group id" + value = module.db_parameter_group.db_parameter_group_id +} + +output "db_parameter_group_arn" { + description = "The ARN of the db parameter group" + value = module.db_parameter_group.db_parameter_group_arn +} + +# DB option group +output "db_option_group_id" { + description = "The db option group id" + value = module.db_option_group.db_option_group_id +} + +output "db_option_group_arn" { + description = "The ARN of the db option group" + value = module.db_option_group.db_option_group_arn +} + +################################################################################ +# CloudWatch Log Group +################################################################################ + +output "db_instance_cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.db_instance.db_instance_cloudwatch_log_groups +} diff --git a/modules/mysql/rds/0.1/terraform-aws-rds-master/variables.tf b/modules/mysql/rds/0.1/terraform-aws-rds-master/variables.tf new file mode 100644 index 000000000..a87b39b52 --- /dev/null +++ b/modules/mysql/rds/0.1/terraform-aws-rds-master/variables.tf @@ -0,0 +1,519 @@ +variable "identifier" { + description = "The name of the RDS instance" + type = string +} + +variable "instance_use_identifier_prefix" { + description = "Determines whether to use `identifier` as is or create a unique identifier beginning with `identifier` as the specified prefix" + type = bool + default = false +} + +variable "allocated_storage" { + description = "The allocated storage in gigabytes" + type = string + default = null +} + +variable "storage_type" { + description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), 'gp3' (new generation of general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'gp2' if not. If you specify 'io1' or 'gp3' , you must also include a value for the 'iops' parameter" + type = string + default = null +} + +variable "storage_throughput" { + description = "Storage throughput value for the DB instance. See `notes` for limitations regarding this variable for `gp3`" + type = number + default = null +} + +variable "storage_encrypted" { + description = "Specifies whether the DB instance is encrypted" + type = bool + default = true +} + +variable "kms_key_id" { + description = "The ARN for the KMS encryption key. If creating an encrypted replica, set this to the destination KMS ARN. If storage_encrypted is set to true and kms_key_id is not specified the default KMS key created in your account will be used. Be sure to use the full ARN, not a key alias." + type = string + default = null +} + +variable "replicate_source_db" { + description = "Specifies that this resource is a Replicate database, and to use this value as the source database. This correlates to the identifier of another Amazon RDS Database to replicate" + type = string + default = null +} + +variable "license_model" { + description = "License model information for this DB instance. Optional, but required for some DB engines, i.e. Oracle SE1" + type = string + default = null +} + +variable "replica_mode" { + description = "Specifies whether the replica is in either mounted or open-read-only mode. This attribute is only supported by Oracle instances. Oracle replicas operate in open-read-only mode unless otherwise specified" + type = string + default = null +} + +variable "iam_database_authentication_enabled" { + description = "Specifies whether or not the mappings of AWS Identity and Access Management (IAM) accounts to database accounts are enabled" + type = bool + default = false +} + +variable "domain" { + description = "The ID of the Directory Service Active Directory domain to create the instance in" + type = string + default = null +} + +variable "domain_iam_role_name" { + description = "(Required if domain is provided) The name of the IAM role to be used when making API calls to the Directory Service" + type = string + default = null +} + +variable "engine" { + description = "The database engine to use" + type = string + default = null +} + +variable "engine_version" { + description = "The engine version to use" + type = string + default = null +} + +variable "skip_final_snapshot" { + description = "Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB instance is deleted" + type = bool + default = false +} + +variable "snapshot_identifier" { + description = "Specifies whether or not to create this database from a snapshot. This correlates to the snapshot ID you'd find in the RDS console, e.g: rds:production-2015-06-26-06-05" + type = string + default = null +} + +variable "copy_tags_to_snapshot" { + description = "On delete, copy all Instance tags to the final snapshot" + type = bool + default = false +} + +variable "final_snapshot_identifier_prefix" { + description = "The name which is prefixed to the final snapshot on cluster destroy" + type = string + default = "final" +} + +variable "instance_class" { + description = "The instance type of the RDS instance" + type = string + default = null +} + +variable "db_name" { + description = "The DB name to create. If omitted, no database is created initially" + type = string + default = null +} + +variable "username" { + description = "Username for the master DB user" + type = string + default = null +} + +variable "password" { + description = <