-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
104 lines (76 loc) · 1.9 KB
/
main.tf
File metadata and controls
104 lines (76 loc) · 1.9 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.34"
}
}
required_version = ">= 0.14.9"
}
provider "aws" {
profile = var.aws_profile
region = var.aws_region
}
#1
module "customer_gateway" {
source = "./customer_gateway"
customer_ip_address = var.customer_public_ip
environment = var.environment
application_name = var.application_name
}
#2
module "vpn_gateway" {
source = "./vpn_gateway"
vpc_id = var.vpc_id
environment = var.environment
application_name = var.application_name
}
#3
module "route_table" {
source = "./route_table"
vpc_id = var.vpc_id
customer_subnet = var.cidr_customer_subnet
vpn_gateway_id = module.vpn_gateway.id
internet_gateway_id = var.internet_gateway_id
subnet_ids_on_vpn = var.subnet_ids_on_vpn
environment = var.environment
application_name = var.application_name
depends_on = [
module.vpn_gateway
]
}
#3
module "gateway_route_propagation" {
source = "./gateway_route_propagation"
route_table_id = module.route_table.id
vpn_gateway_id = module.vpn_gateway.id
environment = var.environment
application_name = var.application_name
depends_on = [
module.route_table,
module.vpn_gateway
]
}
#4
module "security_group" {
source = "./security_group"
name = "Allow all VPN"
vpc_id = var.vpc_id
subnets = [var.cidr_customer_subnet]
environment = var.environment
application_name = var.application_name
}
#Forse devo attaccare il security group alla vpc
#5
module "vpn_connection" {
source = "./vpn_connection"
vpn_gateway_id = module.vpn_gateway.id
customer_gateway_id = module.customer_gateway.id
customer_subnet = var.cidr_customer_subnet
environment = var.environment
application_name = var.application_name
depends_on = [
module.customer_gateway,
module.vpn_gateway
]
}