Skip to content

Commit

Permalink
0.1.0 release (#9)
Browse files Browse the repository at this point in the history
Prepare the project for our first (D2D) release.
- Added a CHANGELOG with a quick summary of the state.
- Added documentation strings to all schema.
- Added usage examples.
  • Loading branch information
kontaras authored Feb 2, 2024
1 parent d213fd8 commit 9296514
Show file tree
Hide file tree
Showing 24 changed files with 492 additions and 357 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Changelog

## 0.1.0 (Unreleased)
Initial version of the NuoDB DBaaS provider.

**This is a pre-release version.
Future versions may not be backwards compatible with this release.**

FEATURES:
### Added
- Provider that can connect to NuoDB Control Plane via its REST API
- Resource to manage projects
- Resource to manage databases
- Data source to list projects
- Data source to get details about a project
- Data source to list databases
- Data source to get details about a database
37 changes: 23 additions & 14 deletions docs/data-sources/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,48 @@
page_title: "nuodbaas_database Data Source - nuodbaas"
subcategory: ""
description: |-
The state of a given database.
---

# nuodbaas_database (Data Source)

The state of a given database.

## Example Usage


```terraform
# Get details about a single database
data "nuodbaas_database" "databaseDetails" {
name = "dbaas"
organization = "system"
project = "nuodb"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Name of the database
- `organization` (String) The organization that the database belongs to
- `project` (String) The name of the project for which database is created
- `name` (String) Name of the database.
- `organization` (String) The organization that the database belongs to.
- `project` (String) The name of the project to which the database belongs.

### Read-Only

- `maintenance` (Attributes) (see [below for nested schema](#nestedatt--maintenance))
- `properties` (Attributes) (see [below for nested schema](#nestedatt--properties))
- `resource_version` (String) The version of the resource. When specified in a PUT request payload, indicates that the resoure should be updated, and is used by the system to guard against concurrent updates.
- `status` (Attributes) (see [below for nested schema](#nestedatt--status))
- `tier` (String) The Tier for the database. Cannot be updated once the database is created.
- `maintenance` (Attributes) Information about when the database is scheduled to be automatically shut down. (see [below for nested schema](#nestedatt--maintenance))
- `properties` (Attributes) Database configuration properties. (see [below for nested schema](#nestedatt--properties))
- `resource_version` (String) The version of the resource. When specified in a `PUT` request payload, indicates that the resoure should be updated, and is used by the system to guard against concurrent updates.
- `status` (Attributes) The current status of the database. (see [below for nested schema](#nestedatt--status))
- `tier` (String) The service tier for the database. If omitted, the project service tier is inherited.

<a id="nestedatt--maintenance"></a>
### Nested Schema for `maintenance`

Read-Only:

- `expires_at` (String) The time at which the project or database will be disabled
- `expires_in` (String) The time until the project or database is disabled, e.g. 1d
- `expires_in` (String) The time until the project or database is disabled, e.g. `1d`
- `is_disabled` (Boolean) Whether the project or database should be shutdown


Expand All @@ -44,9 +53,9 @@ Read-Only:

Read-Only:

- `archive_disk_size` (String) The size of the archive volumes for the database. Can be only updated to increase the volume size
- `archive_disk_size` (String) The size of the archive volumes for the database. Can be only updated to increase the volume size.
- `journal_disk_size` (String) The size of the journal volumes for the database. Can be only updated to increase the volume size.
- `tier_parameters` (Map of String)
- `tier_parameters` (Map of String) Opaque parameters supplied to database service tier.


<a id="nestedatt--status"></a>
Expand All @@ -55,4 +64,4 @@ Read-Only:
Read-Only:

- `ca_pem` (String) The PEM-encoded certificate for SQL clients to verify database servers
- `sql_end_point` (String) The endpoint for SQL clients to connect to
- `sql_end_point` (String) The endpoint for SQL clients to connect to.
37 changes: 29 additions & 8 deletions docs/data-sources/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,61 @@
page_title: "nuodbaas_databases Data Source - nuodbaas"
subcategory: ""
description: |-
A listing of databases deployed in NuoDB DBaaS.
---

# nuodbaas_databases (Data Source)

A listing of databases deployed in NuoDB DBaaS.

## Example Usage

```terraform
# Get all databases
data "nuodbaas_databases" "databaseList" {}
# Get all databases in a given organization
data "nuodbaas_databases" "databaseList" {
filter {
organization = "system"
}
}
# Get all databases in a given project
data "nuodbaas_databases" "databaseList" {
filter {
organization = "system"
project = "nuodb"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `filter` (Block, Optional) (see [below for nested schema](#nestedblock--filter))
- `filter` (Block, Optional) Filters to narrow the list of fetched databases. (see [below for nested schema](#nestedblock--filter))

### Read-Only

- `databases` (Attributes List) (see [below for nested schema](#nestedatt--databases))
- `databases` (Attributes List) The databases that exist. (see [below for nested schema](#nestedatt--databases))

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

Optional:

- `organization` (String)
- `project` (String)
- `organization` (String) Only return databases in a given organization.
- `project` (String) Only return databases in a given project. If supplied, the `organization` must also be provided.


<a id="nestedatt--databases"></a>
### Nested Schema for `databases`

Read-Only:

- `name` (String)
- `organization` (String)
- `project` (String)
- `name` (String) Name of the database.
- `organization` (String) The organization that the database belongs to.
- `project` (String) The name of the project to which the database belongs.
24 changes: 16 additions & 8 deletions docs/data-sources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
page_title: "nuodbaas_project Data Source - nuodbaas"
subcategory: ""
description: |-
The state of a given project.
---

# nuodbaas_project (Data Source)

The state of a given project.

## Example Usage


```terraform
# Get details about a single project
data "nuodbaas_project" "projectDetails" {
name = "nuodb"
organization = "system"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -22,23 +30,23 @@ description: |-

### Read-Only

- `maintenance` (Attributes) (see [below for nested schema](#nestedatt--maintenance))
- `properties` (Attributes) (see [below for nested schema](#nestedatt--properties))
- `resource_version` (String)
- `maintenance` (Attributes) Maintenance shutdown status of the project. Shutting down a project also shuts down all databases belonging to it. (see [below for nested schema](#nestedatt--maintenance))
- `properties` (Attributes) Project configuration properties. (see [below for nested schema](#nestedatt--properties))
- `resource_version` (String) The version of the resource. When specified in a `PUT` request payload, indicates that the resoure should be updated, and is used by the system to guard against concurrent updates.
- `sla` (String) The SLA for the project. Cannot be updated once the project is created.
- `tier` (String) The Tier for the project. Cannot be updated once the project is created.
- `tier` (String) The service tier for the project

<a id="nestedatt--maintenance"></a>
### Nested Schema for `maintenance`

Read-Only:

- `is_disabled` (Boolean)
- `is_disabled` (Boolean) Whether the project or database should be shutdown


<a id="nestedatt--properties"></a>
### Nested Schema for `properties`

Optional:

- `tier_parameters` (Map of String)
- `tier_parameters` (Map of String) Opaque parameters supplied to project service tier.
24 changes: 18 additions & 6 deletions docs/data-sources/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,50 @@
page_title: "nuodbaas_projects Data Source - nuodbaas"
subcategory: ""
description: |-
A listing of projects that exist in NuoDB DBaaS.
---

# nuodbaas_projects (Data Source)

A listing of projects that exist in NuoDB DBaaS.

## Example Usage

```terraform
# Get all projects
data "nuodbaas_projects" "projectsList" {}
# Get all projects in a given organization
data "nuodbaas_projects" "projectsList" {
filter {
organization = "system"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `filter` (Block, Optional) (see [below for nested schema](#nestedblock--filter))
- `filter` (Block, Optional) Filters to narrow the list of fetched projects. (see [below for nested schema](#nestedblock--filter))

### Read-Only

- `projects` (Attributes List) (see [below for nested schema](#nestedatt--projects))
- `projects` (Attributes List) The databases that exist. (see [below for nested schema](#nestedatt--projects))

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

Optional:

- `organization` (String)
- `organization` (String) Only return databases in a given organization.


<a id="nestedatt--projects"></a>
### Nested Schema for `projects`

Read-Only:

- `name` (String)
- `organization` (String)
- `name` (String) Name of the project
- `organization` (String) Name of the organization for which project is created
79 changes: 11 additions & 68 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "nuodbaas Provider"
subcategory: ""
description: |-
The NuoDB DBaaS provider provides the ability to manage the projects and databases running under the NuoDB Control Plane.
---

# nuodbaas Provider


The NuoDB DBaaS provider provides the ability to manage the projects and databases running under the NuoDB Control Plane.

## Example Usage

Expand All @@ -28,87 +28,30 @@ provider "nuodbaas" {
url_base = "http://localhost/nuodb-cp"
}
resource "nuodbaas_project" "dev" {
organization = var.dbaas_credentials.organization
name = "dev"
sla = "dev"
tier = "n1.small"
maintenance = {
is_disabled = false
}
properties = {}
}
# Create a basic project
resource "nuodbaas_project" "nuodb" {
organization = var.dbaas_credentials.organization
name = "nuodb"
sla = "dev"
tier = "n1.small"
sla = "prod"
tier = "n0.nano"
}
# Add a database into the project
resource "nuodbaas_database" "nuodb" {
organization = var.dbaas_credentials.organization
organization = nuodbaas_project.nuodb.organization
project = nuodbaas_project.nuodb.name
name = "nuodb"
tier = "n0.nano"
dba_password = "helloworld"
properties = {
archive_disk_size = "7Gi"
}
}
resource "nuodbaas_database" "dbaas" {
organization = var.dbaas_credentials.organization
project = nuodbaas_project.nuodb.name
name = "dbaas"
# tier = "n1.small"
dba_password = "helloworld"
maintenance = {
expires_in = "2d"
}
# properties = {
# archive_disk_size = "1Gi"
# }
}
# data "nuodbaas_projects" "projectsList" {
# filter {
# }
# }
# output "projectsList" {
# value = data.nuodbaas_projects.projectsList
# }
# locals {
# project_names = {
# for project in data.nuodbaas_projects.projectsList.projects :
# project.name => project
# }
# }
# data "nuodbaas_project" "projectDetail" {
# for_each = local.project_names
# organization = var.dbaas_credentials.organization
# name = "${each.key}"
# }
# output "projectDetail" {
# value = data.nuodbaas_project.projectDetail
# }
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `organization` (String) The name of the organization for the user
- `password` (String, Sensitive) The password for the user
- `organization` (String) The Control Plane organization that the user belongs to. If not specified, defaults to the NUODB_CP_ORGANIZATION environment variable.
- `password` (String, Sensitive) The password for the user. If not specified, defaults to the NUODB_CP_PASSWORD environment variable.
- `skip_verify` (Boolean) Whether to skip server certificate verification
- `url_base` (String) The base URL for the server, including the protocol
- `username` (String) The name of the user
- `url_base` (String) The base URL for the server, including the protocol. If not specified, defaults to the NUODB_CP_PASSWORD environment variable.
- `username` (String) The name of the user. If not specified, defaults to the NUODB_CP_USER environment variable.
Loading

0 comments on commit 9296514

Please sign in to comment.