entur / terraform-google-cloud-storage

Terraform module for GCP Storage Buckets
0 stars 0 forks source link
gcp gcs team-plattform terraform terraform-modules

Terraform module(s) for creating Google Cloud Storage buckets following Entur's conventions

Modules for provisioning Cloud Storage buckets on Google Cloud Platform.

Cloud Storage module

A Cloud Storage module that uses the init module as minimum input, while allowing overrides and additional configuration.

Module

Examples

Getting started

Example using the latest release

module "cloud-storage" {
  source = "github.com/entur/terraform-google-cloud-storage//modules/cloud-storage?ref=v0.2.2"
  ...
}

See the README.md under each module's subfolder for a list of supported inputs and outputs. For examples showing how they're implemented, check the examples subfolder.

Version constraints

You can control the version of a module dependency by adding ?ref=TAG at the end of the source argument, as shown in the example above. This is highly recommended. You can find a list of available versions here.

Dependency automation tools such as Renovate Bot will be able to discover new releases and suggest updates automatically.

Contributing

We welcome contributions to this repo. How to contribute:

Prerequisites

Versioning

This repository is versioned. Please see GitHub´s documentation describing how to create a new release.

Tests

The test setup is inspired by this Medium post.

Local testing

To run the tests locally, make sure the prerequisites are in place. Make sure that you are running the go commands to test in the test folder.

The test files have build tags, these can be used to run only a subset of the tests, for example like this: go test -v -tags=unit.

Automatic testing

In addition to a workflow running Terrascan on all git push events, a separate GitHub workflow is defined for testing the modules:

These run every time a change is pushed to GitHub, but filters in the workflows stops the tests from running when no changes is made in the modules.