-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Rules] Cloud Connector: Terraform documentation #18883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
src/content/docs/rules/cloud-connector/create-terraform.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| title: Configure Cloud Connector using Terraform | ||
| pcx_content_type: how-to | ||
| sidebar: | ||
| order: 4 | ||
| label: Configure using Terraform | ||
| head: | ||
| - tag: title | ||
| content: Configure Cloud Connector using Terraform | ||
| --- | ||
|
|
||
| You can create Cloud Connector using the [Terraform Cloudflare provider](https://registry.terraform.io/providers/cloudflare/cloudflare/latest). | ||
|
|
||
| To get started with Terraform for Cloudflare configuration, refer to [Terraform: Get started](/terraform/installing/). | ||
|
|
||
| ## Example configuration | ||
|
|
||
| Below is an example Terraform configuration that demonstrates creating Cloud Connectors for various [supported providers](/rules/cloud-connector/providers/) to route traffic between them based on URI paths: | ||
pedrosousa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ```tf | ||
| resource "cloudflare_cloud_connector_rules" "cloud_connector_rules" { | ||
| zone_id = "<ZONE_ID>" | ||
|
|
||
| rules { | ||
| description = "Route /data to GCP bucket" | ||
| enabled = true | ||
| expression = "(http.request.uri.path wildcard \"*/data/*\")" | ||
| provider = "gcp_storage" | ||
| parameters { | ||
| host = "mystorage.storage.googleapis.com" | ||
| } | ||
| } | ||
|
|
||
| rules { | ||
| description = "Route /resources to AWS bucket" | ||
| enabled = true | ||
| expression = "(http.request.uri.path wildcard \"*/resources/*\")" | ||
| provider = "aws_s3" | ||
| parameters { | ||
| host = "mystorage.s3.ams.amazonaws.com" | ||
| } | ||
| } | ||
|
|
||
| rules { | ||
| description = "Route /files to Azure bucket" | ||
| enabled = true | ||
| expression = "(http.request.uri.path wildcard \"*/files/*\")" | ||
| provider = "azure_storage" | ||
| parameters { | ||
| host = "mystorage.blob.core.windows.net" | ||
| } | ||
| } | ||
|
|
||
| rules { | ||
| description = "Route /images to R2 bucket" | ||
| enabled = true | ||
| expression = "(http.request.uri.path wildcard \"*/images/*\")" | ||
| provider = "cloudflare_r2" | ||
| parameters { | ||
| host = "mybucketcustomdomain.example.com" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## More resources | ||
|
|
||
| Refer to the [Terraform Cloudflare provider documentation](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs) for more information on the `cloudflare_cloud_connector_rules` resource. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.