Skip to content

Commit

Permalink
[APP-16093] add smart classes to tf provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-willis committed Jan 15, 2025
1 parent ed8148a commit 2bdc42b
Show file tree
Hide file tree
Showing 15 changed files with 1,800 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ website/node_modules
.terraform/
*.log
*.bak
.env
*~
.*.swp
.idea
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ If you create a new one, be sure to add the file to the [genqlient.yaml](jupiter
You should always generate the gql client from the production api so that you do not include any in-progress work from dev. Set these environment variables before running the next commands.

```shell
export JUPITERONE_ACCOUNT=:your_account_id
export JUPITERONE_ACCOUNT_ID=:your_account_id
export JUPITERONE_API_KEY=:your_api_key
export JUPITERONE_REGION=us
```
Expand Down
31 changes: 31 additions & 0 deletions examples/resources/jupiterone_smart_class/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
resource "jupiterone_smart_class" "example" {
tag_name = "example"
description = "Example smart class"
}

resource "jupiterone_smart_class_query" "query1" {
smart_class_id = jupiterone_smart_class.example.id
query = "Find User"
description = "Example query"
}

resource "jupiterone_smart_class_query" "query2" {
smart_class_id = jupiterone_smart_class.example.id
query = "Find Person"
description = "Example query"
}

resource "jupiterone_smart_class_tag" "tag1" {
smart_class_id = jupiterone_smart_class.example.id
name = "person"
type = "boolean"
value = "true"
}

resource "jupiterone_smart_class_tag" "tag2" {
smart_class_id = jupiterone_smart_class.example.id
name = "user"
type = "boolean"
value = "true"
}

3 changes: 3 additions & 0 deletions jupiterone/cassettes/TestSmartClass_Basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
version: 2
interactions: []
81 changes: 81 additions & 0 deletions jupiterone/cassettes/TestSmartClass_BasicImport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
version: 2
interactions:
- id: 0
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 303
transfer_encoding: []
trailer: {}
host: graphql.dev.jupiterone.io
remote_addr: ""
request_uri: ""
body: '{"query":"\nmutation CreateSmartClass ($input: CreateSmartClassInput!) {\n\tcreateSmartClass(input: $input) {\n\t\tid\n\t\ttagName\n\t\tdescription\n\t}\n}\n","variables":{"input":{"tagName":"TfProviderTestImport","description":"description of TfProviderTestImport"}},"operationName":"CreateSmartClass"}'
form: {}
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json
url: https://graphql.dev.jupiterone.io/
method: POST
response:
proto: HTTP/2.0
proto_major: 2
proto_minor: 0
transfer_encoding: []
trailer: {}
content_length: 161
uncompressed: false
body: |
{"data":{"createSmartClass":{"id":"3f40b190-bbfc-477a-bf41-a9e8900437b2","tagName":"TfProviderTestImport","description":"description of TfProviderTestImport"}}}
headers:
Access-Control-Allow-Credentials:
- "true"
Content-Length:
- "161"
Content-Security-Policy:
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;form-action ''self'';frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
Content-Type:
- application/json
Cross-Origin-Embedder-Policy:
- require-corp
Cross-Origin-Opener-Policy:
- same-origin
Cross-Origin-Resource-Policy:
- same-origin
Expect-Ct:
- max-age=0
Origin-Agent-Cluster:
- ?1
Ratelimit-Limit:
- "1000"
Ratelimit-Remaining:
- "999"
Ratelimit-Requested:
- "1"
Ratelimit-Reset:
- "1"
Referrer-Policy:
- no-referrer
Strict-Transport-Security:
- max-age=15552000; includeSubDomains
Vary:
- Origin
X-Content-Type-Options:
- nosniff
X-Dns-Prefetch-Control:
- "off"
X-Download-Options:
- noopen
X-Frame-Options:
- SAMEORIGIN
X-Permitted-Cross-Domain-Policies:
- none
X-Xss-Protection:
- "0"
status: 200 OK
code: 200
duration: 1.049610292s
Loading

0 comments on commit 2bdc42b

Please sign in to comment.