-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvault.pkr.hcl
67 lines (59 loc) · 1.68 KB
/
vault.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
65
66
67
variable "aws_region" {
type = string
default = "${env("AWS_REGION")}"
}
variable "vault_zip" {
type = string
default = "C:\\Users\\btkra\\Downloads\\vault_1.7.1_linux_amd64.zip"
}
variable "vpc_id" {
type = string
default = "vpc-06626bb552084b94b"
}
variable "subnet_id" {
type = string
default = "subnet-090200863e9701b57"
}
data "amazon-ami" "amazon-linux-2" {
filters = {
name = "amzn2-ami-hvm-2.*-x86_64-gp2"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["amazon"]
region = var.aws_region
}
source "amazon-ebs" "amazon-ebs-amazonlinux-2" {
ami_description = "Vault - Amazon Linux 2"
ami_name = "vault-amazonlinux2-vault-course"
ami_regions = ["us-east-1"]
ami_virtualization_type = "hvm"
associate_public_ip_address = true
force_delete_snapshot = true
force_deregister = true
instance_type = "m5.large"
region = var.aws_region
source_ami = data.amazon-ami.amazon-linux-2.id
spot_price = "0"
ssh_pty = true
ssh_timeout = "5m"
ssh_username = "ec2-user"
tags = {
Name = "HashiCorp Vault"
OS = "Amazon Linux 2"
}
subnet_id = var.subnet_id
vpc_id = var.vpc_id
}
build {
sources = ["source.amazon-ebs.amazon-ebs-amazonlinux-2"]
provisioner "file" {
destination = "/tmp/vault.zip"
source = var.vault_zip
}
provisioner "file" {
destination = "/tmp"
source = "files/"
}
}