From 3525c3f897824bf9c29247b6f56ae721af2d7f47 Mon Sep 17 00:00:00 2001 From: Zachary Winnerman <98712682+zwinnerman-fleetdm@users.noreply.github.com> Date: Tue, 20 Sep 2022 17:09:24 -0400 Subject: [PATCH] Fix applies for rds terraform (#7862) * Fix applies for rds terraform * fixup --- .../dogfood/terraform/aws/.terraform.lock.hcl | 61 +++++++++++++++++++ infrastructure/dogfood/terraform/aws/rds.tf | 5 +- .../dogfood/terraform/aws/variables.tf | 4 ++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 infrastructure/dogfood/terraform/aws/.terraform.lock.hcl diff --git a/infrastructure/dogfood/terraform/aws/.terraform.lock.hcl b/infrastructure/dogfood/terraform/aws/.terraform.lock.hcl new file mode 100644 index 0000000000..9d08a8d672 --- /dev/null +++ b/infrastructure/dogfood/terraform/aws/.terraform.lock.hcl @@ -0,0 +1,61 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "3.63.0" + constraints = ">= 3.30.0, >= 3.63.0, 3.63.0" + hashes = [ + "h1:v9aPF3aaBpk0uSO5pfggYJKGgP/Ur28hZRJs1jS+ttI=", + "zh:42c6c98b294953a4e1434a331251e539f5372bf6779bd61ab5df84cac0545287", + "zh:5493773762a470889c9a23db97582d3a82035847c8d3bd13323b4c3012abf325", + "zh:550d22ff9fed4d817a922e7b84bd9d1f2ef8d3afa00832cf66b8cd5f0e6dc748", + "zh:632cb5e2d9d5041875f57174236eafe5b05dbf26750c1041ab57eb08c5369fe2", + "zh:7cfeaf5bde1b28bd010415af1f3dc494680a8374f1a26ec19db494d99938cc4e", + "zh:99d871606b67c8aefce49007315de15736b949c09a9f8f29ad8af1e9ce383ed3", + "zh:c4fc8539ffe90df5c7ae587fde495fac6bc0186fec2f2713a8988a619cef265f", + "zh:d0a26493206575c99ca221d78fe64f96a8fbcebe933af92eea6b39168c1f1c1d", + "zh:e156fdc964fdd4a7586ec15629e20d2b06295b46b4962428006e088145db07d6", + "zh:eb04fc80f652b5c92f76822f0fec1697581543806244068506aed69e1bb9b2af", + "zh:f5638a533cf9444f7d02b5527446cdbc3b2eab8bcc4ec4b0ca32035fe6f479d3", + ] +} + +provider "registry.terraform.io/hashicorp/random" { + version = "3.4.3" + constraints = ">= 2.2.0" + hashes = [ + "h1:xZGZf18JjMS06pFa4NErzANI98qi59SEcBsOcS2P2yQ=", + "zh:41c53ba47085d8261590990f8633c8906696fa0a3c4b384ff6a7ecbf84339752", + "zh:59d98081c4475f2ad77d881c4412c5129c56214892f490adf11c7e7a5a47de9b", + "zh:686ad1ee40b812b9e016317e7f34c0d63ef837e084dea4a1f578f64a6314ad53", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:84103eae7251384c0d995f5a257c72b0096605048f757b749b7b62107a5dccb3", + "zh:8ee974b110adb78c7cd18aae82b2729e5124d8f115d484215fd5199451053de5", + "zh:9dd4561e3c847e45de603f17fa0c01ae14cae8c4b7b4e6423c9ef3904b308dda", + "zh:bb07bb3c2c0296beba0beec629ebc6474c70732387477a65966483b5efabdbc6", + "zh:e891339e96c9e5a888727b45b2e1bb3fcbdfe0fd7c5b4396e4695459b38c8cb1", + "zh:ea4739860c24dfeaac6c100b2a2e357106a89d18751f7693f3c31ecf6a996f8d", + "zh:f0c76ac303fd0ab59146c39bc121c5d7d86f878e9a69294e29444d4c653786f8", + "zh:f143a9a5af42b38fed328a161279906759ff39ac428ebcfe55606e05e1518b93", + ] +} + +provider "registry.terraform.io/hashicorp/tls" { + version = "3.3.0" + constraints = "3.3.0" + hashes = [ + "h1:xx/b39Q9FVZSlDc97rlDmQ9dNaaxFFyVzP9kV+47z28=", + "zh:16140e8cc880f95b642b6bf6564f4e98760e9991864aacc8e21273423571e561", + "zh:16338b8457759c97fdd73153965d6063b037f2954fd512e569fcdc42b7fef743", + "zh:348bd44b7cd0c6d663bba36cecb474c17635a8f22b02187d034b8e57a8729c5a", + "zh:3832ac73c2335c0fac26138bacbd18160efaa3f06c562869acc129e814e27f86", + "zh:756d1e60690d0164eee9c93b498b4c8beabbfc1d8b7346cb6d2fa719055089d6", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:93b911bcddba8dadc5339edb004c8019c230ea67477c73c4f741c236dd9511b1", + "zh:c0c4e5742e8ac004c507540423db52af3f44b8ec04443aa8e14669340819344f", + "zh:c78296a1dff8ccd5d50203aac353422fc18d425072ba947c88cf5b46de7d32d2", + "zh:d7143f444e0f7e6cd67fcaf080398b4f1487cf05de3e0e79af6c14e22812e38b", + "zh:e600ac76b118816ad72132eee4c22ab5fc044f67c3babc54537e1fc1ad53d295", + "zh:fca07af5f591e12d2dc178a550da69a4847bdb34f8180a5b8e04fde6b528cf99", + ] +} diff --git a/infrastructure/dogfood/terraform/aws/rds.tf b/infrastructure/dogfood/terraform/aws/rds.tf index 69a7d61bd4..c4dee9f380 100644 --- a/infrastructure/dogfood/terraform/aws/rds.tf +++ b/infrastructure/dogfood/terraform/aws/rds.tf @@ -79,7 +79,7 @@ module "aurora_mysql" { database_name = var.database_name enable_http_endpoint = false backup_retention_period = var.rds_backup_retention_period - snapshot_identifier = "arn:aws:rds:us-east-2:160035666661:cluster-snapshot:zwinnerman-2022-09-12-pre-mysql8" + snapshot_identifier = var.rds_initial_snapshot #performance_insights_enabled = true vpc_id = module.vpc.vpc_id @@ -105,6 +105,9 @@ module "aurora_mysql" { db_parameter_group_name = aws_db_parameter_group.example_mysql.id db_cluster_parameter_group_name = aws_rds_cluster_parameter_group.example_mysql.id + lifecycle { + ignore_changes = [snapshot_identifier] + } } resource "aws_db_parameter_group" "example_mysql" { diff --git a/infrastructure/dogfood/terraform/aws/variables.tf b/infrastructure/dogfood/terraform/aws/variables.tf index f5db29ae04..39805318bf 100644 --- a/infrastructure/dogfood/terraform/aws/variables.tf +++ b/infrastructure/dogfood/terraform/aws/variables.tf @@ -125,3 +125,7 @@ variable "extra_security_group_cidrs" { error_message = "The extra security groups must be a list of valid CIDRs." } } + +variable "rds_initial_snapshot" { + default = null +}