Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Requirements

Name Version
github >= 4.3.0
google >= 4.28.0
null ~> 2.1

Providers

Name Version
github >= 4.3.0
null ~> 2.1

Inputs

Name Description Type Default Required
app_runtime Type of runtime for the application e.g java or golang or python etc. string n/a yes
application_name Name of the application which will also be the name of the repo. string n/a yes
billing_account GCP billing account. string n/a yes
cd_sa Cloud Deploy CICD SA. string n/a yes
ci_sa Cloud Build CICD SA. string n/a yes
folder_id GCP folder ID under which you are creating the application. string "" no
github_email GitHub user email. string n/a yes
github_user GitHub username. string n/a yes
org_id GCP org id. string n/a yes
org_name_to_clone_template_from GitHub org where the repo will be created. string n/a yes
project_id Id of the application admin/seed project. string n/a yes
project_number Project number of the application admin/seed project. number n/a yes
region Region where the application related resources will be created. string n/a yes
service_account CICD Cloud Build IaC. string n/a yes
state_bucket Terraform state bucket for the IaC. string n/a yes
trigger_type webhook to github trigger. string "webhook" no

Usage

module "setup-iac-pipeline" {
  source = "git::https://github.com/YOUR_GITHUB_ORG/terraform-modules.git//manage-repos/github-infra-repo"
  application_name = "my-app"
  org_name_to_clone_template_from = "YOUR_GITHUB_ORG"
  trigger_type = "webhook"
  project_number = 123456789
  project_id = <Project Id>
  service_account = <SA for IaC Cloud Build pipeline>
  app_runtime = "java"
  github_user = <GitHub user>
  github_email = <GitHub user email>
  org_id = <GCP Org>
  billing_account = "1111-2222-3333-4444"
  state_bucket = <TF state bucket>
  ci_sa  = <SA for CI Cloud Build pipeline>
  cd_sa = <SA for Cloud deploy>
  region = "us-central1"
  folder_id = "" 
}

Workflow

This module is called from app-name.tf files in Application Factory repo for each application and performs the following actions:

  • sets up infrastructure repo for the application.
  • optionally creates a webhook or GitHub trigger connected to the infrastructure repo.