ElasticDW Terraform Provider
ElasticDW comes with a Terraform provider that facilitates the management of ElasticDW environments and clusters. This Terraform provider exposes the configuration for these components as Terraform resources (representations of the physical infrastructure as code) while handling the required API interactions to configure them in the background. These resources can be used independently or as part of a larger infrastructure-as-code implementation.
Resources
Authentication
The provider needs to be configured with the URL to the API that will be handling the resource creation and the associated credentials. You can specify this information using the EDW_URL
, EDW_CLIENT_ID
and EDW_TOKEN
environment variables.
export EDW_TOKEN="your_master_OR_environment_token"
export EDW_CLIENT_ID="your_client_id"
export EDW_URL="api_url"
terraform plan
Example Usage
After setting up the provider authentication, you can use it to define your resources as Terraform code:
provider "edw" {}
# Create an environment
resource "edw_environment" "my-environment" {
name = "test-env-1"
aws_iam_role = "arn:aws:iam::xxxx:role/edw/access/role/edw-access-role"
}
# Create a cluster
resource "edw_cluster" "my-cluster" {
name = "dev-cluster-a"
environment_id = environment.my-environment.id
database_name = "vertica"
database_master_password = "secret-password"
vertica_version = "9.3.0-1"
storage_size = 128
node_count = 1
disable_backups = false
enable_eon_mode = false
aws_region = "us-west-2"
aws_vpc_id = "vpc-xxxx"
aws_subnet_id = "subnet-xxxx"
aws_instance_type = "m4.large"
use_aws_spot_instances = false
}