cloudposse / cloudposse/atmos

locals seems to be broken

Open
#2,374 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
1.4k
Forks
175
Avg merge
2d 3h
Merged PRs (30d)
134

Description

### Describe the Bug

I try to configure locals:

```
locals:
prefix: "cloudlabs-plat-ue1-prod"

components:
terraform:
kms:
vars:
aliases:
- "{{ .locals.prefix }}-key-logs"
```

They don't seem to evaluate and return no value:

> Error: "name" must begin with 'alias/' and only contain [0-9A-Za-z_/-]

│ with aws_kms_alias.this["-key-logs"],
│ on main.tf line 468, in resource "aws_kms_alias" "this":
│ 468: name = var.aliases_use_name_prefix ? null : "alias/${each.value.name}"

My atmos.yaml:
```
base_path: "."

components:
terraform:
base_path: "components/terraform"
apply_auto_approve: false
deploy_run_init: true
init_run_reconfigure: true
auto_generate_backend_file: true

stacks:
base_path: "stacks"
included_paths:
- "orgs/**/*"
excluded_paths:
- "**/_defaults.yaml"
name_template: "{{.settings.namespace}}-{{.settings.tenant}}-{{.settings.environment}}-{{.settings.stage}}"

templates:
settings:
enabled: true
sprig:
enabled: true
gomplate:
enabled: true

workflows:
base_path: "stacks/workflows"

vendor:
base_path: "vendor.yaml"

schemas:
jsonschema:
base_path: "stacks/schemas/jsonschema"
opa:
base_path: "stacks/schemas/opa"
atmos:
manifest: "stacks/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json"

logs:
file: "/dev/stderr"
level: Info

auth:
identities:
cloud-user:
kind: aws/user
default: true

ai:
enabled: true
default_provider: "claude-code" # or "codex-cli" or "gemini-cli"
providers:
claude-code:
max_turns: 10
tools:
enabled: true
allowed_tools:
- atmos_list_*
- atmos_validate_*
- atmos_describe_*
- write_stack_file
- edit_file
```

Also the describe locals does not work:

`atmos describe locals kms -s cloudlabs-plat-ue1-dev`

> Error: stack not found
> ## Explanation
> cloudlabs-plat-ue1-dev

Another command (same stack):
`atmos describe component kms -s cloudlabs-plat-ue1-dev`
resolved correctly, so it seems like there is a bug with the subcommand as well which it does not recognize any stacks.

### Expected Behavior

_No response_

### Steps to Reproduce

_No response_

### Screenshots

Image

----------------------

Image

### Environment

- OS: WSL
- Terraform: 1.14.9
- Atmos: 1.216.0

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the locals configuration with `atmos describe locals kms -s cloudlabs-plat-ue1-dev`, then compare it with `atmos describe component kms -s cloudlabs-plat-ue1-dev`. Trace how the CLI resolves the stack and evaluates `.locals.prefix`; done means the locals value is available to the Terraform alias and `describe locals` recognizes the same stack.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, terraform, yaml
Domain
cli, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.