Skip to content

Commit 320dd2b

Browse files
authored
[Rules] Add Cloud Connector Terraform example (#16624)
1 parent ff6b4e8 commit 320dd2b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
pcx_content_type: example
3+
summary: Route requests with a URI path starting with `/images` to a specific AWS S3 bucket with Cloud Connector using Terraform.
4+
products:
5+
- Cloud Connector
6+
title: Route /images to an S3 Bucket using Terraform
7+
description: Route requests with a URI path starting with `/images` to a specific AWS S3 bucket with Cloud Connector using Terraform.
8+
---
9+
10+
import { Render } from "~/components";
11+
12+
The following example defines a single Cloud Connector rule for a zone using Terraform. The rule routes requests to `/images` on your domain to an AWS S3 bucket.
13+
14+
```tf
15+
resource "cloudflare_cloud_connector_rules" "serve_images_in_aws" {
16+
zone_id = "<ZONE_ID>"
17+
rules {
18+
description = "Route images to AWS S3 bucket"
19+
enabled = true
20+
expression = "http.request.full_uri wildcard \"https://<YOUR_HOSTNAME>/images/*\""
21+
provider = "aws_s3"
22+
parameters {
23+
host = "<BUCKET_NAME>.s3.amazonaws.com"
24+
}
25+
}
26+
}
27+
```
28+
29+
<Render file="terraform-additional-resources" />

0 commit comments

Comments
 (0)