gomplate settings does not respect timeout parameter or env variables
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 175
- Avg merge
- 2d 25m
- Merged PRs (30d)
- 143
Description
### 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` `gomplate`s 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=&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 -s `.
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:
```yaml
templates:
settings:
env:
AWS_TIMEOUT: "5000"
gomplate:
enabled: true
timeout: 10
datasources:
datasource-from-secret:
url: "aws+sm:"
```
2. 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'
...
```
3. 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_
Contributor guide
Research direction
Start by reproducing the gomplate datasource timeout with the `templates.settings.gomplate.timeout` and `templates.settings.env.AWS_TIMEOUT` values shown in the issue, then trace how those settings reach the AWS SDK Go request. Done means both configuration forms prevent the default timeout failure during `atmos terraform plan`; verify against the reported `atmos` and Terraform versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, go
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100