Skip to content

gomplate settings does not respect timeout parameter or env variables #1191

@sequoiahead

Description

@sequoiahead

Describe the Bug

Despite that gomplate has timeout settings configured in atmos.yaml as gomplate.timeout or env.AWS_TIMEOUT - the framework does not seem to respect timeout setting and still uses the default AWS SDK Go timeout.

When I execute atmos plan for a component which uses datasource gomplates function - plan fails with timeout error:

RequestError: send request failed
caused by: Get "https://portal.sso.us-east-1.amazonaws.com/federation/credentials?account_id=<account-id>&role_name=<role-name>": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

When I ran the same atmos command with env variable set by the shell - there is no timeout error, e.g AWS_TIMEOUT="5000" atmos terraform plan <component> -s <stack>.

AWS SDK Go has a default timeout set at 500ms, which kind of explains the timeout error.

Expected Behavior

When templates.settings.gomplate.timeout set to 5 (seconds) or templates.settings.env.AWS_TIMEOUT set to 5000 (ms) in atmos.yaml - gotemplate datasource function will respect the settings

Steps to Reproduce

  1. in atmos.yaml configure template settings:
templates:
  settings:
    env:
      AWS_TIMEOUT: "5000"
    gomplate:
      enabled: true
      timeout: 10
      datasources:
        datasource-from-secret:
          url: "aws+sm:<secret-name>"
  1. Use gomplate datasource function in a component:
    components/sns-topic:
      metadata:
        component: sns-topic
        inherits:
          - sns-topic/defaults
      vars:
        name: 'component'
...
            endpoint: 'https://host.example/{{ (datasource "datasource-from-secret") }}/example'
...
  1. run `atmos terraform plan component/sns-topic -s

Screenshots

No response

Environment

  • atmos version 1.168.0
  • Terraform version 1.9.8

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