Loading...
Loading...
### Terraform Version ```shell 1.9.8 ``` ### Terraform Configuration Files ```terraform locals { first_year = 2023 current_timestamp = plantimestamp() current_year = formatdate("YYYY", local.current_timestamp) current_year_number = tonumber(local.current_year) table_years = toset(range(local.first_year, local.current_year_number + 2)) } output "table_years" { value = toset( [ for year in range(local.first_year, tonumber(formatdate("YYYY", local.current_timestamp)) + 2) : tostring(year) ] ) } ``` ### Debug Output Can't find related debug traces ### Expected Behavior The output shows the current date at plan time (2024-10-24.T11:58:00Z). ### Actual Behavior The output being shown is "0001-01-01T00:00:00Z". It causes the range function to fail with the following error: ``` Error: Error in function call │ │ on ../../../../component/trip-shared/terraform/constants/outputs.tf line 19, in output "trip_iceberg_table_years": │ 19: for year in range(local.first_year, tonumber(formatdate("YYYY", local.current_timestamp)) + 2) : tostring(year) │ ├──────────────── │ │ while calling range(params...) │ │ local.current_timestamp is "0001-01-01T00:00:00Z" │ │ local.first_year is 2023 ``` ### Steps to Reproduce terraform plan cannot directly reproduce in terraform console as planterraform does not exists there, but its output can be visualized with it. (terraform console -> local.current_timestamp) ### Additional Context _No response_ ### References _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.