terraform-provider-oasis

command module
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

ArangoDB Oasis Terraform Provider

ArangoDB Oasis

Project status: Preview

Note that this provider is currently in preview.

That means that its API may still change.

We welcome your feedback!

Maintainers

This provider plugin is maintained by the team at ArangoDB.

Installation

Downloading the latest released binaries, extract the zip archive and install the binary for your platform in your preferred location.

Or to build from source, run:

git clone https://github.com/arangodb-managed/terraform-provider-oasis.git
make

Requirements

  • Terraform 0.11.x
  • Go 1.16 (to build the provider plugin)

Usage

Retrieving API Keys

Api keys can be generated and viewed under the user's dashboard view on the API Keys tab. On a logged in view, navigate to API Keys and hit the button labeled New API key. This will generate a set of keys which can be used with ArangoDB's public API.

Retrieving relevant IDs

After a key has been obtained, the relevant API can be called to list organizations, projects etc.

Configuration

The following is an example of a terraform deployment configuration:

provider "oasis" {
  api_key_id = "xx"
  api_key_secret  = "xxx"
  organization = "190765105"
  project = "foo"
}

// Example of oneshard deployment
resource "oasis_deployment" "my_oneshard_deployment" {
  terms_and_conditions_accepted = "true"
  project = "190765139" // If set here, overrides project in provider
  location {
    region = "gcp-europe-west4" // Required
  }
  version { // this section is optional
    db_version = "3.6.0" // This is an optional field, if not set the default version will be used
  }

  security { // this section is optional
    ca_certificate = "" // If not set, uses default certificate from project
    ip_allowlist = "" // If not set, no allowlist is configured
    disable_foxx_authentication = false // If set to true, request to Foxx apps are not authentications.
  }

  configuration {
    model = "oneshard"
    node_size_id = "a4"
    node_disk_size = 20
  }

  notification_settings {
    email_addresses = "email@example.test" // this will set email addresses used for notifications regarding depoyment
  }
}

// Example of oneshard deployment without node specification
resource "oasis_deployment" "my_oneshard_deployment" {
  terms_and_conditions_accepted = "true"
  project = "190765139" // If set here, overrides project in provider
  location {
    region = "gcp-europe-west4" // Required
  }

  version { // this section is optional
    db_version = "3.6.0" // This is an optional field, if not set the default version will be used
  }

  security { // this section is optional
    ca_certificate = "" // If not set, uses default certificate from project
    ip_allowlist = "" // If not set, no allowlist is configured
  }

  configuration {
    model = "oneshard" // the smallest will be selected that's available in the given region
  }
}

// Example of a sharded deployment
resource "oasis_deployment" "my_sharded_deployment" {
  terms_and_conditions_accepted = "true"
  project = "190765139" // If set here, overrides project in provider
  location {
    region = "gcp-eu-west4" // Required
  }

  version {  // this section is optional
    db_version = "3.6.0" // This is an optional field, if not set the default version will be used
  }

  security { // this section is optional
    ca_certificate = "" // If not set, uses default certificate from project
    ip_allowlist = "" // If not set, no allowlist is configured
  }

  configuration {
    model = "sharded"
    node_size_id = "a4"
    node_disk_size = 20
    node_count = 5
  }

}

Data sources

Project Data Source

To define and use a project as data source, consider the following terraform configuration:

data "oasis_project" "my_project" {
  name = "MyProject"
  id = "123456789"
}

resource "oasis_deployment" "my_flexible_deployment" {
  project = data.oasis_project.my_project.id
}
Organization Data Source

To define and use an organization as data source, consider the following terraform configuration:

data "oasis_organization" "my_organization" {
  name = "MyOrganization"
  id = "123456789"
}

resource "oasis_deployment" "my_flexible_deployment" {
  organization = data.oasis_organization.my_organization.id
  ...
}

Running Acceptance Tests

In order to run acceptance tests, the following make target needs to be executed:

make test-acc

It is recommended that on a schema addition / deprecation and general larger refactorings the acceptance tests are executed. NOTE that these tests create real deployments, projects and organizations.

Some of them may require additional environment properties to work. I.e.:

export OASIS_TEST_ORGANIZATION_ID=123456789

All of them require the following two environment properties to be set:

export OASIS_API_KEY_ID=<your_key_id>
export OASIS_API_KEY_SECRET=<your_key_secret>

Examples

For further examples, please take a look under Examples folder.

Schema

In order to see every configuration option for this plugin, either browse the code for the data source you are interested in, or, once an oasis terraform configuration file is provided, take a look at the schema with the following command:

terraform providers schema -json ./my_oasis_deployment | jq

Where ./my_oasis_deployment is a folder which contains terraform configuration files.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL