From 5b73934f31683b877391cfe441ec9845a8b186d1 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:45:16 +0800 Subject: [PATCH] update aws and cloudflare providers --- .gitignore | 3 ++ main.tf | 8 ++-- test/.terraform.lock.hcl | 96 ++++++++++++++++++++-------------------- test/test.tf | 4 +- versions.tf | 9 ++-- vpc.tf | 14 +++--- 6 files changed, 71 insertions(+), 63 deletions(-) diff --git a/.gitignore b/.gitignore index 08fde58..1a219ea 100644 --- a/.gitignore +++ b/.gitignore @@ -33,5 +33,8 @@ override.tf.json .terraformrc terraform.rc +# Since this is a module, we don't want to retain version locks +.terraform.lock.hcl + # IDE configuration .idea/ diff --git a/main.tf b/main.tf index 393f738..cede124 100644 --- a/main.tf +++ b/main.tf @@ -155,7 +155,7 @@ module "ecs-service-cloudwatch-dashboard" { count = var.create_dashboard ? 1 : 0 source = "silinternational/ecs-service-cloudwatch-dashboard/aws" - version = "~> 3.0.1" + version = "~> 3.1" cluster_name = module.ecsasg.ecs_cluster_name dashboard_name = "${local.app_name_and_env}-${local.region}" @@ -176,7 +176,7 @@ resource "random_password" "db_root" { * Create an RDS database */ module "rds" { - source = "github.com/silinternational/terraform-modules//aws/rds/mariadb?ref=8.8.0" + source = "github.com/silinternational/terraform-modules//aws/rds/mariadb?ref=8.13.3" app_name = var.app_name app_env = local.app_env @@ -198,7 +198,7 @@ module "rds" { module "adminer" { count = var.create_adminer ? 1 : 0 source = "silinternational/adminer/aws" - version = "1.0.2" + version = "~> 1.1" adminer_default_server = module.rds.address app_name = var.app_name @@ -217,7 +217,7 @@ module "adminer" { * Create new ecs service */ module "ecs" { - source = "github.com/silinternational/terraform-modules//aws/ecs/service-only?ref=8.8.0" + source = "github.com/silinternational/terraform-modules//aws/ecs/service-only?ref=8.13.3" cluster_id = module.ecsasg.ecs_cluster_id service_name = var.app_name service_env = local.app_env diff --git a/test/.terraform.lock.hcl b/test/.terraform.lock.hcl index 7fb8352..cea42ec 100644 --- a/test/.terraform.lock.hcl +++ b/test/.terraform.lock.hcl @@ -2,48 +2,48 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/cloudflare/cloudflare" { - version = "3.35.0" - constraints = "~> 3.7" + version = "4.38.0" + constraints = ">= 2.0.0, >= 3.0.0, ~> 4.0, < 4.39.0, < 5.0.0" hashes = [ - "h1:SFvdgX5bTGhOTMhywgjSOWlkET2el7STxdUSzxjz2pc=", - "zh:13aabc00fee823422831bcc870227650cc765fc4c9622074d24d6d62a4ac0e37", - "zh:1544405f0ea6b388dad7eb25c434427b2682417396da9186e1b33551e6b4adff", - "zh:5d58394cb8e71bd4bf6ef0135f1ca6a4ad2cec937f3731b224125eb34ee059f7", - "zh:648596ed545ed01ae757d5a0b37c20e8050cfb51d42e9a2c82fcc94d883ff11d", - "zh:68d75e14eef4f073faa975ed6baf4db7e0e1f2fc61a4e54fd95325df42793810", + "h1:HTomuzocukpNLwtWzeSF3yteCVsyVKbwKmN66u9iPac=", + "zh:171ab67cccceead4514fafb2d39e4e708a90cce79000aaf3c29aab7ed4457071", + "zh:18aa7228447baaaefc49a43e8eff970817a7491a63d8937e796357a3829dd979", + "zh:2cbaab6092e81ba6f41fa60a50f14e980c8ec327ee11d0b21f16a478be4b7567", + "zh:53b8e49c06f5b31a8c681f8c0669cf43e78abe71657b8182a221d096bb514965", + "zh:6037cfc60b4b647aabae155fcb46d649ed7c650e0287f05db52b2068f1e27c8a", + "zh:62460982ce1a869eebfca675603fbbd50416cf6b69459fb855bfbe5ae2b97607", + "zh:65f6f3a8470917b6398baa5eb4f74b3932b213eac7c0202798bfad6fd1ee17df", "zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f", - "zh:9916cc626fef57428c4c60db7897b34068c65639b68482e94f62d97d773d64bc", - "zh:9c8c9f369eb30e7360a0ebd7918e4846ca4d5bca430b861fdbde7522a3146459", - "zh:a40e244688bbcb6f1a771e6ea89fb0b0b7bb53be3fab718abc66b3593e0f8133", - "zh:cc5a6191aa8713275550ff2b6adda6e6d56e4780c9cbe3d1da1dc23ea893bfff", - "zh:d1dd435780e8c7e79bff26b46a76df0e123971849355ad17877d1e24dc5953c3", - "zh:d751fc72f2833f2bdb897fa89de2bb5b6efbad1e648896642f0e6fe5cde789c8", - "zh:dfc4c90b3605ec1bb7cc7a9f1fb1b67235578bdd6b9be78e7b3516b55d0422db", - "zh:e6101a80fe24e2df3ab60152458ff1666a4a1befc87c62e459a219cdbb53e6df", - "zh:e9bcf26c44dd231f74703b6a6717470021a3ba7e1d7531dcf7287a6441300e27", + "zh:8b5cebe64bf04105a49178a165b6a8800a9a33bae6767143a47fe4977755f805", + "zh:a5596635db0993ee3c3060fbc2227d91b239466e96d2d82642625a5aa2486988", + "zh:b3a9c63038441f13c311fd4b2c7e69e571445e5a7365a20c7cc9046b7e6c8aba", + "zh:b585e7e4d7648a540b14b9182819214896ca9337729eeb1f2034833b17db754d", + "zh:d2c3c545318ac8542369e9fc8228e29ee585febdf203a450fad3e0eded71ce02", + "zh:e95dd2d6c3525073af47d47b763cb81b6a51b20cabf76f789c69328922da9ecf", + "zh:eee6e590b36d6c6168a7daae8afa74a8721fd7aa9f62a710f04a311975100722", ] } provider "registry.terraform.io/hashicorp/aws" { - version = "4.67.0" - constraints = ">= 2.0.0, >= 4.0.0, ~> 4.0, < 5.0.0" + version = "5.72.0" + constraints = ">= 3.0.0, >= 4.0.0, >= 5.0.0, ~> 5.0, < 6.0.0" hashes = [ - "h1:dCRc4GqsyfqHEMjgtlM1EympBcgTmcTkWaJmtd91+KA=", - "zh:0843017ecc24385f2b45f2c5fce79dc25b258e50d516877b3affee3bef34f060", - "zh:19876066cfa60de91834ec569a6448dab8c2518b8a71b5ca870b2444febddac6", - "zh:24995686b2ad88c1ffaa242e36eee791fc6070e6144f418048c4ce24d0ba5183", - "zh:4a002990b9f4d6d225d82cb2fb8805789ffef791999ee5d9cb1fef579aeff8f1", - "zh:559a2b5ace06b878c6de3ecf19b94fbae3512562f7a51e930674b16c2f606e29", - "zh:6a07da13b86b9753b95d4d8218f6dae874cf34699bca1470d6effbb4dee7f4b7", - "zh:768b3bfd126c3b77dc975c7c0e5db3207e4f9997cf41aa3385c63206242ba043", - "zh:7be5177e698d4b547083cc738b977742d70ed68487ce6f49ecd0c94dbf9d1362", - "zh:8b562a818915fb0d85959257095251a05c76f3467caa3ba95c583ba5fe043f9b", + "h1:CCf0c/ycpptDMDvQhvxkpM9JTb6fsY/uhVIqw3VxeT0=", + "zh:1a5e979b0c68063e1cdde592864fbfd0566f81c2125f811e96c9d85815d9a5fb", + "zh:2c1cd5f43748ab9cf4127fcc7cb73535b01ebb0408b14edf4f0e9475521ab8ea", + "zh:32749d892279fb14ce2a02ca4f7d25891983464f6696ed62e4a4350ee7931d02", + "zh:32ece5073409de4a25ca7b35e246117da7915683eb6317797b0c98e8b9b4cfbd", + "zh:3b7bb7be87e2ab432c0a30d085ef9a06b87def29f69cf5154bfc07bec7811db4", + "zh:5f986460e947675c9f85cc233c68b9af16385ac2e66c0ae22ed3501cd482abf5", + "zh:6ac164504e04d1b6d83762f50896005362c250a69203e5f25313b410711e826b", + "zh:6e639b8ddc44a299fef194d5792f6df69b26e350e44185600bbac8e1a8b2fbd3", "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:9c385d03a958b54e2afd5279cd8c7cbdd2d6ca5c7d6a333e61092331f38af7cf", - "zh:b3ca45f2821a89af417787df8289cb4314b273d29555ad3b2a5ab98bb4816b3b", - "zh:da3c317f1db2469615ab40aa6baba63b5643bae7110ff855277a1fb9d8eb4f2c", - "zh:dc6430622a8dc5cdab359a8704aec81d3825ea1d305bbb3bbd032b1c6adfae0c", - "zh:fac0d2ddeadf9ec53da87922f666e1e73a603a611c57bcbc4b86ac2821619b1d", + "zh:9b396ba2682256f5321162306d2bea5c276b8cd1a5f877599746518804554e80", + "zh:ab0688723e14acdd9d9f244086be7c22e2b938add611b814ce7b1662484e5d08", + "zh:c2a6453f223b7a2491a75481ef30421bc15e1983530e082467bcfa99553dca51", + "zh:d794b429ef1c259188a31626725af18e6ac8a9bbe1478484f8d0a0db57703335", + "zh:d86fb03571f8446928659efad065a235dda6320fdf893b575c54ae9df5adfda8", + "zh:ec27eddf86ee2f2003ae87faf269fac379311531394cf5292b9c31d011b9a873", ] } @@ -68,21 +68,21 @@ provider "registry.terraform.io/hashicorp/http" { } provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = "~> 3.1" + version = "3.6.3" + constraints = "~> 3.0" hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", + "h1:Fnaec9vA8sZ8BXVlN3Xn9Jz3zghSETIKg7ch8oXhxno=", + "zh:04ceb65210251339f07cd4611885d242cd4d0c7306e86dda9785396807c00451", + "zh:448f56199f3e99ff75d5c0afacae867ee795e4dfda6cb5f8e3b2a72ec3583dd8", + "zh:4b4c11ccfba7319e901df2dac836b1ae8f12185e37249e8d870ee10bb87a13fe", + "zh:4fa45c44c0de582c2edb8a2e054f55124520c16a39b2dfc0355929063b6395b1", + "zh:588508280501a06259e023b0695f6a18149a3816d259655c424d068982cbdd36", + "zh:737c4d99a87d2a4d1ac0a54a73d2cb62974ccb2edbd234f333abd079a32ebc9e", "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", + "zh:a357ab512e5ebc6d1fda1382503109766e21bbfdfaa9ccda43d313c122069b30", + "zh:c51bfb15e7d52cc1a2eaec2a903ac2aff15d162c172b1b4c17675190e8147615", + "zh:e0951ee6fa9df90433728b96381fb867e3db98f66f735e0c3e24f8f16903f0ad", + "zh:e3cdcb4e73740621dabd82ee6a37d6cfce7fee2a03d8074df65086760f5cf556", + "zh:eff58323099f1bd9a0bec7cb04f717e7f1b2774c7d612bf7581797e1622613a0", ] } diff --git a/test/test.tf b/test/test.tf index 5b58058..f3bda56 100644 --- a/test/test.tf +++ b/test/test.tf @@ -61,11 +61,11 @@ terraform { required_version = ">= 1.0" required_providers { aws = { - version = "~> 4.0" + version = "~> 5.0" source = "hashicorp/aws" } cloudflare = { - version = "~> 3.0" + version = "~> 4.0" source = "cloudflare/cloudflare" } random = { diff --git a/versions.tf b/versions.tf index a7e4e14..e0d0989 100644 --- a/versions.tf +++ b/versions.tf @@ -3,12 +3,15 @@ terraform { required_version = ">= 1.0" required_providers { aws = { - version = "~> 4.0" source = "hashicorp/aws" + version = ">= 4.0.0, < 6.0.0" } cloudflare = { - version = "~> 3.0" - source = "cloudflare/cloudflare" + source = "cloudflare/cloudflare" + + // 4.39.0 deprecated cloudflare_record.value + // While waiting for version 5 to mature, we'll constrain to earlier versions. + version = ">= 2.0.0, < 4.39.0" } random = { version = "~> 3.0" diff --git a/vpc.tf b/vpc.tf index f271239..48d2a34 100644 --- a/vpc.tf +++ b/vpc.tf @@ -3,18 +3,19 @@ * Create VPC */ module "vpc" { - source = "github.com/silinternational/terraform-modules//aws/vpc?ref=8.8.0" + source = "silinternational/vpc/aws" + version = "~> 1.0" + app_name = var.app_name app_env = var.app_env aws_zones = var.aws_zones - } /* * Security group to limit traffic to Cloudflare IPs */ module "cloudflare-sg" { - source = "github.com/silinternational/terraform-modules//aws/cloudflare-sg?ref=8.8.0" + source = "github.com/silinternational/terraform-modules//aws/cloudflare-sg?ref=8.13.3" vpc_id = module.vpc.id } @@ -90,7 +91,7 @@ data "aws_acm_certificate" "default" { * Create application load balancer for public access */ module "alb" { - source = "github.com/silinternational/terraform-modules//aws/alb?ref=8.8.0" + source = "github.com/silinternational/terraform-modules//aws/alb?ref=8.13.3" app_name = var.app_name app_env = var.app_env internal = "false" @@ -106,8 +107,9 @@ module "alb" { * https://registry.terraform.io/modules/silinternational/ecs-asg/aws */ module "ecsasg" { - source = "silinternational/ecs-asg/aws" - version = "3.1.0" + source = "silinternational/ecs-asg/aws" + version = "~> 3.3" + cluster_name = local.app_name_and_env subnet_ids = module.vpc.private_subnet_ids security_group_ids = [module.vpc.vpc_default_sg_id]