diff --git a/CHANGELOG.md b/CHANGELOG.md index 1238aea03..953be0b0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [2.2.0] - 2019-03-08 +- Changed: Upgrade default runner agent to 11.8.0 and docker machine to 0.16.1 +- Bugfix: Correct example for docker_machine_options #36 (@declension) +- Added: AWS Zone variable #35 (@declension) + ## [2.1.0] - 2019-02-28 - Bugfix: Shared cache is not working #33 - Bugfix: Missing documentation makes setup fail #31 @@ -89,7 +94,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Update default AMI's to The latest Amazon Linux AMI 2017.09.1 - released on 2018-01-17. - Minor updates in the example -[Unreleased]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.1.0...HEAD +[Unreleased]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.2.0...HEAD +[2.2.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.1.0...2.2.0 [2.1.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.0.0...2.1.0 [2.0.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/1.8.0...2.0.0 [1.8.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/1.7.0...1.8.0 diff --git a/README.md b/README.md index 193c06a6e..b5a9d6998 100644 --- a/README.md +++ b/README.md @@ -115,29 +115,30 @@ module "gitlab-runner" { | ami_filter | AMI filter to select the AMI used to host the gitlab runner agent. By default the pattern `amzn-ami-hvm-2018.03*-x86_64-ebs` is used for the name. Currently Amazon Linux 2 `amzn2-ami-hvm-2.0.????????-x86_64-ebs` looks *not* working for this configuration. | list | `` | no | | ami_owners | A list of owners used to select the AMI for the instance. | list | `` | no | | aws_region | AWS region. | string | - | yes | +| aws_zone | AWS availability zone (typically 'a', 'b', or 'c'). | string | `a` | no | | cache_bucket_prefix | Prefix for s3 cache bucket name. | string | `` | no | | cache_expiration_days | Number of days before cache objects expires. | string | `1` | no | | cache_shared | Enables cache sharing between runners, false by default. | string | `false` | no | | create_runners_iam_instance_profile | | string | `true` | no | | docker_machine_instance_type | Instance type used for the instances hosting docker-machine. | string | `m4.large` | no | -| docker_machine_options | Additional to set options for docker machien. Each element of the list should be key and value. E.g. '["--amazonec2-zone=a"]' | list | `` | no | +| docker_machine_options | Additional to set options for docker machine. Each element of the list should be key and value. E.g. '["amazonec2-zone=a"]' | list | `` | no | | docker_machine_spot_price_bid | Spot price bid. | string | `0.04` | no | | docker_machine_user | User name for the user to create spot instances to host docker-machine. | string | `docker-machine` | no | -| docker_machine_version | Version of docker-machine. | string | `0.16.0` | no | +| docker_machine_version | Version of docker-machine. | string | `0.16.1` | no | | enable_cloudwatch_logging | Enable or disable the CloudWatch logging. | string | `1` | no | | environment | A name that identifies the environment, will used as prefix and for tagging. | string | - | yes | -| gitlab_runner_version | Version for the gitlab runner. | string | `11.6.0` | no | +| gitlab_runner_version | Version for the gitlab runner. | string | `11.8.0` | no | | instance_role_json | Instance role json for the runner agent ec2 instance to override the default. | string | `` | no | | instance_role_runner_json | Instance role json for the docker machine runners to override the default. | string | `` | no | | instance_type | Instance type used for the gitlab-runner. | string | `t2.micro` | no | | runners_concurrent | Concurrent value for the runners, will be used in the runner config.toml | string | `10` | no | +| runners_executor | The executor to use. Currently supports docker+machine or docker | string | `docker+machine` | no | | runners_gitlab_url | URL of the gitlab instance to connect to. | string | - | yes | | runners_iam_instance_profile_name | IAM instance profile name of the runners, will be used in the runner config.toml | string | `` | no | | runners_idle_count | Idle count of the runners, will be used in the runner config.toml | string | `0` | no | | runners_idle_time | Idle time of the runners, will be used in the runner config.toml | string | `600` | no | | runners_image | Image to run builds, will be used in the runner config.toml | string | `docker:18.03.1-ce` | no | | runners_limit | Limit for the runners, will be used in the runner config.toml | string | `0` | no | -| runners_machine_iam_instance_profile_name | IAM instance profile name to assign to the spot instance which runs the build. | string | `` | no | | runners_monitoring | Enable detailed cloudwatch monitoring for spot instances. | string | `false` | no | | runners_name | Name of the runner, will be used in the runner config.toml | string | - | yes | | runners_off_peak_idle_count | Off peak idle count of the runners, will be used in the runner config.toml. | string | `0` | no | @@ -154,8 +155,8 @@ module "gitlab-runner" { | runners_token | Token for the runner, will be used in the runner config.toml | string | - | yes | | runners_use_private_address | Restrict runners to use only private address | string | `true` | no | | ssh_public_key | Public SSH key used for the gitlab-runner ec2 instance. | string | - | yes | -| subnet_ids_gitlab_runner | Subnets used for hosting the gitlab-runner. | list | - | yes | | subnet_id_runners | Subnet used to hosts the docker-machine runners. | string | - | yes | +| subnet_ids_gitlab_runner | Subnet used for hosting the gitlab-runner. | list | - | yes | | tags | Map of tags that will be added to created resources. By default resources will be taggen with name and environemnt. | map | `` | no | | userdata_post_install | User-data script snippet to insert after gitlab-runner install | string | `` | no | | userdata_pre_install | User-data script snippet to insert before gitlab-runner install | string | `` | no | diff --git a/examples/runner-public/main.tf b/examples/runner-public/main.tf index e874c32a4..4ec067058 100644 --- a/examples/runner-public/main.tf +++ b/examples/runner-public/main.tf @@ -5,7 +5,7 @@ module "vpc" { name = "vpc-${var.environment}" cidr = "10.1.0.0/16" - azs = ["eu-west-1a"] + azs = ["eu-west-1b"] public_subnets = ["10.1.101.0/24"] tags = { @@ -26,6 +26,7 @@ module "runner" { vpc_id = "${module.vpc.vpc_id}" subnet_ids_gitlab_runner = "${module.vpc.public_subnets}" subnet_id_runners = "${element(module.vpc.public_subnets, 0)}" + aws_zone = "b" runners_name = "${var.runner_name}" runners_gitlab_url = "${var.gitlab_url}" diff --git a/main.tf b/main.tf index a1535fe4b..b51aa9972 100644 --- a/main.tf +++ b/main.tf @@ -107,6 +107,7 @@ data "template_file" "runners" { runners_vpc_id = "${var.vpc_id}" runners_subnet_id = "${var.subnet_id_runners}" + runners_aws_zone = "${var.aws_zone}" runners_instance_type = "${var.docker_machine_instance_type}" runners_spot_price_bid = "${var.docker_machine_spot_price_bid}" runners_security_group_name = "${aws_security_group.docker_machine.name}" diff --git a/template/runner-config.tpl b/template/runner-config.tpl index fe87a5bed..4537aff7e 100644 --- a/template/runner-config.tpl +++ b/template/runner-config.tpl @@ -35,6 +35,7 @@ check_interval = 0 MachineOptions = [ "amazonec2-instance-type=${runners_instance_type}", "amazonec2-region=${aws_region}", + "amazonec2-zone=${runners_aws_zone}", "amazonec2-vpc-id=${runners_vpc_id}", "amazonec2-subnet-id=${runners_subnet_id}", "amazonec2-private-address-only=${runners_use_private_address}", diff --git a/variables.tf b/variables.tf index adc4f73dc..8ee498986 100644 --- a/variables.tf +++ b/variables.tf @@ -3,6 +3,12 @@ variable "aws_region" { type = "string" } +variable "aws_zone" { + description = "AWS availability zone (typically 'a', 'b', or 'c')." + type = "string" + default = "a" +} + variable "environment" { description = "A name that identifies the environment, will used as prefix and for tagging." type = "string" @@ -46,7 +52,7 @@ variable "docker_machine_spot_price_bid" { variable "docker_machine_version" { description = "Version of docker-machine." - default = "0.16.0" + default = "0.16.1" } variable "runners_name" { @@ -214,7 +220,7 @@ variable "cache_shared" { variable "gitlab_runner_version" { description = "Version for the gitlab runner." type = "string" - default = "11.6.0" + default = "11.8.0" } variable "enable_cloudwatch_logging" { @@ -234,7 +240,7 @@ variable "allow_iam_service_linked_role_creation" { } variable "docker_machine_options" { - description = "Additional to set options for docker machien. Each element of the list should be key and value. E.g. '[\"--amazonec2-zone=a\"]'" + description = "Additional to set options for docker machine. Each element of the list should be key and value. E.g. '[\"amazonec2-zone=a\"]'" type = "list" default = [] }