From 6c9b4851aa9f4892163f0025ff93e0cd1372a987 Mon Sep 17 00:00:00 2001 From: mbroers Date: Fri, 17 Jun 2022 10:08:14 -0500 Subject: [PATCH] Add `timezone` variable for mssql (#141) * adding timezone variable for mssql * Auto Format * Update variables.tf Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com> * Auto Format * Add versions.tf to examples/complete * Remove unused null provider * Auto Format * Bump examples/complete versions, omit patch version * Reduce examples/complete versions Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com> Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com> --- .github/renovate.json | 2 +- README.md | 2 +- docs/terraform.md | 2 +- examples/complete/fixtures.us-east-2.tfvars | 4 ++-- examples/complete/main.tf | 4 ++-- examples/complete/versions.tf | 10 ++++++++++ main.tf | 1 + variables.tf | 6 ++++++ versions.tf | 4 ---- 9 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 examples/complete/versions.tf diff --git a/.github/renovate.json b/.github/renovate.json index ae4f0aa..a780298 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -4,9 +4,9 @@ ":preserveSemverRanges" ], "labels": ["auto-update"], + "dependencyDashboardAutoclose": true, "enabledManagers": ["terraform"], "terraform": { "ignorePaths": ["**/context.tf", "examples/**"] } } - diff --git a/README.md b/README.md index 4bd1488..aaa2df8 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,6 @@ Available targets: |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.0 | | [aws](#requirement\_aws) | >= 2.0 | -| [null](#requirement\_null) | >= 2.0 | ## Providers @@ -322,6 +321,7 @@ Available targets: | [subnet\_ids](#input\_subnet\_ids) | List of subnet IDs for the DB. DB instance will be created in the VPC associated with the DB subnet group provisioned using the subnet IDs. Specify one of `subnet_ids`, `db_subnet_group_name` or `availability_zone` | `list(string)` | `[]` | no | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | | [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | 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](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone) for more information. | `string` | `null` | no | | [vpc\_id](#input\_vpc\_id) | VPC ID the DB instance will be created in | `string` | n/a | yes | ## Outputs diff --git a/docs/terraform.md b/docs/terraform.md index 74ab246..c6547e0 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -5,7 +5,6 @@ |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.0 | | [aws](#requirement\_aws) | >= 2.0 | -| [null](#requirement\_null) | >= 2.0 | ## Providers @@ -107,6 +106,7 @@ | [subnet\_ids](#input\_subnet\_ids) | List of subnet IDs for the DB. DB instance will be created in the VPC associated with the DB subnet group provisioned using the subnet IDs. Specify one of `subnet_ids`, `db_subnet_group_name` or `availability_zone` | `list(string)` | `[]` | no | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | | [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | 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](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone) for more information. | `string` | `null` | no | | [vpc\_id](#input\_vpc\_id) | VPC ID the DB instance will be created in | `string` | n/a | yes | ## Outputs diff --git a/examples/complete/fixtures.us-east-2.tfvars b/examples/complete/fixtures.us-east-2.tfvars index 486641d..ea7886f 100644 --- a/examples/complete/fixtures.us-east-2.tfvars +++ b/examples/complete/fixtures.us-east-2.tfvars @@ -28,9 +28,9 @@ allocated_storage = 5 engine = "mysql" -engine_version = "5.7.17" +engine_version = "5.7" -major_engine_version = "5.7" +major_engine_version = "5" instance_class = "db.t2.small" diff --git a/examples/complete/main.tf b/examples/complete/main.tf index d3fcec4..5c71c87 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -4,7 +4,7 @@ provider "aws" { module "vpc" { source = "cloudposse/vpc/aws" - version = "0.21.1" + version = "0.28.1" cidr_block = "172.16.0.0/16" @@ -13,7 +13,7 @@ module "vpc" { module "subnets" { source = "cloudposse/dynamic-subnets/aws" - version = "0.38.0" + version = "0.40.1" availability_zones = var.availability_zones vpc_id = module.vpc.vpc_id diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf new file mode 100644 index 0000000..5b2c49b --- /dev/null +++ b/examples/complete/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 0.13.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 2.0" + } + } +} diff --git a/main.tf b/main.tf index 437f5dc..2c3df2d 100644 --- a/main.tf +++ b/main.tf @@ -67,6 +67,7 @@ resource "aws_db_instance" "default" { deletion_protection = var.deletion_protection final_snapshot_identifier = length(var.final_snapshot_identifier) > 0 ? var.final_snapshot_identifier : module.final_snapshot_label.id replicate_source_db = var.replicate_source_db + timezone = var.timezone iam_database_authentication_enabled = var.iam_database_authentication_enabled enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports diff --git a/variables.tf b/variables.tf index 51f6c07..f548f20 100644 --- a/variables.tf +++ b/variables.tf @@ -329,3 +329,9 @@ 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 (if replicating within a single region) or ARN of the Amazon RDS Database to replicate (if replicating cross-region). Note that if you are creating a cross-region replica of an encrypted database you will also need to specify a `kms_key_id`. See [DB Instance Replication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Replication.html) and [Working with PostgreSQL and MySQL Read Replicas](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html) for more information on using Replication." default = null } + +variable "timezone" { + type = string + 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](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone) for more information." + default = null +} diff --git a/versions.tf b/versions.tf index 971ae24..5b2c49b 100644 --- a/versions.tf +++ b/versions.tf @@ -6,9 +6,5 @@ terraform { source = "hashicorp/aws" version = ">= 2.0" } - null = { - source = "hashicorp/null" - version = ">= 2.0" - } } }