Git Product home page Git Product logo

terraform-google-cloud-deploy's Introduction

Cloud Deploy terraform module

This module is used to create Google Cloud Deploy delivery pipelines, targets and their respective service accounts.

Prerequisites

This example needs below mentioned prerequisites are in place before consuming the example.

Target GKE clusters should be operational

Edit the Organization Policy "iam.disableCrossProjectServiceAccountUsage" to "not enforce" in all the target project in case deployment service accounts are created in different projects.

Cloud deploy manifests file repo should be connected in cloud builds trigger section

VPC and VPN creation (https://cloud.google.com/architecture/accessing-private-gke-clusters-with-cloud-build-private-pools) for private clusters

The service accounts and targets are unique across delivery pipeline.

Sample Usage:

module "cloud_deploy" {
  source = "terraform-google-modules/cloud-deploy/google"
  pipeline_name = "google-pipeline-same-gke-1"
  location      = "us-central1"
  project       = "gdc-clouddeploy-source"
  stage_targets = [{
    target_name   = "dev-1-test"
    profiles      = ["test"]
    target_create = true
    target_type   = "gke"
    target_spec = {
      project_id       = "gdc-clouddeploy-source"
      location         = "us-central1-c"
      gke_cluster_name = "cluster-2"
      gke_cluster_sa   = "[email protected]"
    }
    require_approval   = false
    exe_config_sa_name = "deployment-test-1-google-test"
    execution_config = {
      execution_timeout = "3600s"
      worker_pool       = null
      artifact_storage  = ""
    }
    strategy = {
      standard = {
        verify = true
      }
    }
    }, {
    target_name   = "prod-1-test"
    profiles      = ["prod"]
    target_create = true
    target_type   = "gke"
    target_spec = {
      project_id       = "gdc-clouddeploy-source"
      location         = "us-central1-c"
      gke_cluster_name = "cluster-2"
      gke_cluster_sa   = "[email protected]"
     }
    require_approval   = true
    exe_config_sa_name = "deployment-prod-1-google-test"
    execution_config   = {}
    strategy           = {}
  }]
  trigger_sa_name   = "cd-trigger-1"
  trigger_sa_create = true
}

Inputs

Name Description Type Default Required
location Location of the Pipeline string n/a yes
pipeline_name Name of the Delivery Pipeline string n/a yes
project Project ID string n/a yes
stage_targets List of object specifications for Deploy Targets
list(object({
target_name = string
profiles = list(string)
target_create = bool
target_type = string
target_spec = map(string)
require_approval = bool
exe_config_sa_name = string
execution_config = map(string)
strategy = any
}))
n/a yes
trigger_sa_create True for trigger service account creation, False to reuse existing trigger service account bool true no
trigger_sa_name Name of the Trigger service account string n/a yes

Outputs

Name Description
delivery_pipeline_and_target List of Delivery Pipeline and respective Target
execution_sa List of Deploy target Execution Service Account
trigger_sa List of Cloud Build Trigger Service Account

Requirements

These sections describe requirements for using this example.

Software

The following dependencies must be available:

  • Terraform ~> v0.13+
  • Terraform Provider for GCP ~> v3.53+
  • Terraform Provider for GCP Beta ~> v3.53+

Service Account:

Add yourself to service account user roles for the created service account.

APIs

Enable below api's

  • "clouddeploy.googleapis.com"
  • "container.googleapis.com".

Contributing

Refer to the contribution guidelines for information on contributing to this module.

Security Disclosures

Please see our security disclosure process.

terraform-google-cloud-deploy's People

Contributors

bharathkkb avatar cloud-foundation-bot avatar dependabot[bot] avatar gtsorbo avatar niranjankl avatar release-please[bot] avatar renovate-bot avatar sudharsanesivamany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

terraform-google-cloud-deploy's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
test/setup/Dockerfile
gomod
test/integration/go.mod
  • go 1.21
  • github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test v0.11.1
  • github.com/stretchr/testify v1.8.4
regex
Makefile
  • cft/developer-tools 1
build/int.cloudbuild.yaml
  • cft/developer-tools 1
build/lint.cloudbuild.yaml
  • cft/developer-tools 1
terraform
examples/cloud_run/main.tf
  • GoogleCloudPlatform/cloud-deploy/google ~> 0.2
examples/multiple_project_private_gke/main.tf
  • GoogleCloudPlatform/cloud-deploy/google ~> 0.2
examples/multiple_project_public_gke/main.tf
  • GoogleCloudPlatform/cloud-deploy/google ~> 0.2
examples/single_project_private_gke/main.tf
  • GoogleCloudPlatform/cloud-deploy/google ~> 0.2
examples/single_project_public_gke/main.tf
  • GoogleCloudPlatform/cloud-deploy/google ~> 0.2
  • terraform-google-modules/kubernetes-engine/google 25.0.0
  • terraform-google-modules/network/google ~> 7.0
main.tf
  • terraform-google-modules/service-accounts/google ~> 4.0
  • terraform-google-modules/service-accounts/google ~> 4.0
test/fixtures/cloud_run/main.tf
test/fixtures/multiple_project_private_gke/main.tf
test/fixtures/multiple_project_public_gke/main.tf
test/fixtures/single_project_private_gke/main.tf
test/fixtures/single_project_public_gke/main.tf
test/setup/main.tf
  • terraform-google-modules/gcloud/google ~> 3.3.0
  • terraform-google-modules/project-factory/google ~> 14.0
test/setup/versions.tf
  • google >= 3.25.0
  • google-beta >= 3.25.0
  • hashicorp/terraform >= 0.13
versions.tf
  • google >= 3.53, < 6
  • hashicorp/terraform >= 0.13

  • Check this box to trigger a request for Renovate to run again on this repository

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.