<@U04S8PLJWMT> when setting a cron schedule for a ...
# ask-ai
n
@kapa.ai when setting a cron schedule for a connection via terraform, how can I set the timezone?
k
New message text here
n
Why does this response differ greatly from what the terraform documentation provides https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/connection#nested-schema-for-schedule @kapa.ai
k
A message from kapa.ai
I apologize for the confusion in my previous response. You are correct to point out the discrepancy between my answer and the official Terraform documentation for Airbyte. Let me provide a more accurate answer based on the official Terraform provider documentation. The reason for the difference is that my previous response was based on outdated or incorrect information from a forum post, which doesn't accurately reflect the current Terraform provider implementation for Airbyte connections. According to the official [Terraform provider documentation for Airbyte connections](https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/connection#nested-schema-for-schedule), the correct way to set a cron schedule with a timezone using Terraform is as follows:
Copy code
hcl schedule {   cron {     cron_expression = "0 0 * * * ?"     cron_time_zone  = "America/New_York"   } }
In this structure: -
schedule
is the top-level block -
cron
is nested within
schedule
-
cron_expression
and
cron_time_zone
are attributes within the
cron
block This structure differs from what I previously suggested, which was incorrect. The Terraform provider documentation is the authoritative source for how to properly configure Airbyte resources using Terraform. I apologize for the misinformation in my previous response. Thank you for bringing this to my attention, as it allows me to provide you with the correct information based on the official documentation.
n
@kapa.ai great thank you. What if I want to set the timezone to UTC
k
A message from kapa.ai
You're welcome! If you want to set the timezone to UTC for a cron schedule in an Airbyte connection using Terraform, you can simply use "UTC" as the value for the
cron_time_zone
attribute. Here's how you would configure it:
Copy code
hcl schedule {   cron {     cron_expression = "0 0 * * * ?"     cron_time_zone  = "UTC"   } }
In this configuration: -
cron_expression
is set to run at midnight every day (you can adjust this as needed) -
cron_time_zone
is set to "UTC" This setup ensures that your cron schedule will run based on Coordinated Universal Time (UTC), regardless of the server's local time or daylight saving time changes. This information is based on the official [Terraform provider documentation for Airbyte connections](https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/connection#nested-schema-for-schedule), which provides the correct structure for setting up schedules in Airbyte connections using Terraform.