This terraform module deploys Jenkins master and build agents in AWS.
This module deploys a multi-az master using ebs-pin and a spot Auto Scaling Group(ASG) for build agents using Self-Organizing Swarm Plug-in. The build agents scale preemtively based on demand using jenkins-autoscaler.
The following resources will be created:
- AWS Key pair
- AWS Public key
- AWS Security groups for the Jenkins
- DNS zone ID used for Jenkins records
- DNS record created for Jenkins master in dns_zone
- AWS Identity and Access Management (IAM) roles
- Jenkins certificates - ACM Certificate Domain Name for Jenkins
You have the option to:
- Size of root volume on Jenkins agents.
- The default value is 50
- Specify Instance type of agents.
- The default value is "C5.large""
- Set Max size of agents ASG.
- The default value is 20
- Set Minimum size of agents ASG.
- The default value is 2
- Set Max price for spot bids on agents
- The default value is 0.5
- Set AMI ID used by the Jenkins master instance
- The default value is ami-08589eca6dcc9b39c
- Instance type used by Jenkins master instance
- The default value is "T3.medium"
- Set Linux agents Userdata
- Set Linux ASG Userdata
- Set Userdata for the master Jenkins
| Name | Version |
|---|---|
| terraform | >= 0.12.20 |
| Name | Version |
|---|---|
| aws | n/a |
| template | n/a |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| account_name | account name | any |
n/a | yes |
| agents_desired_capacity | Desired capacity of agents ASG | string |
"1" |
no |
| agents_disk_size | Size of root volume on Jenkins agents | string |
"50" |
no |
| agents_instance_type | Instance type of agents | string |
"c5.large" |
no |
| agents_max_size | Max size of agents ASG | string |
"20" |
no |
| agents_min_size | Minimum size of agents ASG | string |
"2" |
no |
| agents_spot_price | Max price for spot bids on agents | string |
"0.5" |
no |
| agents_subnet_ids | Subnet IDs for the Jenkins agents. | list(any) |
n/a | yes |
| ami_id | AMI ID used by the Jenkins master instance | string |
"ami-08589eca6dcc9b39c" |
no |
| asg_tags | Tags used for ASGs, has an addition attribute propagate_at_launch on every map. Do not include 'Name'. | list(any) |
n/a | yes |
| aws_key_pair_name | Keypair for the Jenkins master instance | any |
n/a | yes |
| aws_key_pair_public_key | Public Key in authorized_keys format | any |
n/a | yes |
| create_dns_record | Create or not DNS Record | bool |
true |
no |
| dns_base_name | DNS base zone, e.g. example.com | any |
n/a | yes |
| dns_name | DNS record created for Jenkins master in dns_zone | any |
n/a | yes |
| dns_zone | DNS zone ID used for Jenkins records | any |
null |
no |
| http_proxy | HTTP Proxy used in the Jenkins userdata script | any |
n/a | yes |
| instance_type | Instance type used by Jenkins master instance | string |
"t3.medium" |
no |
| jenkins-cert | ACM Certificate Domain Name for Jenkins | any |
n/a | yes |
| jenkins_unique_id | Unique ID used to identify the EBS volume accross instance terminations | any |
n/a | yes |
| lb_subnet_ids | Subnet IDs for the ALB. | list(any) |
n/a | yes |
| linux_workers | If set to true, enable linux workers | bool |
n/a | yes |
| master_ebs_jenkinshome_size | Size of the master jenkins home volume | string |
"50" |
no |
| master_ebs_root_size | Size of the master EBS root volume | string |
"20" |
no |
| master_subnet_ids | Subnet ID for the Jenkins master instance. Multi AZ is supported :) | list(any) |
n/a | yes |
| name | name of jenkins | any |
n/a | yes |
| no_proxy | Proxy exceptions used in the Jenkins userdata script | any |
n/a | yes |
| tags | Tags used for all resources except asgs | map(any) |
n/a | yes |
| vpc_id | VPC ID used by the Jenkins master instance | any |
n/a | yes |
| windows_ami_id | AMI ID used by the Jenkins master instance | string |
"ami-0bbaefd8648c81cc8" |
no |
| windows_workers | If set to true, enable windows workers | bool |
n/a | yes |
| Name | Description |
|---|---|
| master_ssh | SSH to access the Jenkins master instance |
| url | URL to access the Jenkins UI |
Module managed by DNX Solutions.
3-Clause BSD Licensed. See LICENSE for full details.