@@ -13,12 +13,12 @@ variable "runner_version" {
1313}
1414
1515variable "architecture" {
16- description = " The architecture of the runner. Supported values are 'x86-64 ' and 'arm64'"
16+ description = " The architecture of the runner. Supported values are 'x64 ' and 'arm64'"
1717 type = string
18- default = " x86_64 "
18+ default = " x64 "
1919 validation {
20- condition = contains ([" arm64" , " x86_64 " ], var. architecture )
21- error_message = " `lambda_architecture ` value is not valid, valid values are: `arm64` and `x86_64 `."
20+ condition = contains ([" arm64" , " x64 " ], var. architecture )
21+ error_message = " `architecture ` value is not valid, valid values are: `arm64` and `x64 `."
2222 }
2323}
2424
@@ -49,7 +49,7 @@ variable "associate_public_ip_address" {
4949variable "instance_type" {
5050 description = " The instance type Packer will use for the builder"
5151 type = string
52- default = " t4g.small "
52+ default = null
5353}
5454
5555variable "iam_instance_profile" {
@@ -109,12 +109,12 @@ data "http" github_runner_release_json {
109109
110110locals {
111111 runner_version = coalesce (var. runner_version , trimprefix (jsondecode (data. http . github_runner_release_json . body ). tag_name , " v" ))
112- instance_type = coalesce (var. instance_type , var. architecture == " arm64" ? " t4g.small " : " m3.medium" )
112+ instance_type = coalesce (var. instance_type , var. architecture == " arm64" ? " t4g.medium " : " m3.medium" )
113113}
114114
115115source "amazon-ebs" "githubrunner" {
116116 ami_name = " github-runner-al2023-${ var . architecture } -${ formatdate (" YYYYMMDDhhmm" , timestamp ())} "
117- instance_type = var . instance_type
117+ instance_type = local . instance_type
118118 iam_instance_profile = var. iam_instance_profile
119119 region = var. region
120120 security_group_id = var. security_group_id
@@ -124,7 +124,7 @@ source "amazon-ebs" "githubrunner" {
124124
125125 source_ami_filter {
126126 filters = {
127- name = " al2023-ami-2023.*-kernel-6.*-${ var . architecture } "
127+ name = " al2023-ami-2023.*-kernel-6.*-${ var . architecture == " x64 " ? " x86_64 " : var . architecture } "
128128 root-device-type = " ebs"
129129 virtualization-type = " hvm"
130130 }
0 commit comments