JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
Terraform Digital Ocean Script
Terraform Digital Ocean Script
Terraform Digital Ocean Script v2
Terraform Vercel
Terraform MongoDB(PaidTier)
Terraform MongoDB(FreeTier)
Terraform + Private Repo Clone with SSH Key
Terraform Strapi
Terraform GitHub Secret
Terraform + Secret Manager
Untitled sync page
Terraform GitHub action CronJob
Terraform + Multi Repo Setup
SSO-Ready
More
Share
Explore
Terraform GitHub action CronJob
Schedule GitHub action workflow for specific time (UTC based)
Download Terraform
https://releases.hashicorp.com/terraform/1.9.5/terraform_1.9.5_windows_amd64.zip
Extract zip file
→ run terraform.exe
check terraform version
terraform --version
Download terraform code from here
GitHub
Create Account on Terraform cloud
https://app.terraform.io/session
Click on Free Account
Verify email address
Create Organization
Create API- Driven Workspace
Add Details
Work Space Created
Go to variable Section add digital Ocean Token according name in main.tf
go to settings
Select auto apply & save settings
Generate API Token
https://app.terraform.io/app/settings/tokens?source=terraform-login
click on above link
create user token
Copy and save the token
Copy workspace id
Add this secrets in GitHub actions
ORG_NAME = “organization name of terraform cloud”
TERRAFORM_API_TOKEN = ”Token of Terraform cloud”
TF_VAR_DIGITALOCEAN_TOKEN = “digital ocean token”
WORKSPACE_ID =” workspace id “
WORKSPACE_NAME = “ name of workspace”
Workflow file
schedule based on UTC time period
Go to this website for utc time conversion →
https://dateful.com/convert/utc
Go to this website for cronjob expression →
https://crontab.guru/
Uncomment this part in workflow file to schedule GitHub action
Example
in above screenshot 5:56 is UTC time
make cronjob expression for it
Type like below screenshot
schedule
:
-
cron
:
'56 5* * *'
# Schedule for 11:26 AM daily
Run Terraform cloud Locally
Same code as GitHub
In terminal Configure Terraform Cloud
terraform init -reconfigure
Add Yes in Terminal
Add token in terminal
Plan terraform
terraform plan
Apply Terraform
terraform apply
Single Project → Multiple Environment (Workspace)
Create Work Space
This link can't be embedded.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.