CICD-236 · Upload Terraform plan
Encyclopedia · Terraform and infrastructure as code · All snippets
Previous · CICD-235 · Next · CICD-237
1. Where it fits
- Placement CI run step or authorized lab terminal.
- Prerequisites trusted Linux runner, Terraform CLI, reviewed IaC and a disposable state for writes.
- Platforms local-linux, github-actions, gitea-actions.
- Parameters
PLAN_BUCKET,RELEASE_SHA.
2. Copy the snippet
bash
aws s3 cp tfplan "s3://${PLAN_BUCKET:?}/plans/${RELEASE_SHA:?}/tfplan" --sse aws:kms --only-show-errors3. How it works
The object key ties storage to the release SHA and server-side encryption protects it at rest. Retain restrictive read access because the plan can contain sensitive values.
4. Verify the result
Use restrictive bucket IAM and lifecycle rules. A reviewer should receive the plan summary through a secure channel.
Validation syntax-validated (Bash parse). Status definitions.