tf/test: Move resources to test specific subnets - #13756
Conversation
This is the first step in moving out resources from overlapping IP addresses between our environments.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 4/5
- In
terraform/modules/redis_private_link/main.tf, enablingcreate_before_destroywhile keeping explicit NLB/target group names can cause Terraform applies to fail because old and new resources must coexist and AWS enforces name uniqueness; this creates a deployment interruption risk — switch to generated/unique names (or add a randomized suffix) so replacement can happen safely.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="terraform/modules/redis_private_link/main.tf">
<violation number="1" location="terraform/modules/redis_private_link/main.tf:29">
P2: With `create_before_destroy` now enabled on the NLB and target group, the old and new resources exist simultaneously, and AWS requires unique names during that overlap. The provider uses an explicit `name` as-is (only `name_prefix` gets a random suffix), so a replacement fails with a duplicate-name error unless a distinct name is supplied. Only the test environment provides distinct override names; production and sandbox still use the static `var.name` with no overrides, so the next NLB/target-group replacement in those environments will fail. Generate a unique name (e.g. via `name_prefix`/random suffix) instead of relying on hardcoded `-b` overrides, or add the overrides to every environment that uses this module.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| tags = var.tags | ||
|
|
||
| lifecycle { | ||
| create_before_destroy = true |
There was a problem hiding this comment.
P2: With create_before_destroy now enabled on the NLB and target group, the old and new resources exist simultaneously, and AWS requires unique names during that overlap. The provider uses an explicit name as-is (only name_prefix gets a random suffix), so a replacement fails with a duplicate-name error unless a distinct name is supplied. Only the test environment provides distinct override names; production and sandbox still use the static var.name with no overrides, so the next NLB/target-group replacement in those environments will fail. Generate a unique name (e.g. via name_prefix/random suffix) instead of relying on hardcoded -b overrides, or add the overrides to every environment that uses this module.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At terraform/modules/redis_private_link/main.tf, line 29:
<comment>With `create_before_destroy` now enabled on the NLB and target group, the old and new resources exist simultaneously, and AWS requires unique names during that overlap. The provider uses an explicit `name` as-is (only `name_prefix` gets a random suffix), so a replacement fails with a duplicate-name error unless a distinct name is supplied. Only the test environment provides distinct override names; production and sandbox still use the static `var.name` with no overrides, so the next NLB/target-group replacement in those environments will fail. Generate a unique name (e.g. via `name_prefix`/random suffix) instead of relying on hardcoded `-b` overrides, or add the overrides to every environment that uses this module.</comment>
<file context>
@@ -24,10 +24,14 @@ resource "aws_lb" "this" {
tags = var.tags
+
+ lifecycle {
+ create_before_destroy = true
+ }
}
</file context>
This is the first step in moving out resources from overlapping IP addresses between our environments.