Skip to content

Commit 1e5d5be

Browse files
authored
Discard changes to src/content/partials/cloudflare-one/access/add-target.mdx
1 parent 5584ae4 commit 1e5d5be

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed
Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
{}
3+
34
---
45

5-
import { Tabs, TabItem, Render, Details } from "~/components";
6+
import { Tabs, TabItem, Render, Details } from "~/components"
67

78
A target represents a single resource in your infrastructure (such as a server, Kubernetes cluster, database, or container) that users will connect to through Cloudflare. Targets are protocol-agnostic, meaning that you do not need to define a new target for each protocol that runs on the server.
89

@@ -28,30 +29,30 @@ If the target IP does not appear in the dropdown, go to **Networks** > **Routes*
2829
</TabItem>
2930
<TabItem label="API">
3031

31-
1. [Create an API token](/fundamentals/api/get-started/create-token/) with the following permissions:
32-
| Type | Item | Permission |
33-
| ------- | ---------------- | ---------- |
34-
| Account | Zero Trust | Edit |
32+
1. [Create an API token](/fundamentals/api/get-started/create-token/) with the following permissions:
33+
| Type | Item | Permission |
34+
| ------- | ---------------- | ---------- |
35+
| Account | Zero Trust | Edit |
3536

36-
2. Make a `POST` request to the [Infrastructure Access Targets](/api/resources/zero_trust/subresources/access/subresources/infrastructure/subresources/targets/methods/create/) endpoint:
37+
2. Make a `POST` request to the [Infrastructure Access Targets](/api/resources/zero_trust/subresources/access/subresources/infrastructure/subresources/targets/methods/create/) endpoint:
3738

38-
```sh
39-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/infrastructure/targets \
40-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
41-
--data '{
42-
"hostname": "infra-access-target",
43-
"ip": {
44-
"ipv4": {
45-
"ip_addr": "187.26.29.249",
46-
"virtual_network_id": "c77b744e-acc8-428f-9257-6878c046ed55"
47-
},
48-
"ipv6": {
49-
"ip_addr": "64c0:64e8:f0b4:8dbf:7104:72b0:ec8f:f5e0",
50-
"virtual_network_id": "c77b744e-acc8-428f-9257-6878c046ed55"
51-
}
52-
}
53-
}'
54-
```
39+
```sh
40+
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/infrastructure/targets \
41+
--header "Authorization: Bearer <API_TOKEN>" \
42+
--data '{
43+
"hostname": "infra-access-target",
44+
"ip": {
45+
"ipv4": {
46+
"ip_addr": "187.26.29.249",
47+
"virtual_network_id": "c77b744e-acc8-428f-9257-6878c046ed55"
48+
},
49+
"ipv6": {
50+
"ip_addr": "64c0:64e8:f0b4:8dbf:7104:72b0:ec8f:f5e0",
51+
"virtual_network_id": "c77b744e-acc8-428f-9257-6878c046ed55"
52+
}
53+
}
54+
}'
55+
```
5556

5657
</TabItem>
5758
<TabItem label="Terraform (v4)">
@@ -61,29 +62,28 @@ The following example requires Cloudflare provider version `>=4.45.0`.
6162
:::
6263

6364
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/4.45.0/docs/resources/api_token):
64-
65-
- `Teams Write`
65+
- `Teams Write`
6666

6767
2. Configure the [`cloudflare_zero_trust_infrastructure_access_target`](https://registry.terraform.io/providers/cloudflare/cloudflare/4.45.0/docs/resources/zero_trust_infrastructure_access_target) resource:
6868

69-
```tf
70-
resource "cloudflare_zero_trust_infrastructure_access_target" "infra-ssh-target" {
71-
account_id = var.cloudflare_account_id
72-
hostname = "infra-access-target"
73-
ip = {
74-
ipv4 = {
75-
ip_addr = "187.26.29.249"
76-
virtual_network_id = "c77b744e-acc8-428f-9257-6878c046ed55"
77-
}
78-
ipv6 = {
79-
ip_addr = "64c0:64e8:f0b4:8dbf:7104:72b0:ec8f:f5e0"
80-
virtual_network_id = "c77b744e-acc8-428f-9257-6878c046ed55"
81-
}
82-
}
83-
}
84-
```
69+
```tf
70+
resource "cloudflare_zero_trust_infrastructure_access_target" "infra-ssh-target" {
71+
account_id = var.cloudflare_account_id
72+
hostname = "infra-access-target"
73+
ip = {
74+
ipv4 = {
75+
ip_addr = "187.26.29.249"
76+
virtual_network_id = "c77b744e-acc8-428f-9257-6878c046ed55"
77+
}
78+
ipv6 = {
79+
ip_addr = "64c0:64e8:f0b4:8dbf:7104:72b0:ec8f:f5e0"
80+
virtual_network_id = "c77b744e-acc8-428f-9257-6878c046ed55"
81+
}
82+
}
83+
}
84+
```
8585

8686
</TabItem>
8787
</Tabs>
8888

89-
Next, create an infrastructure application to secure the target.
89+
Next, create an infrastructure application to secure the target.

0 commit comments

Comments
 (0)