Terraform (AWS)
You must generate an Access Key before getting started. All examples will utilize access_key_id
and access_key_secret
variables which represent the Access Key ID and Secret Access Key values you generated.
This example shows how to configure R2 with Terraform using the AWS provider ↗.
With terraform
↗ installed:
- Create
main.tf
file, or edit your existing Terraform configuration - Populate the endpoint URL at
endpoints.s3
with your Cloudflare account ID - Populate
access_key
andsecret_key
with the corresponding R2 API credentials. - Ensure that
skip_region_validation = true
,skip_requesting_account_id = true
, andskip_credentials_validation = true
are set in the provider configuration.
You can then use terraform plan
to view the changes and terraform apply
to apply changes.