File tree Expand file tree Collapse file tree 4 files changed +82
-0
lines changed
content/docs/getting-started Expand file tree Collapse file tree 4 files changed +82
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ Please read the [Doks theme](https://getdoks.org/docs/basics/authoring-content/)
61
61
To serve a local version of the docs site with your changes, run:
62
62
63
63
``` sh
64
+ npm install # Download dependencies
64
65
npm run dev
65
66
```
66
67
Original file line number Diff line number Diff line change @@ -43,6 +43,34 @@ nuosql "demo@${DB_URL}:8443" --user dba --password changeIt --connection-propert
43
43
44
44
[ NuoDB client] ( https://github.com/nuodb/nuodb-client/releases ) package v20230228 or later is required to connect to DBaaS database.
45
45
46
+ {{< /tab >}}
47
+
48
+ {{< tab "terraform" >}}
49
+
50
+ ``` terraform
51
+ output "dba_username" {
52
+ value = "dba"
53
+ }
54
+
55
+ output "dba_password" {
56
+ value = nuodbaas_database.db.dba_password
57
+ sensitive = true
58
+ # visible with terraform output dba_password
59
+ }
60
+
61
+ output "ca_cert" {
62
+ value = nuodbaas_database.db.status.ca_pem
63
+ }
64
+
65
+ output "db_url" {
66
+ value = "${nuodbaas_database.db.status.sql_endpoint}:443"
67
+ }
68
+
69
+ output "db_name" {
70
+ value = nuodbaas_database.db.name
71
+ }
72
+ ```
73
+
46
74
{{< /tab >}}
47
75
{{< /tabs >}}
48
76
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ This section describes how to connect to the NuoDB Control Plane REST service vi
20
20
21
21
- [ nuodb-cp] ( https://github.com/nuodb/nuodb-cp-releases/releases/latest/download/nuodb-cp ) or [ cURL] ( https://curl.se/download.html )
22
22
- [ jq] ( https://jqlang.github.io/jq/download/ )
23
+ - (Optional) [ terraform] ( https://developer.hashicorp.com/terraform/downloads )
23
24
24
25
## Access and Authentication
25
26
@@ -64,3 +65,26 @@ Configure `cURL` with DBaaS credentials.
64
65
``` sh
65
66
alias curl=" curl -s -k -u \" ${NUODB_CP_USER} :${NUODB_CP_PASSWORD} \" "
66
67
```
68
+
69
+ ### Setting up the Terraform Provider
70
+
71
+ To use terraform to manage your databases, you will want to use the [ ` nuodbaas ` provider] ( https://registry.terraform.io/providers/nuodb/nuodbaas ) .
72
+ The [ provider documentation] ( https://registry.terraform.io/providers/nuodb/nuodbaas/latest/docs#schema ) covers all of the available attributes.
73
+ All of them are optional.
74
+ For any that you do not specify, the provider will try to infer a value from the environment variables set above before exiting with an error.
75
+
76
+ ``` terraform
77
+ terraform {
78
+ required_providers {
79
+ nuodbaas = {
80
+ source = "registry.terraform.io/nuodb/nuodbaas"
81
+ version = "1.2.0"
82
+ }
83
+ }
84
+ }
85
+
86
+ provider "nuodbaas" {
87
+ # If your Control Plane certificate is not signed by a trusted CA, disable certificate validation .
88
+ skip_verify = true
89
+ }
90
+ ```
Original file line number Diff line number Diff line change @@ -42,6 +42,18 @@ curl -X PUT -H 'Content-Type: application/json' \
42
42
-d ' {"sla": "dev", "tier": "n0.small"}'
43
43
```
44
44
45
+ {{< /tab >}}
46
+ {{< tab "terraform" >}}
47
+
48
+ ``` terraform
49
+ resource "nuodbaas_project" "proj" {
50
+ organization = "acme"
51
+ name = "messaging"
52
+ sla = "dev"
53
+ tier = "n0.small"
54
+ }
55
+ ```
56
+
45
57
{{< /tab >}}
46
58
{{< /tabs >}}
47
59
@@ -71,6 +83,18 @@ curl -X PUT -H 'Content-Type: application/json' \
71
83
-d ' {"dbaPassword": "changeIt"}'
72
84
```
73
85
86
+ {{< /tab >}}
87
+ {{< tab "terraform" >}}
88
+
89
+ ``` terraform
90
+ resource "nuodbaas_database" "db" {
91
+ organization = nuodbaas_project.proj.organization
92
+ project = nuodbaas_project.proj.name
93
+ name = "demo"
94
+ dba_password = "changeIt"
95
+ }
96
+ ```
97
+
74
98
{{< /tab >}}
75
99
{{< /tabs >}}
76
100
98
122
echo " Database is available"
99
123
```
100
124
125
+ {{< /tab >}}
126
+ {{< tab "terraform" >}}
127
+
128
+ Terraform waits until all resources are available before reporting a success.
129
+
101
130
{{< /tab >}}
102
131
{{< /tabs >}}
You can’t perform that action at this time.
0 commit comments