packer: don't save the AMIs on PRs

This should save us a ton of resources as we don't use AMIs from PRs.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2022-03-10 11:55:07 +01:00 committed by Ondřej Budai
parent ad15179faf
commit 72de1b3bbe
3 changed files with 15 additions and 0 deletions

View file

@ -18,6 +18,12 @@ variable "region" {
# Automatically set by environment variables
variable "composer_commit" { type = string }
# Controls whether AMIs should be created. If you just need to test whether the image can be built, leave it as true
variable "skip_create_ami" {
type = bool
default = true
}
# The name of the resulting AMI and the underlying EBS snapshot
variable "image_name" { type = string }
# A list of users to share the AMI with

View file

@ -20,6 +20,8 @@ source "amazon-ebs" "image_builder" {
# Network configuration for the instance building our image.
associate_public_ip_address = true
ssh_interface = "public_ip"
skip_create_ami=var.skip_create_ami
}
build {