Giter Club home page Giter Club logo

terraform-google-container-registry's Introduction

follow on Twitter

Terraform module for Google Container Registry

➡️ Terraform module for Azure Container Registry

➡️ Terraform module for AWS Container Registry

Versions

  • Module tested for Terraform 1.0.1.
  • Google provider version 4.12.0
  • main branch: Provider versions not pinned to keep up with Terraform releases
  • tags releases: Tags are pinned with versions (use in your releases)

Usage

Option 1:

terrafrom init
terraform plan -var='teamid=tryme' -var='prjid=project1'
terraform apply -var='teamid=tryme' -var='prjid=project1'
terraform destroy -var='teamid=tryme' -var='prjid=project1'

Note: With this option please take care of remote state storage

Option 2:

Recommended method (stores remote state in S3 using prjid and teamid to create directory structure):
  • Create python 3.8+ virtual environment
python3 -m venv <venv name>
  • Install package:
pip install tfremote --upgrade
  • Set below environment variables:
export TF_GCLOUD_BUCKET=<remote state bucket name>
export TF_GCLOUD_PREFIX=<remote state bucket prefix>
export TF_GCLOUD_CREDENTIALS=<gcp credentials.json>
  • Updated examples directory with required values.

  • Run and verify the output before deploying:

tf -c=gcloud plan -var='teamid=foo' -var='prjid=bar'
  • Run below to deploy:
tf -c=gcloud apply -var='teamid=foo' -var='prjid=bar'
  • Run below to destroy:
tf -c=gcloud destroy -var='teamid=foo' -var='prjid=bar'

Note: Read more on tfremote

Google Container Registry
module "gcr" {
  source = "../"

  deploy_registry   = true
  gcp_project       = "demo-1000"
  dockerfile_folder = "scripts"
  name              = "test"
  #----------------------------------------------
  # Note: Do not change teamid and prjid once set.
  teamid = var.teamid
  prjid  = var.prjid
}

Please refer to examples directory link for references.

Note

  • Ensure there are executable permissions on scripts/build.sh

terraform-google-container-registry's People

Contributors

tomarv2 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.