Skip to content

Commit 36fd5dc

Browse files
Create partials and apply to new page
1 parent 08766d2 commit 36fd5dc

File tree

5 files changed

+131
-4
lines changed

5 files changed

+131
-4
lines changed

src/content/docs/byoip/service-bindings/cdn-and-spectrum.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar:
66
label: CDN and Spectrum
77
---
88

9+
import { Render } from "~/components";
10+
911
With [service bindings](/byoip/service-bindings/), CDN[^1] customers using BYOIP can use the same prefix they have onboarded to selectively route traffic on a per-IP address basis to [Spectrum](/spectrum/)[^2], and vice-versa. This means:
1012

1113
- You can upgrade individual IPs within a CDN prefix to a Spectrum IP. For example, if you have a CDN prefix 203.0.113.0/24, you can upgrade 203.0.113.1 to Spectrum.
@@ -15,19 +17,19 @@ sidebar:
1517

1618
## Before you begin
1719

18-
(partial adjusting the example with conditional)
20+
<Render file="service-bindings-prereqs" />
1921

2022
---
2123

2224
## Prepare your IPs
2325

2426
### 1. Get account information
2527

26-
(partial with conditionals)
28+
<Render file="service-bindings-account-info" />
2729

2830
### 2. Create service bindings
2931

30-
(partial with conditionals)
32+
<Render file="service-bindings-create-binding" />
3133

3234
### 3. Verify all service bindings
3335

@@ -47,7 +49,7 @@ Configure via API
4749

4850
## (Optional) Add layer 7 functionality
4951

50-
(partial)
52+
<Render file="service-bindings-related-products" />
5153

5254
[^1]: Layer 7 HTTP-based
5355
[^2]: Layer 4 or Layer 7 HTTP with custom ports
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
{}
3+
---
4+
5+
import { Example } from "~/components";
6+
7+
1. Log in to your Cloudflare account and get your [account ID](/fundamentals/setup/find-account-and-zone-ids/) and [API token](/fundamentals/api/get-started/create-token/). The token permissions should include `Account` - `IP Prefixes` - `Edit`.
8+
2. Make a `GET` request to the [List Services](/api/resources/addressing/subresources/services/methods/list/) endpoint and take note of the `id` associated with the CDN service.
9+
3. Use the [List Prefixes](/api/resources/addressing/subresources/prefixes/methods/list/) endpoint and take note of the `id` associated with the prefix (`cidr`) you will configure.
10+
11+
<Example>
12+
13+
At this point, continuing the [example](#before-you-begin), you should have a mapping similar to the following:
14+
15+
| Variables | Description |
16+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
17+
| `{service_id}` | The ID of the CDN service within Cloudflare. <br /><br /> Example: `969xxxxxxxx000xxx0000000x00001bf` |
18+
| `{prefix_id}` | The ID of the Magic Transit protected prefix (`203.0.113.0/24`) you want to configure. <br /><br /> Example: `6b25xxxxxxx000xxx0000000x0000cfc` |
19+
20+
</Example>
21+
22+
4. To confirm you currently have a Magic Transit service binding and that it spans across your entire prefix, make a `GET` request to the [List Service Bindings](/api/resources/addressing/subresources/prefixes/subresources/service_bindings/methods/list/) endpoint. Replace the `{prefix_id}` in the URI path by the actual prefix ID you got from the previous step.
23+
24+
<Example>
25+
26+
```bash
27+
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings \
28+
--header "Authorization: Bearer <API_TOKEN>"
29+
```
30+
31+
</Example>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
{}
3+
---
4+
5+
import { Example } from "~/components";
6+
7+
:::caution[Caution]
8+
Once a service binding is created (or deleted), it will take four to six hours to propagate across Cloudflare's global network. Services for the IP addresses in scope will likely be disrupted during this window.
9+
:::
10+
11+
1. Make a `POST` request to the [Create service binding](/api/resources/addressing/subresources/prefixes/subresources/service_bindings/methods/create/) endpoint, indicating the IP address you want to bind to the CDN. Specify the **corresponding network mask** as needed.
12+
13+
<Example>
14+
15+
Continuing the example, `203.0.113.100/32` designates an IP address that is within the Magic Transit protected prefix `203.0.113.0/24`.
16+
17+
Replace the `{prefix_id}` in the URI with your prefix ID from previous steps. Within the request body, the `cidr` value should correspond to the IP address or subnet that you are configuring for use with CDN.
18+
19+
```bash
20+
21+
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings \
22+
--header "Authorization: Bearer <API_TOKEN>" \
23+
--header "Content-Type: application/json" \
24+
--data '{
25+
"cidr": "203.0.113.100/32",
26+
"service_id": "<SERVICE_ID>"
27+
}'
28+
```
29+
30+
In the response body, the initial provisioning state should be `provisioning`.
31+
32+
```json output {9}
33+
{
34+
"errors": [],
35+
"messages": [],
36+
"success": true,
37+
"result": {
38+
"cidr": "203.0.113.100/32",
39+
"id": "<CDN_SERVICE_BINDING_ID>",
40+
"provisioning": {
41+
"state": "provisioning"
42+
},
43+
"service_id": "<SERVICE_ID>",
44+
"service_name": "CDN"
45+
}
46+
}
47+
```
48+
49+
</Example>
50+
51+
You can periodically check the service binding status using the [List Service Bindings](/api/resources/addressing/subresources/prefixes/subresources/service_bindings/methods/list/) endpoint.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
{}
3+
---
4+
5+
import { Details } from "~/components";
6+
7+
Although it is possible to add discrete bindings for non-contiguous CIDR blocks, implementing service bindings through an **aggregated** CIDR block is **strongly** recommended as it is more efficient.
8+
9+
<Details header="Example">
10+
11+
**Magic Transit protected prefix:** `203.0.113.0/24`
12+
13+
**IPs to upgrade to the CDN:**
14+
15+
`203.0.113.16`<br />
16+
`203.0.113.17`<br />
17+
`203.0.113.18`<br />
18+
`203.0.113.19`<br />
19+
`203.0.113.20`<br />
20+
`203.0.113.21`<br />
21+
`203.0.113.22`<br />
22+
`203.0.113.23`
23+
24+
Add one discrete CDN service binding for `203.0.113.16` with a `/29` netmask.
25+
26+
</Details>
27+
28+
Once a service binding is created (or deleted), it will take **four** to **six** hours to propagate across Cloudflare's global network. Services for the IP addresses in scope will likely be disrupted during this window.
29+
30+
:::note
31+
This guide assumes that the prefix is tied to a single Cloudflare account that has both Magic Transit and CDN properties. If you are using [prefix delegations](/byoip/concepts/prefix-delegations/), the service bindings must be [created](#2-create-service-binding) on the parent account.
32+
:::
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
{}
3+
---
4+
5+
import { Details } from "~/components";
6+
7+
Leverage other features according to your needs. For example:
8+
9+
- [Cache](/cache/)
10+
- [WAF custom rules](/waf/custom-rules/)
11+
- [Security analytics](/waf/analytics/security-analytics/)

0 commit comments

Comments
 (0)