Skip to content

Commit

Permalink
Update to terraform-plugin-framework.
Browse files Browse the repository at this point in the history
  • Loading branch information
asaba-hashi committed Jan 27, 2023
1 parent 36f82db commit 749bf5b
Show file tree
Hide file tree
Showing 21 changed files with 1,418 additions and 781 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version-file: "go.mod"
cache: true

- name: Import GPG key
id: import_gpg
Expand Down
47 changes: 42 additions & 5 deletions .github/workflows/terraform-provider-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,55 @@ name: Terraform Provider Checks
on: [pull_request]

jobs:

golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
cache: true

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3.0.2

- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ^1.16

- name: Check out code into the Go module directory
uses: actions/checkout@v3.0.2
go-version-file: "go.mod"
cache: true

- name: Setup dependency cache
uses: actions/cache@v3.0.1
Expand All @@ -34,5 +72,4 @@ jobs:

- name: Test
run: |
make lint
make test
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.5
1.18.10
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ issues:
linters:
disable-all: true
enable:
- deadcode
- errcheck
- gofmt
- gomnd
Expand All @@ -19,11 +18,9 @@ linters:
- nakedret
- nilerr
- staticcheck
- structcheck
- unconvert
- unused
- unparam
- varcheck
- vet

linters-settings:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Requirements

- [Terraform](https://www.terraform.io/downloads.html) 1.0.1
- [Go](https://golang.org/doc/install) 1.16 (to build the provider plugin)
- [Go](https://golang.org/doc/install) 1.18 (to build the provider plugin)

## Example Usage

Expand All @@ -22,7 +22,7 @@ Please see the Go documentation for the most up to date information about using

To add a new dependency `github.com/author/dependency` to your Terraform provider:

```
```shell
go get github.com/author/dependency
go mod tidy
```
Expand Down Expand Up @@ -66,7 +66,7 @@ to your `~/.terraformrc` file. This is valid for Terraform 0.14+. Please see
[Terraform's documentation](https://www.terraform.io/docs/cli/config/config-file.html#development-overrides-for-provider-developers)
for more details.

```
```hcl
provider_installation {
# Use /home/$USER/go/bin as an overridden package directory
Expand Down
5 changes: 1 addition & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ provider "jupiterone" {
<!-- schema generated by tfplugindocs -->
## Schema

### Required
### Optional

- `account_id` (String) JupiterOne account ID to create resources in
- `api_key` (String, Sensitive) API Key used to make requests to the JupiterOne APIs

### Optional

- `region` (String)
26 changes: 13 additions & 13 deletions docs/resources/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "jupiterone_question Resource - terraform-provider-jupiterone"
subcategory: ""
description: |-
A saved JupiterOne Question
---

# jupiterone_question (Resource)


A saved JupiterOne Question

## Example Usage

Expand All @@ -32,41 +32,41 @@ resource "jupiterone_question" "unencrypted_critical_data_stores" {
### Required

- `description` (String)
- `query` (Block List, Min: 1) (see [below for nested schema](#nestedblock--query))
- `title` (String) The title of the question

### Optional

- `compliance` (Block List) (see [below for nested schema](#nestedblock--compliance))
- `query` (Block List) (see [below for nested schema](#nestedblock--query))
- `tags` (List of String)

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--query"></a>
### Nested Schema for `query`
<a id="nestedblock--compliance"></a>
### Nested Schema for `compliance`

Required:

- `query` (String)
- `version` (String)
- `standard` (String)

Optional:

- `name` (String)
- `controls` (List of String)
- `requirements` (List of String)


<a id="nestedblock--compliance"></a>
### Nested Schema for `compliance`
<a id="nestedblock--query"></a>
### Nested Schema for `query`

Required:

- `standard` (String)
- `query` (String)
- `version` (String)

Optional:

- `controls` (List of String)
- `requirements` (List of String)
- `name` (String)


12 changes: 6 additions & 6 deletions docs/resources/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "jupiterone_rule Resource - terraform-provider-jupiterone"
subcategory: ""
description: |-
A saved JupiterOne question based alert
---

# jupiterone_rule (Resource)


A saved JupiterOne question based alert

## Example Usage

Expand Down Expand Up @@ -108,7 +108,7 @@ resource "jupiterone_rule" "users_without_mfa" {

- `outputs` (List of String) Names of properties that can be used throughout the rule evaluation process and will be included in each record of a rule evaluation. (e.g. queries.query0.total)
- `polling_interval` (String) Frequency of automated rule evaluation. Defaults to ONE_DAY.
- `question` (Block List, Max: 1) Contains properties related to queries used in the rule evaluation. (see [below for nested schema](#nestedblock--question))
- `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.
Expand All @@ -117,15 +117,15 @@ resource "jupiterone_rule" "users_without_mfa" {

### Read-Only

- `id` (String) The ID of this resource.
- `id` (String) Unique id that identifies the rule
- `version` (Number) Computed current version of the rule. Incremented each time the rule is updated.

<a id="nestedblock--question"></a>
### Nested Schema for `question`

Required:
Optional:

- `queries` (Block List, Min: 1) (see [below for nested schema](#nestedblock--question--queries))
- `queries` (Block List) Contains properties related to queries used in the rule evaluation. (see [below for nested schema](#nestedblock--question--queries))

<a id="nestedblock--question--queries"></a>
### Nested Schema for `question.queries`
Expand Down
Loading

0 comments on commit 749bf5b

Please sign in to comment.