Skip to content

Instantly share code, notes, and snippets.

@mitsutaka
Created June 19, 2022 03:13
Show Gist options
  • Save mitsutaka/33ca96ea6d17d28756e551cd62a71c6e to your computer and use it in GitHub Desktop.
Save mitsutaka/33ca96ea6d17d28756e551cd62a71c6e to your computer and use it in GitHub Desktop.
Terraform s3 backend config using Cloudflare R2
terraform {
backend "s3" {
access_key = "<access_key_id>"
secret_key = "<access_key_secret>"
endpoint = "<account_id>.r2.cloudflarestorage.com"
force_path_style = true
bucket = "<bucket name>" # e.g. tfstate
key = "<state name>" # e.g. tfe
region = "auto"
skip_region_validation = true
skip_credentials_validation = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment