-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathec2-perm.tf
52 lines (42 loc) · 1.14 KB
/
ec2-perm.tf
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
###
# create your own AMI as described here:
# https://gitlab.com/prunux/perm/blob/master/INSTALL
#
# or ask [email protected] for getting permission of this
# manufactored AMI on AWS eu-west-1
###
data "aws_ami" "ubuntu_bionic_perm_gedafe" {
most_recent = true
filter {
name = "name"
values = ["ubuntu-18.04-perm-gedafe-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["011681443068"] #
}
module "ec2_perm" {
source = "terraform-aws-modules/ec2-instance/aws"
name = "perm"
instance_count = 1
ami = "${data.aws_ami.ubuntu_bionic_perm_gedafe.id}"
instance_type = "t2.micro"
key_name = "perm-ssh-key"
vpc_security_group_ids = [
"${module.vpc.default_security_group_id}",
"${module.web_server_sg.this_security_group_id}",
]
subnet_id = "${module.vpc.public_subnets[0]}"
associate_public_ip_address = true
ipv6_address_count = 1
user_data = "${file("ec2-perm-user-data.sh")}"
tags = {
Terraform = "true"
Environment = "prnx-perm"
}
}
output "ec2_perm_instance" {
value = "${module.ec2_perm.public_dns}"
}