This module handles the creation of a GCE instance running Jenkins, configured to run builds on Google Cloud. Creates an instance that can be logged into with the username user and the password bitnami.
This module is meant for use with Terraform 0.12. If you haven't upgraded and need a Terraform 0.11.x-compatible version of this module, the last released version intended for Terraform 0.11.x is v0.1.0.
Please see the examples folder.
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| create_firewall_rules | If worker firewall rules should be created | bool | "false" |
no |
| gcs_bucket | The name of an existing GCS bucket to associate with the created service account, allowing build artifacts to be uploaded. Leave blank to skip | string | "" |
no |
| jenkins_boot_disk_source_image | The name of the disk image to use as the boot disk for the Jenkins master | string | "bitnami-jenkins-2-176-2-0-linux-debian-9-x86-64" |
no |
| jenkins_boot_disk_source_image_project | The project within which the disk image to use as the Jenkins master boot disk exists | string | "bitnami-launchpad" |
no |
| jenkins_initial_password | The initial password to protect Jenkins logins with. Defaults to a random 8-character alphanumeric string. This may not contain special characters. | string | "" |
no |
| jenkins_instance_access_cidrs | CIDRs to allow to access Jenkins over HTTP(s) | list(string) | <list> |
no |
| jenkins_instance_additional_metadata | Additional instance metadata to assign to the Jenkins VM | map(string) | <map> |
no |
| jenkins_instance_machine_type | The machine type to provision for Jenkins | string | "n1-standard-4" |
no |
| jenkins_instance_name | The name to assign to the Jenkins VM | string | "jenkins" |
no |
| jenkins_instance_network | The GCP network to deploy the Jenkins VM in. The firewall rules will be created in the project which hosts this network. | string | n/a | yes |
| jenkins_instance_subnetwork | The GCP subnetwork to deploy the Jenkins VM in | string | n/a | yes |
| jenkins_instance_tags | Tags to assign to the Jenkins VM | list(string) | <list> |
no |
| jenkins_instance_zone | The zone to deploy the Jenkins VM in | string | n/a | yes |
| jenkins_jobs | A list of Jenkins jobs to configure on the instance | list | <list> |
no |
| jenkins_network_project_id | The project ID of the Jenkins network | string | "" |
no |
| jenkins_service_account_display_name | The display name of the service account to create for Jenkins VM provisioning | string | "Jenkins" |
no |
| jenkins_service_account_name | The name of the service account to create for Jenkins VM provisioning | string | "jenkins" |
no |
| jenkins_workers_boot_disk_size_gb | The size of Jenkins worker boot disks, in gigabytes | string | "10" |
no |
| jenkins_workers_boot_disk_source_image | The fully qualified URL to the disk image to use as the boot disk for Jenkins workers | string | "ubuntu-1604-xenial-v20181023" |
no |
| jenkins_workers_boot_disk_source_image_project | The project within which the disk image to use as the Jenkins worker boot disk exists | string | "ubuntu-os-cloud" |
no |
| jenkins_workers_boot_disk_type | The boot disk type to associate with Jenkins workers. Valid options are 'local-ssd', 'pd-ssd', and 'pd-standard' | string | "pd-ssd" |
no |
| jenkins_workers_description | A description of the Jenkins worker cloud to show in Jenkins | string | "Jenkins worker" |
no |
| jenkins_workers_instance_cap | The maximum number of GCE instances to create as Jenkins workers | string | "1" |
no |
| jenkins_workers_labels | GCP labels to apply to Jankins workers | list(string) | <list> |
no |
| jenkins_workers_launch_timeout_seconds | The number of seconds to wait for a Jenkins worker to come online before timing out | string | "300" |
no |
| jenkins_workers_machine_type | The machine type to deploy Jenkins workers onto | string | "n1-standard-1" |
no |
| jenkins_workers_min_cpu_platform | The minimum CPU platform to deploy Jenkins workers onto. Leave blank for no restriction. | string | "" |
no |
| jenkins_workers_name_prefix | A prefix for the Jenkins workers instance names | string | "jenkins" |
no |
| jenkins_workers_network | The URL of the network to deploy Jenkins workers into | string | n/a | yes |
| jenkins_workers_network_tags | A list of network tags to apply to Jenkins workers | list(string) | <list> |
no |
| jenkins_workers_num_executors | The number of concurrent jobs that can run on each Jenkins worker | string | "1" |
no |
| jenkins_workers_preemptible | Whether to launch Jenkins workers as preemptible instances | string | "false" |
no |
| jenkins_workers_project_id | The GCP project to deploy Jenkins workers within | string | n/a | yes |
| jenkins_workers_region | The name of the region into which to deploy Jenkins workers | string | n/a | yes |
| jenkins_workers_retention_time_minutes | The number of minutes for Jenkins workers to remain online after completing their last job | string | "6" |
no |
| jenkins_workers_run_as_user | The user to run Jenkins jobs as on workers | string | "ubuntu" |
no |
| jenkins_workers_service_account_email | The service account email to assign to Jenkins workers. Leave blank for the default compute service account | string | "" |
no |
| jenkins_workers_startup_script | Any additional configuration to run on boot of Jenkins workers | string | "" |
no |
| jenkins_workers_subnetwork | The name of the subnetwork to deploy Jenkins workers into | string | "default" |
no |
| jenkins_workers_zone | The name of the zone into which to deploy Jenkins workers | string | "us-east4-b" |
no |
| project_id | The project ID to deploy to | string | n/a | yes |
| region | The region to deploy to | string | n/a | yes |
| Name | Description |
|---|---|
| jenkins_instance_initial_password | The initial password assigned to the Jenkins instance's user username |
| jenkins_instance_name | The name of the running Jenkins instance |
| jenkins_instance_public_ip | The public IP of the Jenkins instance |
| jenkins_instance_service_account_email | The email address of the created service account |
| jenkins_instance_zone | The zone in which Jenkins is running |
- Terraform 0.10.x
- terraform-provider-google plugin v1.8.0
- ruby-2.5.x
In order to execute this module you must have a Service Account with the following project roles:
- roles/compute.admin
- roles/iam.serviceAccountUser
- roles/compute.networkAdmin
roles/compute.networkAdmin is required on the host project if a shared VPC is used.
In order to operate with the Service Account you must activate the following APIs on the project where the Service Account was created:
- Compute Engine API - compute.googleapis.com
Be sure you have the correct Terraform version (0.10.x), you can choose the binary here:
The project has the following folders and files:
/: root folder/examples: examples for using this module/helpers: scripts used in the build process/templates: templates used in the provisioning process/test: folders with files for testing the module (see Testing section on this file)/main.tf: contains the resources to create/variables.tf: all the variables for the module/output.tf: the outputs of the module/README.md: this file