-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaws.pkr.hcl
64 lines (56 loc) · 1.5 KB
/
aws.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#https://github.com/GlueOps/codespaces/pkgs/container/codespaces
variable "glueops_codespaces_container_tag" {
type = string
}
source "amazon-ebs" "cde" {
region = "us-west-2"
source_ami_filter {
filters = {
virtualization-type = "hvm"
name = "debian-12-amd64-*"
root-device-type = "ebs"
}
owners = ["136693071363"] # Amazon
most_recent = true
}
ami_groups = ["all"]
instance_type = "t3a.large"
ssh_username = "admin"
launch_block_device_mappings {
device_name = "/dev/xvda"
volume_size = 50
volume_type = "gp3"
delete_on_termination = true
}
ami_virtualization_type = "hvm"
ami_regions = ["us-west-2", "us-east-2", "ap-south-1", "eu-central-1" ]
ami_name = "${var.glueops_codespaces_container_tag}"
}
build {
sources = ["source.amazon-ebs.cde"]
provisioner "shell" {
inline = [
"wget http://archive.ubuntu.com/ubuntu/pool/main/e/ec2-instance-connect/ec2-instance-connect_1.1.17-0ubuntu1_all.deb",
"sudo dpkg -i ec2-instance-connect_1.1.17-0ubuntu1_all.deb",
]
}
provisioner "shell" {
scripts = [
"os-setup-start.sh",
"developer-setup.sh",
"os-setup-finish.sh",
]
env = {
BUILDER = "packer"
GLUEOPS_CODESPACES_CONTAINER_TAG = var.glueops_codespaces_container_tag
}
}
}
packer {
required_plugins {
hcloud = {
source = "github.com/hashicorp/amazon"
version = "1.3.3"
}
}
}