Skip to content

Commit 32dbecd

Browse files
justin808claude
andcommitted
docs: address second-pass review on cpflow vs. Terraform appendix
Apply the optional improvements from the second claude[bot] review of the Terraform HCL appendix (#751): - DATABASE_URL: add a production-guidance comment (sensitive var or cpln://secret ref) so the placeholder credentials aren't cargo-culted, matching the note already on SECRET_KEY_BASE. - image_link: clarify that an image bump is a scoped `terraform apply` (plan + state lock), not a "full apply" -- Terraform only diffs the changed argument. Fixed the same overstatement in the closing paragraph. - Expand the single-line `app_name`/`image_link` variable blocks to the idiomatic multi-line form, consistent with `location`. The reviewer's env-must-be-blocks claim was not applied: the official cpln provider docs type container `env` as a Map of String and use the `env = { ... }` map literal in every example, so the doc is already correct. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 28b6824 commit 32dbecd

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

.controlplane/docs/cpflow-vs-terraform.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,19 @@ models actually diverge.
5454

5555
```hcl
5656
# variables.tf
57-
variable "app_name" { type = string } # cpflow injects {{APP_NAME}} per review app;
58-
# in TF this is a -var or a workspace name.
57+
variable "app_name" { # cpflow injects {{APP_NAME}} per review app;
58+
type = string # in TF this is a -var or a workspace name.
59+
}
5960
variable "location" {
6061
type = string
6162
default = "aws-us-east-2"
6263
}
63-
variable "image_link" { type = string } # cpflow's {{APP_IMAGE_LINK}} is set at *deploy*
64-
# time by `deploy-image`. In TF the image is a
65-
# plain argument, so every deploy is a full apply.
64+
# cpflow's {{APP_IMAGE_LINK}} is set at *deploy* time by `deploy-image`. In TF the image
65+
# is a plain argument, so each image bump is its own `terraform apply` (plan + state lock)
66+
# rather than a one-shot `deploy-image` call.
67+
variable "image_link" {
68+
type = string
69+
}
6670
6771
# gvc.tf — was templates/app.yml (kind: gvc + kind: identity)
6872
resource "cpln_gvc" "app" {
@@ -71,6 +75,8 @@ resource "cpln_gvc" "app" {
7175
7276
# was spec.env: (a list of {name,value}); in TF it is a flat map.
7377
env = {
78+
# Placeholder credentials mirror templates/app.yml; in production set DATABASE_URL via a
79+
# sensitive var or a cpln://secret ref (like RENDERER_PASSWORD below) — never embed a real password.
7480
DATABASE_URL = "postgres://the_user:the_password@postgres.${var.app_name}.cpln.local:5432/${var.app_name}"
7581
REDIS_URL = "redis://redis.${var.app_name}.cpln.local:6379"
7682
RAILS_ENV = "production"
@@ -145,6 +151,7 @@ What the comments are really showing: the three things cpflow gives you for free
145151
injection, and the implicit "provision ≠ deploy" separation) all become *your*
146152
problem in Terraform. The image being a plain argument is the big one: in
147153
cpflow, `deploy-image` bumps the running tag without touching infra; in
148-
Terraform, a new image is a `terraform apply` that diffs the whole workload. And
149-
none of `controlplane.yml` (release script, upstream promotion, review-app
150-
prefix matching) has any representation above at all.
154+
Terraform, a new image means a `terraform apply` — only that one argument changes,
155+
but the full plan / state-lock cycle still runs. And none of `controlplane.yml`
156+
(release script, upstream promotion, review-app prefix matching) has any
157+
representation above at all.

0 commit comments

Comments
 (0)