Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

---

import { Tabs, TabItem } from '~/components';
import { Tabs, TabItem, Details } from '~/components';

<Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard">

Expand Down Expand Up @@ -32,35 +32,56 @@ import { Tabs, TabItem } from '~/components';

```tf
resource "cloudflare_zero_trust_access_service_token" "example_service_token" {
account_id = var.cloudflare_account_id
name = "Example service token"
duration = "8760h"
}
```
account_id = var.cloudflare_account_id
name = "Example service token"
duration = "8760h"

3. Output the Client ID and Client Secret to the Terraform state file:

```tf
output "example_service_token_client_id" {
value = cloudflare_zero_trust_access_service_token.example_service_token.client_id
lifecycle {
create_before_destroy = true
}
}
```

output "example_service_token_client_secret" {
value = cloudflare_zero_trust_access_service_token.example_service_token.client_secret
sensitive = true
3. Get the Client ID and Client Secret of the service token:

<Details header="Example: Output to CLI" open = {false}>
1. Output the Client ID and Client Secret to the Terraform state file:
```tf
output "example_service_token_client_id" {
value = cloudflare_zero_trust_access_service_token.example_service_token.client_id
}

output "example_service_token_client_secret" {
value = cloudflare_zero_trust_access_service_token.example_service_token.client_secret
sensitive = true
}
```
2. Apply the configuration:
```sh
terraform apply
```
3. Read the Client ID and Client Secret:
```sh
terraform output -raw example_service_token_client_id
```
```sh
terraform output -raw example_service_token_client_secret
```
</Details>

<Details header="Example: Store in HashiCorp Vault" open = {false}>
```tf
resource "vault_generic_secret" "example_service_token" {
path = "kv/cloudflare/example_service_token"
disable_read = true

data_json = jsonencode({
"CLIENT_ID" = cloudflare_access_service_token.example_service_token.client_id
"CLIENT_SECRET" = cloudflare_access_service_token.example_service_token.client_secret
})
}
```
4. Apply the configuration:
```sh
terraform apply
```
</Details>

5. Read the Client ID and Client Secret:
```sh
terraform output -raw example_service_token_client_id
```
```sh
terraform output -raw example_service_token_client_secret
```

</TabItem> </Tabs>
Loading