Skip to content

Commit

Permalink
Merge pull request #186 from JupiterOne/update-docs
Browse files Browse the repository at this point in the history
Update docs and explain what region is for
  • Loading branch information
i5o authored Aug 9, 2023
2 parents 62a27f7 + b6cdba8 commit 7417f29
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ $EDITOR jupiterone/internal/client/<query source file>.graphql
# save the updated schema the first time
export JUPITERONE_ACCOUNT=:your_account_id
export JUPITERONE_API_KEY=:your_api_key
export JUPITERONE_REGION=us
yarn add graphql

make generate-client
Expand All @@ -66,7 +67,7 @@ make generate-client

In order to test the provider, you can simply run `make testacc`. Pre-recorded
API responses (cassettes) are read in from
[jupiterone/cassettes/*.yaml](jupiterone/cassettes) files and returned. When
[jupiterone/cassettes/\*.yaml](jupiterone/cassettes) files and returned. When
tests are modified, the cassettes need to be re-recorded.

_Note:_ Recording cassettes creates/updates/destroys real resources. Never run this on
Expand All @@ -80,6 +81,7 @@ To re-record _all_ cassettes:
```sh
export JUPITERONE_ACCOUNT_ID=your-account-id
export JUPITERONE_API_KEY=xxxxxx
export JUPITERONE_REGION=us
make cassettes
```

Expand All @@ -91,6 +93,7 @@ functionality.
```sh
export JUPITERONE_ACCOUNT_ID=your-account-id
export JUPITERONE_API_KEY=xxxxxx
export JUPITERONE_REGION=us
rm jupiterone/cassettes/:some-test.yaml
make testacc
```
Expand Down
7 changes: 4 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ The JupiterOne provider provides resources to interact with a JupiterOne API.

```terraform
provider "jupiterone" {
api_key = "${var.jupiterone_api_key}"
account_id = "${var.jupiterone_account}"
api_key = var.jupiterone_api_key
account_id = var.jupiterone_account
region = var.jupiterone_region
}
```

Expand All @@ -25,4 +26,4 @@ provider "jupiterone" {

- `account_id` (String) JupiterOne account ID to create resources in
- `api_key` (String, Sensitive) API Key used to make requests to the JupiterOne APIs
- `region` (String)
- `region` (String) region used for generating the GraphQL endpoint url. If not provided defaults to 'us'
2 changes: 1 addition & 1 deletion docs/resources/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resource "jupiterone_question" "unencrypted_critical_data_stores" {
- `compliance` (Block List) (see [below for nested schema](#nestedblock--compliance))
- `polling_interval` (String) Frequency of automated question evaluation. Defaults to ONE_DAY.
- `query` (Block List) (see [below for nested schema](#nestedblock--query))
- `show_trend` (Boolean) Whether to enable trend data collection. Defaults to false.
- `show_trend` (Boolean) Whether to enable daily trend data collection. Defaults to false.
- `tags` (List of String)

### Read-Only
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ resource "jupiterone_rule" "users_without_mfa" {
- `polling_interval` (String) Frequency of automated rule evaluation. Defaults to ONE_DAY.
- `question` (Block List) Contains properties related to queries used in the rule evaluation. (see [below for nested schema](#nestedblock--question))
- `question_id` (String) Specifies the ID of a question to be used in rule evaluation.
- `question_name` (String, Deprecated) Specifies the name of a question to be used in rule evaluation.
- `spec_version` (Number) Rule evaluation specification version in the case of breaking changes.
- `tags` (List of String) Comma separated list of tags to apply to the rule.
- `templates` (Map of String) Optional key/value pairs of template name to template
- `trigger_on_new_only` (Boolean)

### Read-Only

Expand Down
7 changes: 4 additions & 3 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
provider "jupiterone" {
api_key = "${var.jupiterone_api_key}"
account_id = "${var.jupiterone_account}"
}
api_key = var.jupiterone_api_key
account_id = var.jupiterone_account
region = var.jupiterone_region
}
3 changes: 2 additions & 1 deletion jupiterone/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ func (*JupiterOneProvider) Schema(ctx context.Context, req provider.SchemaReques
Description: "JupiterOne account ID to create resources in",
},
"region": schema.StringAttribute{
Optional: true,
Optional: true,
Description: "region used for generating the GraphQL endpoint url. If not provided defaults to 'us'",
},
},
}
Expand Down

0 comments on commit 7417f29

Please sign in to comment.