Skip to content

Commit b94c040

Browse files
Implement conditional content and other improvements
1 parent 36fd5dc commit b94c040

File tree

4 files changed

+49
-24
lines changed

4 files changed

+49
-24
lines changed

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

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,41 @@ import { Render } from "~/components";
1414

1515
- You can upgrade individual IPs within a Spectrum prefix to a CDN IP. For example, if you have a Spectrum prefix 203.0.113.0/24, you can upgrade 203.0.113.1 to CDN.
1616

17+
This guide will use the first example, considering a prefix that was onboarded to the CDN and will have a few IPs upgraded to Spectrum.
1718

1819
## Before you begin
1920

20-
<Render file="service-bindings-prereqs" />
21+
<Render
22+
file="service-bindings-prereqs"
23+
params={{
24+
pre_existing_product: "CDN",
25+
added_product: "Spectrum"
26+
}}
27+
/>
2128

2229
---
2330

2431
## Prepare your IPs
2532

2633
### 1. Get account information
2734

28-
<Render file="service-bindings-account-info" />
35+
<Render
36+
file="service-bindings-account-info"
37+
params={{
38+
pre_existing_product: "CDN",
39+
added_product: "Spectrum"
40+
}}
41+
/>
2942

3043
### 2. Create service bindings
3144

32-
<Render file="service-bindings-create-binding" />
45+
<Render
46+
file="service-bindings-create-binding"
47+
params={{
48+
pre_existing_product: "CDN",
49+
added_product: "Spectrum"
50+
}}
51+
/>
3352

3453
### 3. Verify all service bindings
3554

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
{}
2+
params:
3+
- pre_existing_product
4+
- added_product
35
---
46

5-
import { Example } from "~/components";
7+
import { Example, APIRequest } from "~/components";
68

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+
1. Log in to your Cloudflare account and get your [account ID](/fundamentals/setup/find-account-and-zone-ids/) and [authentication key or token](/fundamentals/api/get-started/). If using an [API token](/fundamentals/api/get-started/create-token/), the permissions should include `Account` - `IP Prefixes` - `Edit`.
10+
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 {props.added_product} service.
911
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.
1012

1113
<Example>
@@ -14,18 +16,18 @@ At this point, continuing the [example](#before-you-begin), you should have a ma
1416

1517
| Variables | Description |
1618
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
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+
| `{service_id}` | The ID of the {props.added_product} service within Cloudflare. <br /><br /> Example: `969xxxxxxxx000xxx0000000x00001bf` |
20+
| `{prefix_id}` | The ID of the {props.pre_existing_product} prefix (`203.0.113.0/24`) you want to configure. <br /><br /> Example: `6b25xxxxxxx000xxx0000000x0000cfc` |
1921

2022
</Example>
2123

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.
24+
4. To confirm you currently have a {props.pre_existing_product} 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.
2325

2426
<Example>
2527

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-
```
28+
<APIRequest
29+
path="/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings"
30+
method="GET"
31+
/>
3032

3133
</Example>

src/content/partials/byoip/service-bindings-create-binding.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
{}
2+
params:
3+
- pre_existing_product
4+
- added_product
35
---
46

57
import { Example } from "~/components";
@@ -8,13 +10,13 @@ import { Example } from "~/components";
810
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.
911
:::
1012

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.
13+
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 {props.added_product}. Specify the **corresponding network mask** as needed.
1214

1315
<Example>
1416

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`.
17+
Continuing the example, `203.0.113.100/32` designates an IP address that is within the {props.pre_existing_product} prefix `203.0.113.0/24`.
1618

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.
19+
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 {props.added_product}.
1820

1921
```bash
2022

@@ -36,7 +38,7 @@ In the response body, the initial provisioning state should be `provisioning`.
3638
"success": true,
3739
"result": {
3840
"cidr": "203.0.113.100/32",
39-
"id": "<CDN_SERVICE_BINDING_ID>",
41+
"id": "<SERVICE_BINDING_ID>",
4042
"provisioning": {
4143
"state": "provisioning"
4244
},
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
{}
2+
params:
3+
- pre_existing_product
4+
- added_product
35
---
46

57
import { Details } from "~/components";
@@ -8,9 +10,9 @@ Although it is possible to add discrete bindings for non-contiguous CIDR blocks,
810

911
<Details header="Example">
1012

11-
**Magic Transit protected prefix:** `203.0.113.0/24`
13+
**{props.pre_existing_product} protected prefix:** `203.0.113.0/24`
1214

13-
**IPs to upgrade to the CDN:**
15+
**IPs to upgrade to {props.added_product}:**
1416

1517
`203.0.113.16`<br />
1618
`203.0.113.17`<br />
@@ -21,12 +23,12 @@ Although it is possible to add discrete bindings for non-contiguous CIDR blocks,
2123
`203.0.113.22`<br />
2224
`203.0.113.23`
2325

24-
Add one discrete CDN service binding for `203.0.113.16` with a `/29` netmask.
26+
Add one discrete {props.added_product} service binding for `203.0.113.16` with a `/29` netmask.
2527

2628
</Details>
2729

2830
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.
2931

3032
:::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.
33+
This guide assumes that the prefix is tied to a single Cloudflare account that has both {props.pre_existing_product} and {props.added_product} 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.
3234
:::

0 commit comments

Comments
 (0)