Skip to content

Support tfstate lookup in ecspresso.yml #852

@h-matsuo

Description

@h-matsuo

It would be more convenient if ecspresso could support looking up tfstate values directly in ecspresso.yml 👀

A common use case for this is when the ECS cluster name is managed by Terraform.

Currently, using the following configuration causes an error:

region: ap-northeast-1
cluster: '{{ tfstate `output.ecs_cluster_name` }}'
service: sample
service_definition: ecs-service-def.jsonnet
task_definition: ecs-task-def.jsonnet
timeout: 10m0s
plugins:
  - name: tfstate
    config:
      url: s3://sample-bucket/terraform.tfstate

Error output:

$ ecspresso diff
2025-06-15T17:51:09.262+09:00 [INFO] ecspresso version: v2.5.0
2025-06-15T17:51:09.262+09:00 [ERROR] FAILED. failed to load config file .ecspresso.yml: config parse by template failed: template: conf:2: function "tfstate" not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions