-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsources.pkr.hcl
39 lines (33 loc) · 1.06 KB
/
sources.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
source "amazon-ebs" "linux" {
communicator = var.communicator["communicator"]
ssh_port = var.communicator["port"]
ssh_username = var.communicator["username"]
profile = var.profile
region = var.region
instance_type = var.instance_type
vpc_id = var.vpc_id
subnet_id = var.subnet_id
ami_name = "${var.ami_name}-{{isotime \"2006-01-02\"}}"
source_ami_filter {
filters = {
virtualization-type = var.source_ami_filter["virtualization"]
name = var.source_ami_filter["regex"]
root-device-type = var.source_ami_filter["device"]
}
owners = var.source_ami_filter["owners"]
most_recent = true
}
run_tags = merge({
"Name" = "packer-build-${var.ami_name}-{{isotime \"2006-01-02-15-04-05\"}}"
},
var.tags
)
tags = merge({
Name = "${var.ami_name}-{{isotime \"2006-01-02\"}}"
OS_Version = var.os_version
Release = var.release
Base_AMI_Name = "{{ .SourceAMIName}}"
},
var.tags
)
}