Zack
07/30/2026, 4:29 AMZack
07/30/2026, 4:30 AMZack
07/30/2026, 3:41 PMZack
07/30/2026, 4:21 PMZack
07/30/2026, 4:28 PMZack
07/30/2026, 6:13 PMtime atmos terraform apply \
--labels deployment:$app-dev \
--max-concurrency 3 \
-auto-approve \
--dry-runZack
07/30/2026, 6:14 PMErik Osterman (Cloud Posse)
07/30/2026, 6:20 PMZack
07/30/2026, 6:21 PMErik Osterman (Cloud Posse)
07/30/2026, 6:21 PM--profiler-* flags?Erik Osterman (Cloud Posse)
07/30/2026, 6:22 PM--profile flags)Zack
07/30/2026, 6:22 PMError: unknown flag --profiler for command atmos terraform applyZack
07/30/2026, 6:23 PMErik Osterman (Cloud Posse)
07/30/2026, 6:23 PM❯ atmos --help=all|grep profiler
--profiler-enabled Enable pprof profiling server
--profiler-host string Host for pprof profiling server (default localhost)
--profiler-port int Port for pprof profiling server (default 6060)Andriy Knysh (Cloud Posse)
07/30/2026, 6:27 PMdo we have a claude skill for using theno, we don't. It was implemented before the AI and not touched since thenflags--profiler-*
Andriy Knysh (Cloud Posse)
07/30/2026, 6:30 PMAndriy Knysh (Cloud Posse)
07/30/2026, 6:34 PM--heatmap atmos.tools/cli/global-flags#…Andriy Knysh (Cloud Posse)
07/30/2026, 6:37 PMZack
07/30/2026, 6:38 PMZack
07/30/2026, 6:40 PMZack
07/30/2026, 6:40 PMZack
07/30/2026, 6:42 PMFound it. #2807 intentionally skips unmatched labels before state reads, but our deployment label is a two-pass template: it
references base_environment_stage, which is itself a template. The scope check sees it still unresolved and conservatively
renders every component—hence 3,451 S3 reads.
I'm flattening that label expression everywhere it uses this pattern; same final label, resolvable in one pass.
• Ran set -e
│ selector_files=$(rg -l -U 'labels:\n(?:[^\n]*\n)*?\s+deployment:.*base_environment_stage' stacks)
│ perl -0pi -e 's/deployment: "\{\{ \.vars\.app \}\}-\{\{ \.vars\.base_environment_stage \}\}"/deployment:
│ … +5 lines
└ (no output)Andriy Knysh (Cloud Posse)
07/30/2026, 6:44 PM3,451 S3 reads
is it using !terraform.state ?Zack
07/30/2026, 6:45 PMFixed the scope miss in 46 stack labels.
base_environment_stage was itself templated, so #2807’s label prefilter couldn't resolve deployment in one pass and evaluated
the whole repo.
Changed labels to resolve directly:
deployment: '{{ .<http://vars.app|vars.app> }}-{{ regexReplaceAll "(x|[0-9]+)$" .vars.deployment_requirements.stage "" }}'
Heatmap result for your exact command:
- Before: 225s, 3,451 S3 state reads
- After: 36s, 543 S3 state reads
No Atmos source change needed—the parent PR's scope-before-evaluate behavior now actually applies to these stacks.Zack
07/30/2026, 6:45 PMAndriy Knysh (Cloud Posse)
07/30/2026, 6:45 PM!terraform.state read (unless something broke) so we don't read the data from the same key more than onceAndriy Knysh (Cloud Posse)
07/30/2026, 6:47 PMZack
07/30/2026, 6:50 PMZack
07/30/2026, 6:50 PM• Confirmed. Atmos deliberately does not cache a missing state, so every fallback reference re-reads S3. But successful
Terraform nodes already invalidate that exact cache entry afterward, which makes negative caching safe for this process.
I'm changing the cache to retain "not provisioned" until that invalidation.Zack
07/30/2026, 6:54 PMErik Osterman (Cloud Posse)
07/30/2026, 7:10 PMZack
07/30/2026, 7:11 PMZack
07/30/2026, 7:11 PMZack
07/30/2026, 7:12 PMZack
07/30/2026, 7:12 PMZack
07/30/2026, 7:13 PMZack
07/30/2026, 8:30 PMErik Osterman (Cloud Posse)
07/30/2026, 8:30 PMErik Osterman (Cloud Posse)
07/30/2026, 8:30 PMErik Osterman (Cloud Posse)
07/30/2026, 8:30 PMZack
07/30/2026, 8:31 PMErik Osterman (Cloud Posse)
07/30/2026, 8:31 PMZack
07/30/2026, 8:51 PMZack
07/30/2026, 10:06 PMZack
07/31/2026, 4:48 PMi believe we cache eachIs there a way to clear this cache? Does it live somewhere?read (unless something broke) so we don't read the data from the same key more than once!terraform.state
Zack
07/31/2026, 4:49 PMZack
07/31/2026, 4:51 PMErik Osterman (Cloud Posse)
07/31/2026, 4:52 PMZack
07/31/2026, 4:52 PMZack
07/31/2026, 4:53 PMZack
07/31/2026, 4:53 PM!terraform.state literally everywhereAndriy Knysh (Cloud Posse)
07/31/2026, 4:55 PMZack
07/31/2026, 4:56 PMZack
07/31/2026, 4:56 PMZack
07/31/2026, 4:57 PM