Skip to content

Commit

Permalink
Merge branch 'issue-232-aws-zone' of https://github.com/kayma-hl/terr…
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Jul 12, 2020
2 parents d9cb64d + 6b0f432 commit 45c6214
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](http:https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http:https://semver.org/).

## Unreleased

- Changed: Variable aws_zone no longer needed (#232) by @kayma-hl

## 4.18.0 - 2020-06-01

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ terraform destroy
| ami\_owners | The list of owners used to select the AMI of Gitlab runner agent instances. | `list(string)` | <pre>[<br> "amazon"<br>]</pre> | no |
| arn\_format | ARN format to be used. May be changed to support deployment in GovCloud/China regions. | `string` | `"arn:aws"` | no |
| aws\_region | AWS region. | `string` | n/a | yes |
| aws\_zone | AWS availability zone (typically 'a', 'b', or 'c'). | `string` | `"a"` | no |
| cache\_bucket | Configuration to control the creation of the cache bucket. By default the bucket will be created and used as shared cache. To use the same cache across multiple runners disable the creation of the cache and provide a policy and bucket name. See the public runner example for more details. | `map` | <pre>{<br> "bucket": "",<br> "create": true,<br> "policy": ""<br>}</pre> | no |
| cache\_bucket\_name\_include\_account\_id | Boolean to add current account ID to cache bucket name. | `bool` | `true` | no |
| cache\_bucket\_prefix | Prefix for s3 cache bucket name. | `string` | `""` | no |
Expand Down Expand Up @@ -362,4 +361,4 @@ terraform destroy
| runner\_role\_name | Name of the role used for the docker machine runners. |
| runner\_sg\_id | ID of the security group attached to the docker machine runners. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
10 changes: 9 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
data "aws_caller_identity" "current" {}

data "aws_subnet" "runners" {
id = var.subnet_id_runners
}

data "aws_availability_zone" "runners" {
name = data.aws_subnet.runners.availability_zone
}

# Parameter value is managed by the user-data script of the gitlab runner instance
resource "aws_ssm_parameter" "runner_registration_token" {
name = local.secure_parameter_store_runner_token_key
Expand Down Expand Up @@ -72,7 +80,7 @@ locals {
gitlab_url = var.runners_gitlab_url
runners_vpc_id = var.vpc_id
runners_subnet_id = var.subnet_id_runners
runners_aws_zone = var.aws_zone
runners_aws_zone = data.aws_availability_zone.runners.name_suffix
runners_instance_type = var.docker_machine_instance_type
runners_spot_price_bid = var.docker_machine_spot_price_bid
runners_ami = data.aws_ami.docker-machine.id
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ variable "aws_region" {
}

variable "aws_zone" {
description = "AWS availability zone (typically 'a', 'b', or 'c')."
description = "Deprecated. Will be removed in the next major release."
type = string
default = "a"
}
Expand Down

0 comments on commit 45c6214

Please sign in to comment.