Skip to content

Commit 9e886ee

Browse files
author
iru
authored
docs: clarify authentication (#212)
1 parent a130c55 commit 9e886ee

File tree

1 file changed

+69
-33
lines changed

1 file changed

+69
-33
lines changed

website/docs/index.md

Lines changed: 69 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,71 +9,107 @@ description: |-
99

1010
The Sysdig provider is used to interact with
1111
[Sysdig Secure](https://sysdig.com/product/secure/) and
12-
[Sysdig Monitor](https://sysdig.com/product/monitor/) products. The provider
13-
needs to be configure with the proper API token before it can be used.
12+
[Sysdig Monitor](https://sysdig.com/product/monitor/) products.
13+
14+
For Sysdig provider authentication **one of Monitor or Secure authentication is required**, being the other
15+
optional.
16+
17+
For either options, the corresponding **URL** and **API Token** must be configured.
18+
See options bellow.
1419

1520
Use the navigation to the left to read about the available resources.
1621

1722
## Example Usage
1823

24+
### Monitor Authentication
25+
1926
```terraform
20-
// Configure the Sysdig provider
2127
provider "sysdig" {
22-
sysdig_monitor_api_token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
23-
sysdig_secure_api_token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
28+
sysdig_monitor_url = "https://app.sysdigcloud.com"
29+
sysdig_monitor_api_token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
2430
}
31+
```
2532

26-
// Create a new secure policy
27-
resource "sysdig_secure_policy" "unexpected_inbound_tcp_connection_traefik" {
28-
# ...
33+
### Secure Authentication
34+
35+
```terraform
36+
provider "sysdig" {
37+
sysdig_secure_url="https://secure.sysdig.com"
38+
sysdig_secure_api_token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
2939
}
3040
```
3141

32-
## Example with extra headers
42+
### Both Secure and Monitor Provider Authentication
3343

3444
```terraform
3545
provider "sysdig" {
36-
sysdig_monitor_api_token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
46+
47+
sysdig_secure_url="https://secure.sysdig.com"
3748
sysdig_secure_api_token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
49+
50+
sysdig_monitor_url = "https://app.sysdigcloud.com"
51+
sysdig_monitor_api_token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
52+
3853
extra_headers = {
3954
"Proxy-Authorization": "Basic xxxxxxxxxxxxxxxx"
4055
}
4156
}
57+
58+
59+
// create a new secure policy
60+
resource "sysdig_secure_policy" "unexpected_inbound_tcp_connection_traefik" {
61+
# ...
62+
}
4263
```
4364

4465
## Configuration Reference
4566

46-
The following keys can be used to configure the provider.
67+
For Sysdig provider authentication **one of Monitor or Secure authentication is required**, being the other
68+
optional.
4769

48-
* `sysdig_monitor_api_token` - (Optional) The Sysdig Monitor API token, it must be
49-
present, but you can get it from the `SYSDIG_MONITOR_API_TOKEN` environment variable.
50-
Required if any `sysdig_monitor_*` resource or data source is used.
5170

52-
* `sysdig_secure_api_token` - (Optional) The Sysdig Secure API token, it must be
53-
present, but you can get it from the `SYSDIG_SECURE_API_TOKEN` environment variable.
54-
Required if any `sysdig_secure_*` resource or data source is used.
71+
### Monitor authentication
72+
73+
When Monitor resources are to be created, this authentication must be in place.
74+
75+
* `sysdig_monitor_url` - (Required) This is the target Sysdig Monitor base API
76+
endpoint. It's intended to be used with OnPrem installations.
77+
<br/>By default, it points to `https://app.sysdigcloud.com`. [Find your Sysdig Saas region url](https://docs.sysdig.com/en/docs/administration/saas-regions-and-ip-ranges/#saas-regions-and-ip-ranges) (Sysdig Monitor endpoint)</br>
78+
It can also be sourced from the `SYSDIG_MONITOR_URL` environment variable.<br/>Notice: it should not be ended with a
79+
slash.<br/><br/>
80+
81+
* `sysdig_monitor_api_token` - (Required) The Sysdig Monitor API token.
82+
<br/>[Find API Token](https://docs.sysdig.com/en/docs/administration/on-premises-deployments/find-the-super-admin-credentials-and-api-token/#find-sysdig-api-token)
83+
<br/>It can also be configured from the `SYSDIG_MONITOR_API_TOKEN` environment variable.
84+
<br/>Required if any `sysdig_monitor_*` resource or data source is used.<br/><br/>
5585

56-
* `sysdig_monitor_url` - (Optional) This is the target Sysdig Monitor base API
57-
endpoint. It's intended to be used with OnPrem installations. By defaults it
58-
points to `https://app.sysdigcloud.com`, and notice that should not be ended
59-
with an slash. It can also be sourced from the `SYSDIG_MONITOR_URL` environment
60-
variable.
61-
62-
* `sysdig_secure_url` - (Optional) This is the target Sysdig Secure base API
63-
endpoint. It's intended to be used with OnPrem installations. By defaults it
64-
points to `https://secure.sysdig.com`, and notice that should not be ended
65-
with an slash. It can also be sourced from the `SYSDIG_SECURE_URL` environment
66-
variable.
67-
6886
* `sysdig_monitor_insecure_tls` - (Optional) Defines if the HTTP client can ignore
69-
the use of invalid HTTPS certificates in the Monitor API. It can be useful for
70-
on-prem installations. It can also be sourced from the `SYSDIG_MONITOR_INSECURE_TLS`
71-
environment variable. By default this is false.
87+
the use of invalid HTTPS certificates in the Monitor API. It can be useful for
88+
on-prem installations.<br/> It can also be sourced from the `SYSDIG_MONITOR_INSECURE_TLS`
89+
environment variable. By default, this is false.
90+
91+
92+
### Secure Authentication
93+
94+
When Secure resources are to be created, this authentication must be in place.
95+
96+
* `sysdig_secure_url` - (Required) This is the target Sysdig Secure base API
97+
endpoint. It's intended to be used with OnPrem installations.
98+
<br/>By default, it points to `https://secure.sysdig.com`.
99+
<br/>[Find your Sysdig Saas region url](https://docs.sysdig.com/en/docs/administration/saas-regions-and-ip-ranges/#saas-regions-and-ip-ranges) (Secure endpoint)
100+
<br/> It can also be sourced from the `SYSDIG_SECURE_URL` environment variable.
101+
<br/>Notice: it should not be ended with a slash.<br/><br/>
102+
103+
* `sysdig_secure_api_token` - (Required) The Sysdig Secure API token
104+
<br/>[Find API Token](https://docs.sysdig.com/en/docs/administration/on-premises-deployments/find-the-super-admin-credentials-and-api-token/#find-sysdig-api-token)
105+
<br/>It can also be configured from the `SYSDIG_SECURE_API_TOKEN` environment variable.
106+
<br/>Required if any `sysdig_secure_*` resource or data source is used.<br/><br/>
72107

73108
* `sysdig_secure_insecure_tls` - (Optional) Defines if the HTTP client can ignore
74109
the use of invalid HTTPS certificates in the Secure API. It can be useful for
75110
on-prem installations. It can also be sourced from the `SYSDIG_SECURE_INSECURE_TLS`
76-
environment variable. By default this is false.
111+
environment variable. By default, this is false.<br/><br/>
77112

113+
### Others
78114
* `extra_headers` - (Optional) Defines extra HTTP headers that will be added to the client
79115
while performing HTTP API calls.

0 commit comments

Comments
 (0)