Terraform ↗ is a tool for building, changing, and versioning infrastructure, and provides components and documentation for building Cloudflare resources ↗. Listed below are examples to help you get started with building Access with Terraform. For a more generalized guide on configuring Cloudflare and Terraform, visit our Getting Started with Terraform and Cloudflare ↗ blog post.
Create an application with Terraform
Create an application.
Here is an example configuration:
Next, we need to export our environment variables and secrets:
Now we can run a terraform plan which will output any proposed changes. Make sure to review the plan carefully:
Apply these changes using the apply command, once they look accurate and you're comfortable moving forward:
Create a policy
After you've created an application, you can start creating policies and attaching them to applications:
To do so:
Run a terraform plan:
Next, apply these changes using the apply command, once they look accurate and you're comfortable moving forward:
Configuring an identity provider
The example below shows how you can configure an identity provider and attach it to a policy:
These are the basics to get up and running with Access and Terraform. Refer to our API documentation for other endpoints that can be managed via Terraform.
Was this helpful?
What did you like?
What went wrong?
Thank you for helping improve Cloudflare's documentation!