From 0b8e1fc6ce0308c925f33ab5b118215259392359 Mon Sep 17 00:00:00 2001 From: Timo Ulich Date: Tue, 8 Mar 2022 13:27:43 +0100 Subject: [PATCH] feat: Add associate_public_ip_address variable to windows AMI too (#1819) See https://github.com/philips-labs/terraform-aws-github-runner/pull/1816#issuecomment-1060650668 --- .../github_agent.windows.pkr.hcl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/images/windows-core-2019/github_agent.windows.pkr.hcl b/images/windows-core-2019/github_agent.windows.pkr.hcl index bde19e3b33..0eb7240e5b 100644 --- a/images/windows-core-2019/github_agent.windows.pkr.hcl +++ b/images/windows-core-2019/github_agent.windows.pkr.hcl @@ -25,11 +25,19 @@ variable "ebs_delete_on_termination" { default = true } +variable "associate_public_ip_address" { + description = "If using a non-default VPC, there is no public IP address assigned to the EC2 instance. If you specified a public subnet, you probably want to set this to true. Otherwise the EC2 instance won't have access to the internet" + type = string + default = null +} + source "amazon-ebs" "githubrunner" { - ami_name = "github-runner-windows-core-2019-${formatdate("YYYYMMDDhhmm", timestamp())}" - communicator = "winrm" - instance_type = "t3a.medium" - region = var.region + ami_name = "github-runner-windows-core-2019-${formatdate("YYYYMMDDhhmm", timestamp())}" + communicator = "winrm" + instance_type = "t3a.medium" + region = var.region + associate_public_ip_address = var.associate_public_ip_address + source_ami_filter { filters = { name = "Windows_Server-2019-English-Core-ContainersLatest-*"