mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
terraform module -- replace redis cidr (#14768)
🔧 refactor(byo-vpc/main.tf): replace hardcoded cidr_blocks value with
dynamic data from aws_subnet.redis to ensure the CIDR blocks are always
up-to-date and accurate
This commit is contained in:
parent
0e99f5a660
commit
d76c9bf3c9
5 changed files with 54 additions and 6 deletions
45
terraform/byo-vpc/.terraform.lock.hcl
Normal file
45
terraform/byo-vpc/.terraform.lock.hcl
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# This file is maintained automatically by "terraform init".
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.terraform.io/hashicorp/aws" {
|
||||
version = "5.23.1"
|
||||
constraints = ">= 2.67.0, >= 3.0.0, >= 4.6.0, >= 4.18.0, >= 4.27.0, >= 4.30.0"
|
||||
hashes = [
|
||||
"h1:s23thJVPJHUdS7ESZHoeMkxNcTeaqWvg2usv8ylFVL4=",
|
||||
"zh:024a188ad3c979a9ec0d7d898aaa90a3867a8839edc8d3543ea6155e6e010064",
|
||||
"zh:05b73a04c58534a7527718ef55040577d5c573ea704e16a813e7d1b18a7f4c26",
|
||||
"zh:13932cdee2fa90f40ebaa783f033752864eb6899129e055511359f8d1ada3710",
|
||||
"zh:3500f5febc7878b4426ef89a16c0096eefd4dd0c5b0d9ba00f9ed54387df5d09",
|
||||
"zh:394a48dea7dfb0ae40e506ccdeb5387829dbb8ab00fb64f41c347a1de092aa00",
|
||||
"zh:51a57f258b3bce2c167b39b6ecf486f72f523da05d4c92adc6b697abe1c5ff1f",
|
||||
"zh:7290488a96d8d10119b431eb08a37407c0812283042a21b69bcc2454eabc08ad",
|
||||
"zh:7545389dbbba624c0ffa72fa376b359b27f484aba02139d37ee5323b589e0939",
|
||||
"zh:92266ac6070809e0c874511ae93097c8b1eddce4c0213e487c5439e89b6ad64d",
|
||||
"zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425",
|
||||
"zh:9c3841bd650d6ba471c7159bcdfa35200e5e49c2ea11032c481a33cf7875879d",
|
||||
"zh:bd103c46a16e7f9357e08d6427c316ccc56d203452130eed8e36ede3afa3322c",
|
||||
"zh:cab0a16e320c6ca285a3a51f40c8f46dbaa0712856594819b415b4d8b3e63910",
|
||||
"zh:e8adedcda4d6ff47dcae9c9bb884da26ca448fb6f7436be95ad6a341e4d8094a",
|
||||
"zh:fc23701a3723f50878f440dcdf8768ea96d60a0d7c351aa6dfb912ad832c8384",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.terraform.io/hashicorp/random" {
|
||||
version = "3.5.1"
|
||||
constraints = ">= 2.2.0"
|
||||
hashes = [
|
||||
"h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=",
|
||||
"zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64",
|
||||
"zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d",
|
||||
"zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831",
|
||||
"zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3",
|
||||
"zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f",
|
||||
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
|
||||
"zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b",
|
||||
"zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2",
|
||||
"zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865",
|
||||
"zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03",
|
||||
"zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602",
|
||||
"zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014",
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -97,7 +97,7 @@ module "redis" {
|
|||
from_port = 0
|
||||
to_port = 65535
|
||||
protocol = "tcp"
|
||||
cidr_blocks = ["10.0.0.0/8"]
|
||||
cidr_blocks = var.redis_config.allowed_cidrs
|
||||
}]
|
||||
tags = var.redis_config.tags
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ variable "redis_config" {
|
|||
elasticache_subnet_group_name = optional(string, "")
|
||||
allowed_security_group_ids = optional(list(string), [])
|
||||
subnets = list(string)
|
||||
allowed_cidrs = list(string)
|
||||
availability_zones = optional(list(string), [])
|
||||
cluster_size = optional(number, 3)
|
||||
instance_type = optional(string, "cache.m5.large")
|
||||
|
|
@ -77,6 +78,7 @@ variable "redis_config" {
|
|||
elasticache_subnet_group_name = ""
|
||||
allowed_security_group_ids = []
|
||||
subnets = null
|
||||
allowed_cidrs = null
|
||||
availability_zones = []
|
||||
cluster_size = 3
|
||||
instance_type = "cache.m5.large"
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ module "byo-vpc" {
|
|||
})
|
||||
redis_config = merge(var.redis_config, {
|
||||
subnets = module.vpc.elasticache_subnets
|
||||
allowed_cidrs = module.vpc.private_subnets_cidr_blocks
|
||||
elasticache_subnet_group_name = module.vpc.elasticache_subnet_group_name
|
||||
availability_zones = var.vpc.azs
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue