Skip to content

tf/test: Move resources to test specific subnets - #13756

Merged
Yopi merged 1 commit into
mainfrom
yopi/test-env-new-subnets
Aug 17, 2026
Merged

tf/test: Move resources to test specific subnets#13756
Yopi merged 1 commit into
mainfrom
yopi/test-env-new-subnets

Conversation

@Yopi

@Yopi Yopi commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This is the first step in moving out resources from overlapping IP addresses between our environments.

Review in cubic

This is the first step in moving out resources from overlapping IP addresses between our environments.
@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
orbit Ready Ready Preview Aug 14, 2026 2:00pm
polar Ready Ready Preview Aug 14, 2026 2:00pm
polar-sandbox Ready Ready Preview Aug 14, 2026 2:00pm
polar-test Ready Ready Preview Aug 14, 2026 2:00pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

Confidence score: 4/5

  • In terraform/modules/redis_private_link/main.tf, enabling create_before_destroy while 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@Yopi
Yopi added this pull request to the merge queue Aug 17, 2026
Merged via the queue into main with commit f6f2dc1 Aug 17, 2026
43 checks passed
@Yopi
Yopi deleted the yopi/test-env-new-subnets branch August 17, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants