Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Please read the [Doks theme](https://getdoks.org/docs/basics/authoring-content/)
To serve a local version of the docs site with your changes, run:

```sh
npm install # Download dependencies
npm run dev
```

Expand Down
28 changes: 28 additions & 0 deletions content/docs/getting-started/connect-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,34 @@ nuosql "demo@${DB_URL}:8443" --user dba --password changeIt --connection-propert

[NuoDB client](https://github.com/nuodb/nuodb-client/releases) package v20230228 or later is required to connect to DBaaS database.

{{< /tab >}}

{{< tab "terraform" >}}

```terraform
output "dba_username" {
value = "dba"
}

output "dba_password" {
value = nuodbaas_database.db.dba_password
sensitive = true
# visible with terraform output dba_password
}

output "ca_cert" {
value = nuodbaas_database.db.status.ca_pem
}

output "db_url" {
value = "${nuodbaas_database.db.status.sql_endpoint}:443"
}

output "db_name" {
value = nuodbaas_database.db.name
}
```

{{< /tab >}}
{{< /tabs >}}

Expand Down
24 changes: 24 additions & 0 deletions content/docs/getting-started/connect-dbaas.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This section describes how to connect to the NuoDB Control Plane REST service vi

- [nuodb-cp](https://github.com/nuodb/nuodb-cp-releases/releases/latest/download/nuodb-cp) or [cURL](https://curl.se/download.html)
- [jq](https://jqlang.github.io/jq/download/)
- (Optional) [terraform](https://developer.hashicorp.com/terraform/downloads)

## Access and Authentication

Expand Down Expand Up @@ -64,3 +65,26 @@ Configure `cURL` with DBaaS credentials.
```sh
alias curl="curl -s -k -u \"${NUODB_CP_USER}:${NUODB_CP_PASSWORD}\""
```

### Setting up the Terraform Provider
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this subsection providing context for the terraform examples that show below? Is there anything we want to say here about where the configuration snippets should be inserted, e.g. into the same configuration that has the provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters where in their terraform configuration the customer puts any given snippet. Terraform evaluates files in indeterminate order.


To use terraform to manage your databases, you will want to use the [`nuodbaas` provider](https://registry.terraform.io/providers/nuodb/nuodbaas).
The [provider documentation](https://registry.terraform.io/providers/nuodb/nuodbaas/latest/docs#schema) covers all of the available attributes.
All of them are optional.
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.

```terraform
terraform {
required_providers {
nuodbaas = {
source = "registry.terraform.io/nuodb/nuodbaas"
version = "1.2.0"
}
}
}

provider "nuodbaas" {
# If your Control Plane certificate is not signed by a trusted CA, disable certificate validation .
skip_verify = true
}
```
29 changes: 29 additions & 0 deletions content/docs/getting-started/create-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ curl -X PUT -H 'Content-Type: application/json' \
-d '{"sla": "dev", "tier": "n0.small"}'
```

{{< /tab >}}
{{< tab "terraform" >}}

```terraform
resource "nuodbaas_project" "proj" {
organization = "acme"
name = "messaging"
sla = "dev"
tier = "n0.small"
}
```

{{< /tab >}}
{{< /tabs >}}

Expand Down Expand Up @@ -71,6 +83,18 @@ curl -X PUT -H 'Content-Type: application/json' \
-d '{"dbaPassword": "changeIt"}'
```

{{< /tab >}}
{{< tab "terraform" >}}

```terraform
resource "nuodbaas_database" "db" {
organization = nuodbaas_project.proj.organization
project = nuodbaas_project.proj.name
name = "demo"
dba_password = "changeIt"
}
```

{{< /tab >}}
{{< /tabs >}}

Expand Down Expand Up @@ -98,5 +122,10 @@ done
echo "Database is available"
```

{{< /tab >}}
{{< tab "terraform" >}}

Terraform waits until all resources are available before reporting a success.

{{< /tab >}}
{{< /tabs >}}