-
Notifications
You must be signed in to change notification settings - Fork 3
/
runtime.pkr.hcl
48 lines (41 loc) · 1.16 KB
/
runtime.pkr.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
packer {
required_version = ">= 1.8.7"
required_plugins {
amazon = {
version = ">= 1.1.6"
source = "github.com/hashicorp/amazon"
}
}
}
locals {
ami_name = "runtime-ephemeral-${formatdate("YYYYMMDDhhmm", timestamp())}"
}
source "amazon-ebs" "ubuntu" {
ami_name = local.ami_name
ami_description = "For testing uds-runtime releases"
instance_type = "t3a.medium"
region = "us-west-2"
ssh_username = "ubuntu"
# ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20230608
source_ami = "ami-008fe2fc65df48dac"
}
build {
name = local.ami_name
sources = ["source.amazon-ebs.ubuntu"]
# wait for cloud-init to finish before running the install script
provisioner "shell" {
inline = [
"/usr/bin/cloud-init status --wait",
"echo set debconf to Noninteractive",
"echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections"
]
timeout = "5m"
}
# install tools
provisioner "shell" {
script = "./install-tools.sh"
timeout = "15m"
}
}