Skip to content

Commit a65d342

Browse files
author
James Healy
authored
Merge pull request #803 from buildkite/remove-ami-lookup
remove AMI lookup in the Makefile
2 parents 45aee86 + 53590e8 commit a65d342

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ PACKER_LINUX_FILES = $(exec find packer/linux)
88
PACKER_WINDOWS_FILES = $(exec find packer/windows)
99

1010
AWS_REGION ?= us-east-1
11-
AMZN_LINUX2_AMI ?= $(shell aws ec2 describe-images --region $(AWS_REGION) --owners amazon --filters 'Name=name,Values=amzn2-ami-hvm-2.0.????????-x86_64-gp2' 'Name=state,Values=available' --output json | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId')
1211

1312
ARM64_INSTANCE_TYPE = m6g.xlarge
1413
AMD64_INSTANCE_TYPE = c5.xlarge
@@ -88,7 +87,7 @@ packer-linux-amd64.output: $(PACKER_LINUX_FILES) build/s3secrets-helper-linux-am
8887
-v "$(PWD):/src" \
8988
--rm \
9089
-w /src/packer/linux \
91-
hashicorp/packer:$(PACKER_VERSION) build -timestamp-ui -var 'ami=$(AMZN_LINUX2_AMI)' -var 'region=$(AWS_REGION)' \
90+
hashicorp/packer:$(PACKER_VERSION) build -timestamp-ui -var 'region=$(AWS_REGION)' \
9291
-var 'arch=x86_64' -var 'goarch=amd64' -var 'instance_type=$(AMD64_INSTANCE_TYPE)' \
9392
buildkite-ami.json | tee $@
9493

@@ -109,7 +108,7 @@ packer-linux-arm64.output: $(PACKER_LINUX_FILES) build/s3secrets-helper-linux-ar
109108
-v "$(PWD):/src" \
110109
--rm \
111110
-w /src/packer/linux \
112-
hashicorp/packer:$(PACKER_VERSION) build -timestamp-ui -var 'ami=$(AMZN_LINUX2_AMI)' -var 'region=$(AWS_REGION)' \
111+
hashicorp/packer:$(PACKER_VERSION) build -timestamp-ui -var 'region=$(AWS_REGION)' \
113112
-var 'arch=arm64' -var 'goarch=arm64' -var 'instance_type=$(ARM64_INSTANCE_TYPE)' \
114113
buildkite-ami.json | tee $@
115114

packer/linux/buildkite-ami.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@
7474
}
7575
]
7676
}
77+

0 commit comments

Comments
 (0)