Skip to content

Conversation

einalien
Copy link
Owner

@einalien einalien commented Nov 1, 2026 •

Summary

Implements automated infrastructure deployment for the TEST environment using OpenTofu and GitHub Actions.

The workflow generates saved execution plans, validates resource changes, and automatically applies permitted changes while preventing destructive operations.

Changes

  • Replace the existing TEST planning step with automated deployment.
  • Deploy infrastructure stacks sequentially:
    1. TEST network
    2. TEST frontend
  • Generate saved OpenTofu execution plans using tofu plan -out.
  • Skip deployment when no infrastructure changes are detected.
  • Validate planned resource actions using jq.
  • Allow only non-destructive resource actions:
    • no-op
    • read
    • create
    • update
  • Reject plans containing resource deletion, replacement, or unsupported actions.
  • Apply the exact validated plan using tofu apply.
  • Preserve Kubernetes remote-state locking.
  • Keep sensitive configuration and plan output out of workflow logs.
  • Clean up temporary kubeconfig files, execution plans, and logs after execution.

Verification

  • Existing CI checks passed previously.
  • Verified Kubernetes authentication and remote-state access.
  • Confirmed that both TEST stacks previously produced plans with no changes.
  • Verify successful execution of the updated deployment workflow.
  • Confirm both TEST stacks skip applying when no changes are required.
  • Verify actual infrastructure deployment using a controlled configuration change.

Next Steps

  • Test automated deployment with an intentional, non-destructive infrastructure change.
  • Extend deployment automation to STAGE.
  • Implement PROD deployment with required manual approval.
  • Implement selective and full infrastructure destruction.
  • Document the completed CI/CD workflow.

Notes

The workflow automatically applies permitted resource changes after successful CI on main.

Plans containing destructive or unsupported resource actions are rejected before execution.

The initial deployment is expected to detect no changes because the existing TEST infrastructure already matches its configuration.

@einalien einalien added the enhancement New feature or request label Nov 1, 2026
@einalien einalien self-assigned this Nov 1, 2026
@einalien einalien merged commit b986a15 into main Nov 1, 2026
1 check passed
@einalien einalien deleted the feat/test-automated-apply branch November 1, 2026 20:20
Sign in to join this conversation on GitHub.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant