This is backend-builder of Website favorite(like) and develop extend feature.
Create Accounts and publish tokens
- Upstash
- Create API Key from Management API
- Cloudflare
- Create API Token from User API Token
- NOT API Key
- Set allocation of...
- Account-Workers Script-Edit
- Zone-Workers Route-Edit (Only if you use workers route)
- Create API Token from User API Token
Install terraform CLI. Reference is here.
This product use R2 storage as tfstate backend.
If you use save tfstate on Cloudflare R2, you need to get R2 Access key, Access secret and endpoint url from https://dash.cloudflare.com/<CLOUDFLARE_ACCOUNT_ID>/r2/api-tokens
After you got Access key, Access secret and endpoint url, edit terraform.tfbackend
from terraform.tfbackend.template
If you manage tfstate on local, you don't need to setup terraform.tfbackend
.
If you don't need to manage tfstate on Cloudflare R2, edit provider.tf
, remove backend "s3"
block or delete provider.tf
.
terraform {
- backend "s3" {
- bucket = "tfstate"
- key = "extendfavorite.tfstate"
- region = "auto"
- skip_credentials_validation = true
- skip_region_validation = true
- skip_requesting_account_id = true
- skip_metadata_api_check = true
- skip_s3_checksum = true
- }
}
Prepair terraform.tfvars
file from terraform.tfvars.template
For LAZINESS or ANNOY of Cloudflare Developper team, workers route of workers.dev
zone cannot enable with terraform deploy.
3 Issue about this problem but it closed with any resolve.
Enable the default route for cloudflare workers #2892 (Closed with NO support)
Support Worker Domains #1921 (Closed with NO support)
Support for Workers.dev route #1013 (Closed with NO support)
So favoExtend
only support workers route of domains you managed in cloudflare domain.
If you wanna use workers.dev
, manually setup by dashboard.
Initialize environment
terraform init -backend-config terraform.tfbackend
Plan deploy
terraform plan
Deploy
terraform apply
Destroy
terraform destroy
If you need to Extend API, see Extend Guide(README.md).
Install Terraform | Terraform | HashiCorp Developer
Support Cloudflare r2 for storing Terraform state #33847
Japanese Reference(Zenn/favoExtend マニュアル)