This is an automated email from the ASF dual-hosted git repository. ash pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/airflow-ci-infra.git
The following commit(s) were added to refs/heads/main by this push: new 67d11b5 Make AMI available in eu-central-1 and us-east-2 regions (#26) 67d11b5 is described below commit 67d11b51d8648c76dc22f337a4c27bc96d62bcf7 Author: Ash Berlin-Taylor <ash_git...@firemirror.com> AuthorDate: Fri May 7 18:56:48 2021 +0100 Make AMI available in eu-central-1 and us-east-2 regions (#26) --- github-runner-ami/packer/ubuntu2004.pkr.hcl | 24 +++++++++++++--------- .../packer/vars/variables.pkrvars.hcl | 3 +-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/github-runner-ami/packer/ubuntu2004.pkr.hcl b/github-runner-ami/packer/ubuntu2004.pkr.hcl index fbc8897..f428705 100644 --- a/github-runner-ami/packer/ubuntu2004.pkr.hcl +++ b/github-runner-ami/packer/ubuntu2004.pkr.hcl @@ -21,11 +21,8 @@ variable "vpc_id" { variable "ami_name" { type = string } -variable "aws_region" { - type = string -} -variable "subnet_id" { - type = string +variable "aws_regions" { + type = list(string) } variable "packer_role_arn" { type = string @@ -44,12 +41,16 @@ source "amazon-ebs" "runner_builder" { } #access_key = "" #secret_key = "" - region = var.aws_region + region = var.aws_regions[0] ami_name = "${var.ami_name}-${var.runner_version}" - ami_regions = [var.aws_region] + ami_regions = var.aws_regions tag { - key = "ami" - value = "github-runner-ami" + key = "Name" + value = "github-runner-ami" + } + snapshot_tag { + key = "Name" + value = "github-runner-ami-root" } encrypt_boot = false instance_type = "t3.micro" @@ -57,7 +58,10 @@ source "amazon-ebs" "runner_builder" { ssh_username = "ubuntu" ssh_interface = "session_manager" iam_instance_profile = var.session_manager_instance_profile_name - subnet_id = var.subnet_id + subnet_filter { + # Just pick a random subnet in the VPC -- we only have the three defaults so this is fine! + random = true + } vpc_id = var.vpc_id source_ami_filter { filters = { diff --git a/github-runner-ami/packer/vars/variables.pkrvars.hcl b/github-runner-ami/packer/vars/variables.pkrvars.hcl index 86d8d33..f25c300 100644 --- a/github-runner-ami/packer/vars/variables.pkrvars.hcl +++ b/github-runner-ami/packer/vars/variables.pkrvars.hcl @@ -17,8 +17,7 @@ vpc_id = "vpc-d73487bd" ami_name = "airflow-runner-ami" -aws_region = "eu-central-1" -subnet_id = "subnet-72ed3c0e" +aws_regions = ["eu-central-1", "us-east-2"] packer_role_arn = "arn:aws:iam::827901512104:role/packer-role" runner_version = "2.278.0-airflow2" session_manager_instance_profile_name = "packer_ssm_instance_profile"