-
-
Notifications
You must be signed in to change notification settings - Fork 274
/
Copy pathaws.pkr.hcl
32 lines (29 loc) · 799 Bytes
/
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
variable "region" {
type = string
default = "eu-west-3"
}
locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
source "amazon-ebs" "hardening" {
ami_name = "hardening-packer-${local.timestamp}"
instance_type = "t3.small"
region = var.region
source_ami_filter {
filters = {
name = "ubuntu/images/hvm-ssd/*ubuntu-focal-20.04-amd64-server*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"]
}
ssh_username = "ubuntu"
ssh_timeout = "10m"
ssh_keep_alive_interval = "15s"
ssh_pty = "true"
}
build {
sources = ["source.amazon-ebs.hardening"]
provisioner "shell" {
script = "./aws_configure.sh"
}
}