-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaws.ami.pkr.hcl
48 lines (39 loc) · 909 Bytes
/
aws.ami.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
packer {
required_plugins {
amazon = {
version = ">= 0.0.2"
source = "github.com/hashicorp/amazon"
}
}
}
source "amazon-ebs" "amazon-linux" {
region = "us-east-1"
ami_name = "ami-version-1.0.1-{{timestamp}}"
instance_type = "t2.micro"
ssh_username = "ec2-user"
source_ami = "ami-030edc11f90d05d8c"
ami_regions = ["us-east-1"]
}
build {
name = "hq-packer"
sources = ["source.amazon-ebs.amazon-linux"]
provisioner "file" {
source = "provisioner.sh"
destination = "/tmp/provisioner.sh"
}
provisioner "shell" {
inline = ["chmod +x /tmp/provisioner.sh"]
}
provisioner "shell" {
inline = ["ls -la /tmp"]
}
provisioner "shell" {
inline = ["pwd"]
}
provisioner "shell" {
inline = ["cat /tmp/provisioner.sh"]
}
provisioner "shell" {
inline = ["/bin/bash -x /tmp/provisioner.sh"]
}
}