aboutsummaryrefslogtreecommitdiff
path: root/alpine-ami.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'alpine-ami.yaml')
-rw-r--r--alpine-ami.yaml57
1 files changed, 57 insertions, 0 deletions
diff --git a/alpine-ami.yaml b/alpine-ami.yaml
new file mode 100644
index 0000000..26b75b1
--- /dev/null
+++ b/alpine-ami.yaml
@@ -0,0 +1,57 @@
1variables:
2 security_group: ""
3 subnet: ""
4 destination_regions: ""
5 alpine_release: "3.7"
6
7 # Don't override this without a good reason and if you do just make sure it
8 # gets passed all the way through to the make_ami script
9 volume_name: "/dev/xvdf"
10
11builders:
12 - type: "amazon-ebssurrogate"
13
14 # Image is built inside a custom VPC so let Packer use the existing
15 # resources
16 security_group_id: "{{user `security_group`}}"
17 subnet_id: "{{user `subnet`}}"
18
19 # Input Instance Setting
20 instance_type: "t2.micro"
21 launch_block_device_mappings:
22 - volume_type: "gp2"
23 device_name: "{{user `volume_name`}}"
24 delete_on_termination: false
25 volume_size: 5
26
27 # Output AMI Settings
28 ena_support: true
29 ami_name: "Alpine-{{user `alpine_release`}}-Hardened-EC2"
30 ami_description: "Alpine Linux {{user `alpine_release`}} Release with Hardened Kernel and EC2 Optimizations"
31 ami_groups:
32 - "all"
33 ami_virtualization_type: "hvm"
34 ami_regions: "{{user `destination_regions`}}"
35 ami_root_device:
36 source_device_name: "{{user `volume_name`}}"
37 device_name: "/dev/xvda"
38 delete_on_termination: true
39 volume_size: 5
40 volume_type: "gp2"
41
42 # Use the most recent Amazon Linux AMI as our base
43 ssh_username: "ec2-user"
44 source_ami_filter:
45 filters:
46 virtualization-type: "hvm"
47 root-device-type: "ebs"
48 architecture: "x86_64"
49 name: "amzn-ami-hvm-*-x86_64-gp2"
50 owners:
51 - "137112412989"
52 most_recent: true
53
54provisioners:
55 - type: "shell"
56 script: "make_ami.sh"
57 execute_command: "sudo sh -c '{{ .Vars }} {{ .Path }} {{user `volume_name`}}'"