Skip to content

Commit cd37395

Browse files
authored
Merge pull request #76 from arangodb-managed/OAS-5751
Oas 5751 | Add support for [jupyter] notebooks
2 parents 68303a9 + 167c9e0 commit cd37395

File tree

14 files changed

+1227
-17
lines changed

14 files changed

+1227
-17
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "oasis_notebook_model Data Source - terraform-provider-oasis"
4+
subcategory: ""
5+
description: |-
6+
Oasis Notebook Model Data Source
7+
---
8+
9+
# oasis_notebook_model (Data Source)
10+
11+
Oasis Notebook Model Data Source
12+
13+
## Example Usage
14+
15+
```terraform
16+
terraform {
17+
required_version = ">= 0.13.0"
18+
required_providers {
19+
oasis = {
20+
source = "arangodb-managed/oasis"
21+
version = ">=2.1.7"
22+
}
23+
}
24+
}
25+
26+
provider "oasis" {
27+
api_key_id = "" // API Key ID generated in Oasis platform
28+
api_key_secret = "" // API Key Secret generated in Oasis platform
29+
}
30+
31+
// Load in all the available datasets
32+
data "oasis_notebook_model" "models" {
33+
deployment_id = "" // deployment id (required)
34+
}
35+
36+
// Output the data after it has been synced.
37+
output "datasets" {
38+
value = data.oasis_notebook_model.models
39+
}
40+
```
41+
42+
<!-- schema generated by tfplugindocs -->
43+
## Schema
44+
45+
### Optional
46+
47+
- `deployment_id` (String) Notebook Model Data Source Notebook Model Deployment ID field
48+
49+
### Read-Only
50+
51+
- `id` (String) The ID of this resource.
52+
- `items` (List of Object) (see [below for nested schema](#nestedatt--items))
53+
54+
<a id="nestedatt--items"></a>
55+
### Nested Schema for `items`
56+
57+
Read-Only:
58+
59+
- `cpu` (Number)
60+
- `id` (String)
61+
- `max_disk_size` (Number)
62+
- `memory` (Number)
63+
- `min_disk_size` (Number)
64+
- `name` (String)
65+
66+

docs/resources/multi_region_backup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ terraform {
1818
required_providers {
1919
oasis = {
2020
source = "arangodb-managed/oasis"
21-
version = ">=2.1.5"
21+
version = ">=2.1.6"
2222
}
2323
}
2424
}

docs/resources/notebook.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "oasis_notebook Resource - terraform-provider-oasis"
4+
subcategory: ""
5+
description: |-
6+
Oasis Notebook Resource
7+
---
8+
9+
# oasis_notebook (Resource)
10+
11+
Oasis Notebook Resource
12+
13+
## Example Usage
14+
15+
```terraform
16+
terraform {
17+
required_version = ">= 0.13.0"
18+
required_providers {
19+
oasis = {
20+
source = "arangodb-managed/oasis"
21+
version = ">=2.1.7"
22+
}
23+
}
24+
}
25+
26+
provider "oasis" {
27+
api_key_id = "" // API Key ID generated in Oasis platform
28+
api_key_secret = "" // API Key Secret generated in Oasis platform
29+
}
30+
31+
// Create Project
32+
resource "oasis_project" "oasis_test_project" {
33+
name = "Terraform Oasis Project"
34+
description = "A test Oasis project within an organization from the Terraform Provider"
35+
}
36+
37+
// Create Deployment
38+
resource "oasis_deployment" "my_oneshard_deployment" {
39+
terms_and_conditions_accepted = "true"
40+
project = oasis_project.oasis_test_project.id // Project id where deployment will be created
41+
name = "oasis_jupyter_notebook_deployment"
42+
location {
43+
region = "gcp-europe-west4"
44+
}
45+
security {
46+
disable_foxx_authentication = false
47+
}
48+
disk_performance = "dp30"
49+
configuration {
50+
model = "oneshard"
51+
node_size_id = "c4-a8"
52+
node_disk_size = 20
53+
maximum_node_disk_size = 40
54+
}
55+
notification_settings {
56+
email_addresses = [
57+
58+
]
59+
}
60+
}
61+
62+
// Create Notebook
63+
resource "oasis_notebook" "oasis_test_notebook" {
64+
deployment_id = oasis_deployment.my_oneshard_deployment.id
65+
name = "Test Oasis Jupyter Notebook"
66+
description = "Test Description"
67+
model {
68+
notebook_model_id = "basic"
69+
disk_size = "10"
70+
}
71+
}
72+
```
73+
74+
<!-- schema generated by tfplugindocs -->
75+
## Schema
76+
77+
### Required
78+
79+
- `deployment_id` (String) Notebook Resource Notebook Deployment ID field
80+
- `model` (Block List, Min: 1, Max: 1) Notebook Resource Notebook Model field (see [below for nested schema](#nestedblock--model))
81+
- `name` (String) Notebook Resource Notebook Name field
82+
83+
### Optional
84+
85+
- `description` (String) Notebook Resource Notebook Description field
86+
- `url` (String) Notebook Resource Notebook URL field
87+
88+
### Read-Only
89+
90+
- `created_at` (String) Notebook Resource Notebook Created At field
91+
- `created_by_id` (String) Notebook Resource Notebook Created By Id field
92+
- `deleted_at` (String) Notebook Resource Notebook Deleted At field
93+
- `id` (String) The ID of this resource.
94+
- `is_deleted` (Boolean) Notebook Resource Notebook Is Deleted field
95+
- `is_paused` (Boolean) Notebook Resource Notebook Is Paused field
96+
- `last_paused_at` (String) Notebook Resource Notebook Last Paused field
97+
- `last_resumed_at` (String) Notebook Resource Notebook Last Resumed field
98+
- `status` (List of Object) Notebook Resource Notebook Status field (see [below for nested schema](#nestedatt--status))
99+
100+
<a id="nestedblock--model"></a>
101+
### Nested Schema for `model`
102+
103+
Required:
104+
105+
- `disk_size` (Number) Notebook Resource Notebook Model Disk Size field
106+
- `notebook_model_id` (String) Notebook Resource Notebook Model ID field
107+
108+
109+
<a id="nestedatt--status"></a>
110+
### Nested Schema for `status`
111+
112+
Read-Only:
113+
114+
- `endpoint` (String)
115+
- `last_updated_at` (String)
116+
- `message` (String)
117+
- `phase` (String)
118+
- `usage` (List of Object) (see [below for nested schema](#nestedobjatt--status--usage))
119+
120+
<a id="nestedobjatt--status--usage"></a>
121+
### Nested Schema for `status.usage`
122+
123+
Read-Only:
124+
125+
- `last_cpu_limit` (Number)
126+
- `last_cpu_usage` (Number)
127+
- `last_memory_limit` (Number)
128+
- `last_memory_usage` (Number)
129+
130+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Example: Notebook Model Data Source
2+
3+
This example shows how to use the Terraform Oasis provider to manage Notebook Model Data Source in Oasis.
4+
5+
## Prerequisites
6+
7+
*This example uses syntax elements specific to Terraform version 0.13+ (tested on Terraform version 1.1.4).
8+
It will not work out-of-the-box with Terraform 0.12.x and lower (deprecated by Terraform).*
9+
10+
## Environment variables
11+
Please refer to [Main README](../../README.md) file for all the environment variables you might need.
12+
13+
14+
## Instructions on how to run:
15+
```
16+
terraform init
17+
terraform plan
18+
terraform apply
19+
```
20+
21+
To remove the resources created run:
22+
```
23+
terraform destroy
24+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
terraform {
2+
required_version = ">= 0.13.0"
3+
required_providers {
4+
oasis = {
5+
source = "arangodb-managed/oasis"
6+
version = ">=2.1.7"
7+
}
8+
}
9+
}
10+
11+
provider "oasis" {
12+
api_key_id = "" // API Key ID generated in Oasis platform
13+
api_key_secret = "" // API Key Secret generated in Oasis platform
14+
}
15+
16+
// Load in all the available datasets
17+
data "oasis_notebook_model" "models" {
18+
deployment_id = "" // deployment id (required)
19+
}
20+
21+
// Output the data after it has been synced.
22+
output "datasets" {
23+
value = data.oasis_notebook_model.models
24+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Example: Oasis Notebook
2+
3+
This example shows how to use the Terraform Oasis provider to create an Oasis Jupyter Notebook inside a Deployment.
4+
5+
## Prerequisites
6+
7+
_This example uses syntax elements specific to Terraform version 0.13+ (tested on Terraform version 1.1.4).
8+
It will not work out-of-the-box with Terraform 0.12.x and lower._
9+
10+
## Environment variables
11+
12+
Please refer to [Main README](../../README.md) file for all the environment variables you might need.
13+
14+
## Instructions on how to run:
15+
16+
```
17+
terraform init
18+
terraform plan
19+
terraform apply
20+
```
21+
22+
To remove the resources created run:
23+
24+
```
25+
terraform destroy
26+
```
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
terraform {
2+
required_version = ">= 0.13.0"
3+
required_providers {
4+
oasis = {
5+
source = "arangodb-managed/oasis"
6+
version = ">=2.1.7"
7+
}
8+
}
9+
}
10+
11+
provider "oasis" {
12+
api_key_id = "" // API Key ID generated in Oasis platform
13+
api_key_secret = "" // API Key Secret generated in Oasis platform
14+
}
15+
16+
// Create Project
17+
resource "oasis_project" "oasis_test_project" {
18+
name = "Terraform Oasis Project"
19+
description = "A test Oasis project within an organization from the Terraform Provider"
20+
}
21+
22+
// Create Deployment
23+
resource "oasis_deployment" "my_oneshard_deployment" {
24+
terms_and_conditions_accepted = "true"
25+
project = oasis_project.oasis_test_project.id // Project id where deployment will be created
26+
name = "oasis_jupyter_notebook_deployment"
27+
location {
28+
region = "gcp-europe-west4"
29+
}
30+
security {
31+
disable_foxx_authentication = false
32+
}
33+
disk_performance = "dp30"
34+
configuration {
35+
model = "oneshard"
36+
node_size_id = "c4-a8"
37+
node_disk_size = 20
38+
maximum_node_disk_size = 40
39+
}
40+
notification_settings {
41+
email_addresses = [
42+
43+
]
44+
}
45+
}
46+
47+
// Create Notebook
48+
resource "oasis_notebook" "oasis_test_notebook" {
49+
deployment_id = oasis_deployment.my_oneshard_deployment.id
50+
name = "Test Oasis Jupyter Notebook"
51+
description = "Test Description"
52+
model {
53+
notebook_model_id = "basic"
54+
disk_size = "10"
55+
}
56+
}

go.mod

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
module github.com/arangodb-managed/terraform-provider-oasis
22

33
require (
4-
github.com/arangodb-managed/apis v0.74.14
4+
github.com/arangodb-managed/apis v0.76.0
55
github.com/arangodb-managed/log-helper v0.2.5
66
github.com/gogo/protobuf v1.3.2
77
github.com/hashicorp/terraform-plugin-docs v0.8.1
88
github.com/hashicorp/terraform-plugin-sdk/v2 v2.13.0
99
github.com/rs/zerolog v1.26.1
1010
github.com/stretchr/testify v1.7.0
11-
google.golang.org/grpc v1.45.0
11+
google.golang.org/grpc v1.47.0
1212
)
1313

1414
require (
1515
github.com/Masterminds/goutils v1.1.1 // indirect
1616
github.com/Masterminds/semver/v3 v3.1.1 // indirect
17-
github.com/Masterminds/sprig/v3 v3.2.0 // indirect
17+
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
18+
github.com/Microsoft/go-winio v0.5.0 // indirect
1819
github.com/agext/levenshtein v1.2.2 // indirect
1920
github.com/apparentlymart/go-cidr v1.1.0 // indirect
2021
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
21-
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 // indirect
22+
github.com/armon/go-radix v1.0.0 // indirect
2223
github.com/bgentry/speakeasy v0.1.0 // indirect
2324
github.com/davecgh/go-spew v1.1.1 // indirect
24-
github.com/fatih/color v1.7.0 // indirect
25+
github.com/fatih/color v1.12.0 // indirect
2526
github.com/golang/protobuf v1.5.2 // indirect
2627
github.com/google/go-cmp v0.5.8 // indirect
27-
github.com/google/uuid v1.1.2 // indirect
28+
github.com/google/uuid v1.3.0 // indirect
2829
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
2930
github.com/hashicorp/errwrap v1.0.0 // indirect
3031
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
@@ -72,8 +73,9 @@ require (
7273
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
7374
golang.org/x/text v0.3.7 // indirect
7475
google.golang.org/appengine v1.6.7 // indirect
75-
google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 // indirect
76+
google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 // indirect
7677
google.golang.org/protobuf v1.27.1 // indirect
78+
gopkg.in/yaml.v2 v2.4.0 // indirect
7779
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
7880
)
7981

0 commit comments

Comments
 (0)