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-*"