Giter VIP home page Giter VIP logo

terraform-google-vm's Introduction

terraform-google-vm

This is a collection of opinionated submodules that can be used as building blocks to provision VMs in GCP:

Compatibility

This module is meant for use with Terraform 0.13. If you haven't upgraded and need a Terraform 0.12.x-compatible version of this module, the last released version intended for Terraform 0.12.x is v5.1.0.

Examples

Examples of how to use these modules can be found in the examples folder.

Project APIs

The following APIs must be enabled on your project:

  • compute.googleapis.com
  • iam.googleapis.com

See also the project_services module (optional).

Notes

distribution_policy_zones cannot be changed during use. If you have changed them yourself or used to have a default value, then you'll have to force recreate a MIG group yourself.

Test Configuration

  1. Create a terraform.tfvars file, using terraform.tfvars.example as an example
cp test/fixtures/shared/terraform.tfvars.example test/fixtures/shared/terraform.tfvars

The terraform.tfvars in each fixture directory is already symlinked to this one shared file.

  1. Populate the variables with values appropriate for your test environment (i.e. project_id, service_account.email)
  2. Download a Service Account key with the necessary permissions and put it in the module's root directory with the name credentials.json.

Running Tests

From the root of the module, run

make test_integration_docker

to build the container and run through all the test suites. Note that this will take some time (> 20 minutes).

You can also run each test case individually and interactively in the Docker container:

make docker_run

The root directory of the module will be mounted to /cft/workdir in the container. For example, to run the mig-autoscaler test suite:

bundle exec kitchen test mig-autosaler

or

bundle exec kitchen create mig-autoscaler
bundle exec kitchen converge mig-autoscaler
bundle exec kitchen verify mig-autoscaler
bundle exec kitchen destroy mig-autoscaler

Permissions

The service account used to execute tests for this module should have the following roles:

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.