Skip to content

Comments in .tmpl are evaluated #1688

@petabook

Description

@petabook

Describe the Bug

Atmos version v1.195.0.
This new version caught an error in one of my .tmpl files that previous versions missed - so far, so good.
However, after commenting out the problematic line, it still reports the same error. It only stops complaining once the line is completely removed.

catalog/qh/di/aws-tgw-attachment/secondary.yaml.tmpl

components:
  terraform:
    "tgw-attachment/{{ .name }}":
      metadata:
        component: cloudposse/aws-tgw-attachment
      vars:
        name: "{{ .name }}"
        vpc_component_name: "vpc/{{ .name }}"
        transit_gateway_id: !terraform.state tgw-hub transit_gateway_id
        transit_gateway_route_table_id: !terraform.state tgw-hub transit_gateway_route_table_id
        # transit_gateway_attachment_subnet_name: '{{ default "" .transit_gateway_attachment_subnet_name }}'

The error

Executing command: `atmos terraform deploy cloudposse/aws-team-roles -s core-gbl-root`

 Error

 invalid stack manifest: template: catalog/qh/di/aws-tgw-attachment/secondary.yaml.tmpl:11:65: executing "catalog/qh/di/aws-tgw-attachment/secondary.yaml.tmpl" at <.transit_gateway_attachment_subnet_name>: map has no entry for key "transit_gateway_attachment_subnet_name"

 File being processed: catalog/qh/di/aws-tgw-attachment/secondary.yaml.tmpl
 Import chain:
   → orgs/qh/prod/sanofi/eu-west-3/network.yaml
     → catalog/qh/di/network-secondary.yaml
     → catalog/qh/di/aws-tgw-attachment/secondary.yaml.tmpl
 stack manifest 'catalog/qh/di/aws-tgw-attachment/secondary.yaml.tmpl'

Expected Behavior

Ignore comments.

Steps to Reproduce

Provided above.

Screenshots

No response

Environment

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions