Skip to content

feat: add LocalStack-based local infrastructure automation and documentation - #5126

Open
devnchill wants to merge 52 commits into
OWASP:mainfrom
devnchill:feat/localstack
Open

feat: add LocalStack-based local infrastructure automation and documentation#5126
devnchill wants to merge 52 commits into
OWASP:mainfrom
devnchill:feat/localstack

Conversation

@devnchill

@devnchill devnchill commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Proposed change

Resolves #5115

  • Adds localstack,awslocal and tflocal as pre requisite
  • Adds makefile target and bash script to start localstack
  • Adds makefile target and bash script to provision infra (This is WIP as facing some issues atm for tflocal apply )
  • Adds makefile target and bash script to upload env vars to SSM Parameter store
  • Adds makefile target to migrate,publish dump and index data
  • document these steps in infra README

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran all required checks and tests locally; all warnings addressed and failures resolved
  • I used AI for code, documentation, tests, or communication related to this PR

@github-actions github-actions Bot added docs Improvements or additions to documentation makefile infrastructure labels Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds LocalStack startup and provisioning automation, updates infrastructure make targets and path resolution, expands local prerequisites, and allows the environment validation to accept local.

Changes

LocalStack infrastructure automation

Layer / File(s) Summary
LocalStack startup wiring
infrastructure/scripts/start-localstack.sh, infrastructure/.env.example, infrastructure/Makefile, Makefile, infrastructure/README.md
Adds a start-localstack script that requires LOCALSTACK_AUTH_TOKEN, wires it into make targets, adds the token placeholder to the example env file, and updates prerequisites documentation.
Local infrastructure provisioning
infrastructure/scripts/provision-infra.sh, infrastructure/live/variables.tf
Adds the provisioning script that checks LocalStack, runs tflocal, logs into local ECR, and builds and pushes backend/frontend images; updates environment validation to allow local.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

  • Add Terraform integration tests #5078: The added LocalStack startup, Terraform-local provisioning, and environment-token wiring align with the LocalStack infrastructure automation described in that issue.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Core LocalStack startup/provisioning is present, but #5115 also requires an env-to-SSM target, DB migrate/load/index targets, and teardown docs, which are missing. Add the missing SSM upload target, database operation targets, and teardown documentation so the PR covers all acceptance criteria.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed All changes align with LocalStack automation and documentation; no unrelated code changes are evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately summarizes the main change: adding LocalStack-based local infrastructure automation and docs.
Description check ✅ Passed The description is related to the PR and describes the same LocalStack infrastructure work, even if it mentions extra items.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@infrastructure/scripts/start-localstack.sh`:
- Around line 18-21: The LOCALSTACK_AUTH_TOKEN check in start-localstack.sh
should use the same bash-style conditional and stderr handling as the other
script checks. Update the token validation block to use [[ for the emptiness
test, and send the error message to stderr instead of stdout before exiting.
Keep the logic in the existing startup guard around LOCALSTACK_AUTH_TOKEN so it
matches the script’s other validation patterns.
- Around line 23-24: The start-localstack.sh entrypoint assumes the localstack
CLI exists, so it can fail with a generic command-not-found error instead of a
clear prerequisite message. Add a pre-check before the exec localstack start
call in the startup flow (near the existing echo "Starting LocalStack..." block)
to verify localstack is available, and exit with a helpful message if it is
missing.
- Around line 8-12: The startup check in start-localstack.sh should use the
safer bash conditional syntax and send failures to stderr. Update the ENV_FILE
existence guard to use the script’s existing conditional block with [[ ... ]]
instead of [ ... ], and change the two ERROR echo statements in that block to
write to standard error so failures are not mixed with normal output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 41c4b436-ca9c-4396-a58f-eeab26d32481

📥 Commits

Reviewing files that changed from the base of the PR and between 2de24d1 and 2549aff.

📒 Files selected for processing (5)
  • Makefile
  • infrastructure/.env.example
  • infrastructure/Makefile
  • infrastructure/README.md
  • infrastructure/scripts/start-localstack.sh

Comment thread infrastructure/scripts/start-localstack.sh Outdated
Comment thread infrastructure/scripts/start-localstack.sh Outdated
Comment thread infrastructure/scripts/start-localstack.sh Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 3, 2026
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Jul 3, 2026

@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.

0 issues found across 1 file (changes from recent commits).

Re-trigger cubic

@devnchill

Copy link
Copy Markdown
Contributor Author

@rudransh-shrivastava

Copy link
Copy Markdown
Collaborator

@rudransh-shrivastava should i modify this to include local too? https://github.com/devnchill/Nest/blob/feat/localstack/infrastructure/live/variables.tf#L242-L242

Yes, sounds good.
IIRC, there may be other similar validations too.

@devnchill

Copy link
Copy Markdown
Contributor Author

for provision-infra script , I am hitting a weird error , I am not really sure if this is somehow related to my dns as it appears to be unable to resolve host ...

╷
│ Error: listing tags for S3 (Simple Storage) Bucket (nest-local-alb-logs-0da353d3): operation error S3 Control: ListTagsForResource, https response error StatusCode: 0, RequestID: , HostID: , request send failed, Get "http://000000000000.localhost:4566/v20180820/tags/arn%3Aaws%3As3%3A%3A%3Anest-local-alb-logs-0da353d3": dial tcp: lookup 000000000000.localhost on 127.0.0.1:53: no such host
│
│   with module.alb.aws_s3_bucket.alb_logs,
│   on ../modules/alb/main.tf line 195, in resource "aws_s3_bucket" "alb_logs":
│  195: resource "aws_s3_bucket" "alb_logs" { # NOSONAR
│
╵

This happens during tflocal apply where it tries to get the tags of buckets created on localstack

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
infrastructure/live/variables.tf (1)

238-245: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Error message doesn't mention the newly-allowed local value.

The validation condition now accepts "local", but error_message still only references 'staging' or 'production', which will confuse anyone hitting the validation failure.

🔧 Proposed fix
   validation {
     condition     = contains(["local", "staging", "production"], var.environment)
-    error_message = "Environment must be either 'staging' or 'production'."
+    error_message = "Environment must be one of 'local', 'staging', or 'production'."
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infrastructure/live/variables.tf` around lines 238 - 245, The `environment`
variable validation in `variables.tf` now allows `local`, but the
`error_message` still only mentions `staging` and `production`. Update the
validation message in the `variable "environment"` block so it explicitly lists
`local` alongside the other allowed values, keeping it consistent with the
`contains(...)` condition.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@infrastructure/scripts/provision-infra.sh`:
- Around line 38-42: The provision-infra.sh setup is using a hardcoded fallback
for DB_PASSWORD, which should be removed from the default env assignments.
Update the script to either require DB_PASSWORD explicitly with a clear error or
generate a non-static local default, and align the behavior with the explicit
validation approach used in start-localstack.sh for LOCALSTACK_AUTH_TOKEN.
Reference the DB_PASSWORD initialization block and the related environment
variable handling near the top of the script so the fix stays localized and easy
to find.

---

Outside diff comments:
In `@infrastructure/live/variables.tf`:
- Around line 238-245: The `environment` variable validation in `variables.tf`
now allows `local`, but the `error_message` still only mentions `staging` and
`production`. Update the validation message in the `variable "environment"`
block so it explicitly lists `local` alongside the other allowed values, keeping
it consistent with the `contains(...)` condition.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0ca74ae7-9d9a-4f1d-b739-edd17ab61821

📥 Commits

Reviewing files that changed from the base of the PR and between 2549aff and da92b54.

📒 Files selected for processing (5)
  • Makefile
  • infrastructure/Makefile
  • infrastructure/live/variables.tf
  • infrastructure/scripts/provision-infra.sh
  • infrastructure/scripts/start-localstack.sh

Comment thread infrastructure/scripts/provision-infra.sh Outdated

@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.

2 issues found across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread infrastructure/scripts/provision-infra.sh Outdated
Comment thread infrastructure/scripts/provision-infra.sh Outdated

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
infrastructure/README.md (1)

9-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing jq prerequisite.

provision-infra.sh (same cohort) generates tfvars.json via jq but this list doesn't mention it. Without it, users hit a raw "command not found" failure instead of a documented prerequisite.

📝 Proposed addition
 - Curl: [Curl](https://github.com/curl/curl)
+- jq: [jq](https://jqlang.github.io/jq/download/)
 - Terraform: [Terraform Documentation](https://developer.hashicorp.com/terraform/docs)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infrastructure/README.md` around lines 9 - 17, The prerequisites list in
infrastructure/README.md is missing jq, even though provision-infra.sh relies on
it to generate tfvars.json. Update the setup/prerequisites section to include jq
alongside the existing tools so users can install it before running the
infrastructure provisioning flow. Use the existing checklist items near the
infrastructure setup references to keep the documentation consistent.
infrastructure/scripts/provision-infra.sh (1)

14-25: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Prerequisite check runs after curl is already used.

Line 14 calls curl for the LocalStack health check before the prerequisite loop (lines 20-25) verifies curl exists. If curl is missing, the if ! curl ... test fails for the wrong reason and the user sees a misleading "LocalStack is not running or not ready" message instead of the actual "curl not found" error. Move the prerequisite check above the health-check block.

🐛 Proposed fix
+for cmd in curl tflocal awslocal docker; do
+    if ! command -v "$cmd" >/dev/null 2>&1; then
+        echo "ERROR: '$cmd' not found. See infrastructure/README.md prerequisites." >&2
+        exit 1
+    fi
+done
+
 if ! curl -sf "http://localhost.localstack.cloud:4566/_localstack/health" >/dev/null 2>&1; then
     echo "ERROR: LocalStack is not running or not ready." >&2
     echo "Start it in another terminal with: make start-localstack" >&2
     exit 1
 fi
-
-for cmd in curl tflocal awslocal docker; do
-    if ! command -v "$cmd" >/dev/null 2>&1; then
-        echo "ERROR: '$cmd' not found. See infrastructure/README.md prerequisites." >&2
-        exit 1
-    fi
-done
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infrastructure/scripts/provision-infra.sh` around lines 14 - 25, Move the
prerequisite validation in provision-infra.sh so the command-existence loop runs
before the LocalStack health check. The issue is that curl is invoked in the
initial health probe before command -v checks verify it exists, which can
produce a misleading LocalStack failure message. Update the script around the
curl health-check and the for cmd in curl tflocal awslocal docker block so
missing curl is reported by the prerequisite check first.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@infrastructure/scripts/provision-infra.sh`:
- Around line 47-48: The jq argument for environment in the infra provisioning
script is hardcoded to a fixed value, so it cannot be overridden like the other
configuration fields. Update the jq invocation in the provisioning flow to
source environment from an environment variable with a local/development
default, matching the pattern used by DJANGO_CONFIGURATION, DOMAIN_NAME,
ENABLE_CRON_TASKS, and DB_PASSWORD, so the script supports override-friendly
deployment configuration.
- Line 54: The `provision-infra.sh` argument passed to `jq -n --argjson` for
`ENABLE_CRON_TASKS` can fail on non-boolean input, so normalize or validate the
environment value before building the JSON args. Update the script around the
`--argjson enable_cron_tasks "$ENABLE_CRON_TASKS"` usage to accept only valid
boolean-style values (or convert common variants) and emit a clear error message
if the value is invalid, instead of letting `jq` fail with a parse error.

---

Outside diff comments:
In `@infrastructure/README.md`:
- Around line 9-17: The prerequisites list in infrastructure/README.md is
missing jq, even though provision-infra.sh relies on it to generate tfvars.json.
Update the setup/prerequisites section to include jq alongside the existing
tools so users can install it before running the infrastructure provisioning
flow. Use the existing checklist items near the infrastructure setup references
to keep the documentation consistent.

In `@infrastructure/scripts/provision-infra.sh`:
- Around line 14-25: Move the prerequisite validation in provision-infra.sh so
the command-existence loop runs before the LocalStack health check. The issue is
that curl is invoked in the initial health probe before command -v checks verify
it exists, which can produce a misleading LocalStack failure message. Update the
script around the curl health-check and the for cmd in curl tflocal awslocal
docker block so missing curl is reported by the prerequisite check first.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0a620622-1192-492a-af2b-f31a36f447e8

📥 Commits

Reviewing files that changed from the base of the PR and between da92b54 and e108a6a.

📒 Files selected for processing (2)
  • infrastructure/README.md
  • infrastructure/scripts/provision-infra.sh

Comment thread infrastructure/scripts/provision-infra.sh Outdated
Comment thread infrastructure/scripts/provision-infra.sh Outdated

@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 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread infrastructure/scripts/provision-infra.sh Outdated

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

♻️ Duplicate comments (1)
infrastructure/scripts/provision-infra.sh (1)

38-38: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Default ENVIRONMENT to local.
infrastructure/live/variables.tf only accepts local, staging, and production, but this script defaults ENVIRONMENT to Local and passes it straight to Terraform. Fresh runs will fail validation unless the caller overrides it.

Suggested change
-ENVIRONMENT="${ENVIRONMENT:-Local}"
+ENVIRONMENT="${ENVIRONMENT:-local}"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infrastructure/scripts/provision-infra.sh` at line 38, The default value
assigned in provision-infra.sh for ENVIRONMENT uses an invalid capitalized
value, which will fail Terraform validation in scripts that do not override it.
Update the ENVIRONMENT default in the provisioning script to the lowercase
supported value so it matches the allowed inputs from the Terraform variables,
and keep the existing flow that passes ENVIRONMENT through to Terraform
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@infrastructure/scripts/provision-infra.sh`:
- Line 43: The DB_PASSWORD assignment in provision-infra.sh is malformed because
it still includes a diff marker. Remove the leading plus so the shell treats it
as a normal variable assignment, not a command invocation. Check the top-level
DB_PASSWORD initialization in the script and keep the strict-mode provisioning
flow intact.
- Around line 57-64: The jq invocation in the infrastructure provisioning script
has a malformed option where the `enable_cron_tasks` argument is passed with
four leading dashes, causing `TFVARS_JSON` generation to fail. Fix the `jq`
command in `provision-infra.sh` by correcting the flag to the proper `--argjson`
form, keeping the existing `jq -n` argument pattern and the `enable_cron_tasks`
variable name intact.

---

Duplicate comments:
In `@infrastructure/scripts/provision-infra.sh`:
- Line 38: The default value assigned in provision-infra.sh for ENVIRONMENT uses
an invalid capitalized value, which will fail Terraform validation in scripts
that do not override it. Update the ENVIRONMENT default in the provisioning
script to the lowercase supported value so it matches the allowed inputs from
the Terraform variables, and keep the existing flow that passes ENVIRONMENT
through to Terraform unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 26745d9e-5d13-423b-9178-192445c4b976

📥 Commits

Reviewing files that changed from the base of the PR and between e108a6a and 60ee217.

📒 Files selected for processing (2)
  • infrastructure/README.md
  • infrastructure/scripts/provision-infra.sh

Comment thread infrastructure/scripts/provision-infra.sh Outdated
Comment thread infrastructure/scripts/provision-infra.sh Outdated

@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.

3 issues found across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread infrastructure/scripts/provision-infra.sh Outdated
Comment thread infrastructure/scripts/provision-infra.sh Outdated
Comment thread infrastructure/scripts/provision-infra.sh Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 4, 2026
@devnchill
devnchill force-pushed the feat/localstack branch 2 times, most recently from 00cb5f5 to 633b334 Compare July 4, 2026 09:57

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
infrastructure/live/variables.tf (1)

238-245: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Error message doesn't mention the newly accepted local value.

The validation now accepts local, but the error message still only lists staging/production, which will confuse users who hit this validation with an invalid value.

🔧 Proposed fix
   validation {
     condition     = contains(["local", "staging", "production"], var.environment)
-    error_message = "Environment must be either 'staging' or 'production'."
+    error_message = "Environment must be one of 'local', 'staging', or 'production'."
   }

Also worth checking other variable blocks in infrastructure/ for similar contains([...]) validations that may need the same local addition, per the review thread's note that "there may be other similar validations that also need updating."

#!/bin/bash
# Find other environment-style contains() validations across infrastructure/
rg -nP 'contains\(\[.*staging.*production.*\]' infrastructure --type=hcl -C2
rg -nP 'contains\(\[.*production.*staging.*\]' infrastructure --type=hcl -C2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infrastructure/live/variables.tf` around lines 238 - 245, The environment
variable validation in variable "environment" accepts local, but the
error_message in the same block still only mentions staging and production;
update that message to list local as well. While you’re in
infrastructure/live/variables.tf, scan other variable blocks that use
contains([...]) for environment-style validations and make the same local update
wherever applicable, using the variable block names and their
validation/error_message fields to locate them.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@infrastructure/scripts/provision-infra.sh`:
- Line 43: The DB_PASSWORD fallback in provision-infra.sh currently generates a
new random value on every run, which breaks rerunnability. Update the password
handling near the DB_PASSWORD assignment so it either persists the generated
value back into .env on first run or fails fast with a clear error when
DB_PASSWORD is unset, similar to the LOCALSTACK_AUTH_TOKEN check. Keep the fix
localized to the provisioning flow and the DB_PASSWORD/DB_PASSWORD_FILE handling
so repeated runs reuse the same secret.
- Around line 57-69: The jq invocation in provision-infra.sh is broken because
the option chain is terminated early by the missing line-continuation after
enable_cron_tasks. Update the jq -n argument list so the db_password,
db_deletion_protection, db_skip_final_snapshot, and enable_nat_gateway flags
remain part of the same command, using the existing jq setup and
_normalize_bool/ENABLE_CRON_TASKS flow.

---

Outside diff comments:
In `@infrastructure/live/variables.tf`:
- Around line 238-245: The environment variable validation in variable
"environment" accepts local, but the error_message in the same block still only
mentions staging and production; update that message to list local as well.
While you’re in infrastructure/live/variables.tf, scan other variable blocks
that use contains([...]) for environment-style validations and make the same
local update wherever applicable, using the variable block names and their
validation/error_message fields to locate them.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 879377aa-ce05-4195-a4c9-8f49c031ca0e

📥 Commits

Reviewing files that changed from the base of the PR and between 60ee217 and 633b334.

📒 Files selected for processing (7)
  • Makefile
  • infrastructure/.env.example
  • infrastructure/Makefile
  • infrastructure/README.md
  • infrastructure/live/variables.tf
  • infrastructure/scripts/provision-infra.sh
  • infrastructure/scripts/start-localstack.sh

Comment thread infrastructure/scripts/provision-infra.sh Outdated
Comment thread infrastructure/scripts/provision-infra.sh Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 4, 2026
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Jul 4, 2026

@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.

0 issues found across 1 file (changes from recent commits).

Re-trigger cubic

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Jul 4, 2026

@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.

0 issues found across 1 file (changes from recent commits).

Re-trigger cubic

devnchill and others added 24 commits August 8, 2026 19:25
Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
…ocalstack

Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
…bot auth and environ import

Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
Signed-off-by: Viena <169875752+devnchill@users.noreply.github.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
…ev environment

Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
Signed-off-by: Viena <theviena96@gmail.com>
…ration

Signed-off-by: Viena <theviena96@gmail.com>
@sonarqubecloud

sonarqubecloud Bot commented Aug 8, 2026

Copy link
Copy Markdown

@rudransh-shrivastava

rudransh-shrivastava commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Hi @devnchill
I see this PR is marked as open. Is it up for review?

@devnchill

Copy link
Copy Markdown
Contributor Author

@rudransh-shrivastava yes , i've ported scripts properly . everything seems to work fine. you can takeover from here on,i'm burnt out from working on this pr for so long

self.env_path.parent.mkdir(parents=True, exist_ok=True)
self.env_path.touch(exist_ok=True)
with self.env_path.open("a", encoding="utf-8") as handle:
handle.write(header)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend docs Improvements or additions to documentation frontend infrastructure makefile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add LocalStack-based Local Infrastructure Automation and Documentation

4 participants