Skip to content

terraform_workspace_template does not work in Global Metadata #3452

Closed

Description

Describe the Bug

Setting up

metadata:
  terraform_workspace_template: '{{ .vars.rgn }}-{{ .vars.account_name }}-{component}'  # noqa: useless-boilerplate

in most top _defaults.yaml not only result only result in Incorrect type. Expected "string". yaml-schema: metadata

but also gets during atmos terraform plan

Error
Error: metadata field is not allowed at global (stack-wide) scope

:bulb: Global metadata only supports: labels, tags, custom, enabled, locked, terraform_workspace_pattern

:bulb: Move component-identity fields (component, inherits, type, name, terraform_workspace) under
components.<type>.<name>.metadata

Expected Behavior

I assume terraform_workspace_template should be allowed in global metadata, same as terraform_workspace_pattern

And there should be no yaml-schema error

Steps to Reproduce

  1. Add to top _defaults.yaml
metadata:
  terraform_workspace_template: '{{ .vars.rgn }}-{{ .vars.account_name }}-{component}'  # noqa: useless-boilerplate
  1. Run atmos terraform plan <something>

Screenshots

Image

Environment

  • OS: Ubuntu 22.04
  • atmos 1.233.0
  • terraform 1.16.6

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions