Skip to content

Commit 8ae1615

Browse files
authored
Merge pull request #445 from rollbar/pawel/update_docs
updating docs
2 parents b722aba + c018172 commit 8ae1615

3 files changed

Lines changed: 75 additions & 39 deletions

File tree

docs/resources/integration.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,14 @@ This resource can manage configuration for the Slack, Webhook, Email and PagerDu
1313
Example Usage
1414
-------------
1515

16-
```hcl
17-
# Set the rollbar provider to manage a project
18-
#
19-
# NOTE: the account access token `api_key` is not required
20-
# for managing project however it should be set if you want
21-
# to use the provider for managing account-level resources
22-
# in addition to project-level resources
16+
**Option 1: Using a project access token**
2317

18+
```hcl
2419
provider "rollbar" {
2520
api_key = "my-account-access-token" # optional for this resource
2621
project_api_key = "my-project-access-token"
2722
}
2823
29-
# Configure the Slack integration for the project
30-
#
31-
3224
resource "rollbar_integration" "slack_integration" {
3325
slack {
3426
enabled = false
@@ -38,29 +30,20 @@ resource "rollbar_integration" "slack_integration" {
3830
}
3931
}
4032
41-
# Configure the Webhook integration for the project
42-
#
43-
4433
resource "rollbar_integration" "webhook_integration" {
4534
webhook {
4635
enabled = true
4736
url = "https://www.example.com"
4837
}
4938
}
5039
51-
# Configure the Email integration for the project
52-
#
53-
5440
resource "rollbar_integration" "email_integration" {
5541
email {
5642
enabled = true
5743
scrub_params = true
5844
}
5945
}
6046
61-
# Configure the PagerDuty integration for the project
62-
#
63-
6447
resource "rollbar_integration" "pagerduty_integration" {
6548
pagerduty {
6649
enabled = false
@@ -69,11 +52,33 @@ resource "rollbar_integration" "pagerduty_integration" {
6952
}
7053
```
7154

55+
**Option 2: Using an account access token with `project_id`**
56+
57+
If you prefer not to configure a separate project access token, you can use the account access token and specify `project_id` on each resource:
58+
59+
```hcl
60+
provider "rollbar" {
61+
api_key = "my-account-access-token"
62+
}
63+
64+
resource "rollbar_integration" "slack_integration" {
65+
project_id = 123456
66+
slack {
67+
enabled = false
68+
channel = "#demo"
69+
service_account_id = "1234r45"
70+
show_message_buttons = true
71+
}
72+
}
73+
```
74+
7275
Argument Reference
7376
------------------
7477

7578
The following arguments are supported:
7679

80+
* `project_id` - (Optional) The Rollbar project ID. When set, the account access token (`api_key`) is used with this project ID instead of requiring a separate project access token (`project_api_key`).
81+
7782
Slack:
7883

7984
* `enabled` - (Required) Boolean that enables the Slack notifications globally

docs/resources/notification.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,14 @@ This resource can manage notification rules for different integration channels.
1414
Example Usage
1515
-------------
1616

17-
```hcl
18-
# Set the rollbar provider to manage a project
19-
#
20-
# NOTE: the account access token `api_key` is not required
21-
# for managing project however it should be set if you want
22-
# to use the provider for managing account-level resources
23-
# in addition to project-level resources
17+
**Option 1: Using a project access token**
2418

19+
```hcl
2520
provider "rollbar" {
2621
api_key = "my-account-access-token" # optional for this resource
2722
project_api_key = "my-project-access-token"
2823
}
2924
30-
# Create an email notification for the project
31-
#
3225
resource "rollbar_notification" "email" {
3326
channel = "email"
3427
rule {
@@ -41,7 +34,35 @@ resource "rollbar_notification" "email" {
4134
}
4235
}
4336
config {
44-
users = ["travis.mattera@rollbar.com"]
37+
users = ["user@rollbar.com"]
38+
teams = ["test-team-example"]
39+
}
40+
}
41+
```
42+
43+
**Option 2: Using an account access token with `project_id`**
44+
45+
If you prefer not to configure a separate project access token, you can use the account access token and specify `project_id` on each resource:
46+
47+
```hcl
48+
provider "rollbar" {
49+
api_key = "my-account-access-token"
50+
}
51+
52+
resource "rollbar_notification" "email" {
53+
project_id = 123456
54+
channel = "email"
55+
rule {
56+
enabled = true
57+
trigger = "occurrence_rate"
58+
filters {
59+
type = "rate"
60+
period = 300
61+
count = 10
62+
}
63+
}
64+
config {
65+
users = ["user@rollbar.com"]
4566
teams = ["test-team-example"]
4667
}
4768
}
@@ -52,6 +73,7 @@ Argument Reference
5273

5374
The following arguments are supported:
5475

76+
* `project_id` - (Optional) The Rollbar project ID. When set, the account access token (`api_key`) is used with this project ID instead of requiring a separate project access token (`project_api_key`).
5577
* `channel` - (Required) The notification channel (eg. `slack`, `pagerduty`, `email`, `webhook`) to configure a notification rule(s) for
5678
* `rule` - (Required) An array of expression configurations for notification rules. Structure is [documented below](#nested_rule)
5779
* `config` - (Required) An array of configurations for notification rules. Structure is [documented below](#nested_config)

docs/resources/service_links.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,42 @@ This resource can manage service links. See the following api documentation for
1010
Example Usage
1111
-------------
1212

13-
```hcl
14-
# Set the rollbar provider to manage a project
15-
#
16-
# NOTE: the account access token `api_key` is not required
17-
# for managing project however it should be set if you want
18-
# to use the provider for managing account-level resources
19-
# in addition to project-level resources
13+
**Option 1: Using a project access token**
2014

15+
```hcl
2116
provider "rollbar" {
2217
api_key = "my-account-access-token" # optional for this resource
2318
project_api_key = "my-project-access-token"
2419
}
2520
26-
# Create a service links for a project
27-
#
28-
2921
resource "rollbar_service_link" "service_link" {
3022
name = "service_link_name"
3123
template = "https://some-service.xyz/commit/{{code_version}}"
3224
}
3325
```
3426

27+
**Option 2: Using an account access token with `project_id`**
28+
29+
If you prefer not to configure a separate project access token, you can use the account access token and specify `project_id` on each resource:
30+
31+
```hcl
32+
provider "rollbar" {
33+
api_key = "my-account-access-token"
34+
}
35+
36+
resource "rollbar_service_link" "service_link" {
37+
project_id = 123456
38+
name = "service_link_name"
39+
template = "https://some-service.xyz/commit/{{code_version}}"
40+
}
41+
```
42+
3543
Argument Reference
3644
------------------
3745

3846
The following arguments are supported:
3947

48+
* `project_id` - (Optional) The Rollbar project ID. When set, the account access token (`api_key`) is used with this project ID instead of requiring a separate project access token (`project_api_key`).
4049
* `name` - (Required) The name of the service link
4150
* `template` - (Required) The url that contains templated variables referencing an occurrences data. [Examples](https://docs.rollbar.com/docs/service-links)
4251

0 commit comments

Comments
 (0)