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 + Multi Repo Setup
Description
→ One Repo → Multiple Branch → One Droplet → Multiple Domain
First Script → Setup our project Environment
Second Script → Run Project
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 API Tokens in Digital Ocean
Go to
DigitalOcean's API tokens page
and log in to your account.
Generate a New Token
Name the Token
Expiration :- 30/60/90 days and No Expire
Set Permissions :- full access
Go to AWS Console
go to security credentials
Go to Users
Create access key
Create Access key
Copy Access Key & Secret Access Key
Secret Name
Go to secret Manager → select Secret
Store a new Secret
add env in key pair values or plaintext that support json format
add name
Click Next
Store the Secret
env-test →secret_name
Create terraform.tfvars file
do_token =
"" #API TOKEN
ssh_public_key_path =
"" #public_key_path
ssh_private_key_path =
""#private_key_path
droplet_image =
"ubuntu-24-04-x64"
droplet_name =
"web-server" #droplet_name
droplet_region =
"blr1"
droplet_size =
"s-1vcpu-1gb"
aws_access_key =
" " #access_key
aws_secret_key =
"" #secret_key
aws_region =
"us-east-1" # region
node_version =
"18"
dragonfly_repo =
"git@github.com:owner/repo_name.git" #repo name
dragonfly_port = port of dragonfly
dragonfly_domain =
"" # Domain name
dragonfly_secret =
"" #secret name
dragonfly_branch =
"" #branch name
firefly_repo =
"git@github.com:owner/repo_name.git" #repo name
firefly_port = port of firefly
firefly_domain =
"" # Domain name
firefly_secret =
"" #secret name
firefly_branch =
"" #branch name
Save the file
→ Open Terminal in that Folder
terraform init
terraform plan
apply → Create Droplet Server & install dependencies
terraform apply
Run repo name wise
Run Dragonfly
Start Dragonfly
terraform apply -var="app_action=setup_dragonfly"
Destroy Dragonfly
terraform apply -var="app_action=destroy_dragonfly"
Run Firefly
Start Dragonfly
terraform apply -var="app_action=setup_firefly"
Destroy Dragonfly
terraform apply -var="app_action=destroy_firefly"
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.