Git Product home page Git Product logo

cratedb-terraform's Introduction

CrateDB Terraform Configurations

This repository contains a collection of Terraform configurations to deploy a CrateDB cluster to various environments.

Supported environments are:

  • aws: Deployment of EC2 instances with a public-facing load balancer
  • azure: Deployment of Azure VMs with a public-facing load balancer

Development

TFLint is configured to check the code for issues. Inside the respective subdirectories, run tflint --init to initialize it, and tflint to run it. Different .tflint.hcl configurations exist for each subdirectory.

Before committing, please run terraform fmt to apply Terraform's standard configuration style consistently.

Testing

Integration testing is done using Terratest. The tests start a new cluster and perform a few very basic checks to verify if the deployment was successful.

Since the tests need details on the cloud environment to run in, set up corresponding environment variables, e.g. in a .env file:

AWS_TEST_REGION=eu-central-1
AWS_TEST_VPC_ID=vpc-123
AWS_TEST_SSH_KEYPAIR=cratedb_terraform
AWS_TEST_SUBNET_IDS="[\"subnet-123\", \"subnet-124\"]"
AWS_TEST_AVAILABILITY_ZONES="[\"eu-central-1b\", \"eu-central-1a\"]"

AZURE_TEST_SUBSCRIPTION_ID=abc

To run the test, load the environment variables and pass them to go test (see run.sh):

cd test
source .env
AWS_TEST_REGION=$AWS_TEST_REGION \
AWS_TEST_VPC_ID=$AWS_TEST_VPC_ID \
AWS_TEST_SSH_KEYPAIR=$AWS_TEST_SSH_KEYPAIR \
AWS_TEST_SUBNET_IDS=$AWS_TEST_SUBNET_IDS \
AWS_TEST_AVAILABILITY_ZONES=$AWS_TEST_AVAILABILITY_ZONES \
AZURE_TEST_SUBSCRIPTION_ID=$AZURE_TEST_SUBSCRIPTION_ID \
go test

If you want to run only a single test, you can specific the name of the test, e.g. go test -run TestTerraformAzure.

cratedb-terraform's People

Contributors

dependabot[bot] avatar hammerhead avatar proddata avatar wierdvanderhaar avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cratedb-terraform's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.