generated from appvia/terraform-aws-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendpoints.tf
53 lines (45 loc) · 1.98 KB
/
endpoints.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
53
## Provision an egress vpc if required
module "endpoints_vpc" {
count = local.enable_endpoints ? 1 : 0
source = "appvia/network/aws"
version = "0.3.4"
availability_zones = var.services.endpoints.network.availability_zones
enable_default_route_table_association = local.enable_default_route_table_association
enable_default_route_table_propagation = local.enable_default_route_table_propagation
enable_ipam = var.services.endpoints.network.ipam_pool_id != null
enable_transit_gateway = true
ipam_pool_id = var.services.endpoints.network.ipam_pool_id
name = var.services.endpoints.network.name
private_subnet_netmask = var.services.endpoints.network.private_netmask
tags = var.tags
transit_gateway_id = module.tgw.ec2_transit_gateway_id
vpc_cidr = var.services.endpoints.network.vpc_cidr
vpc_netmask = var.services.endpoints.network.vpc_netmask
}
## Provision if required the shared private endpoints
module "endpoints" {
count = local.enable_endpoints ? 1 : 0
source = "appvia/private-endpoints/aws"
version = "0.2.11"
name = var.services.endpoints.network.name
endpoints = var.services.endpoints.services
region = local.region
tags = var.tags
network = {
create = false
name = var.services.endpoints.network.name
private_subnet_cidr_by_id = module.endpoints_vpc[0].private_subnet_cidr_by_id
vpc_dns_resolver = cidrhost(module.endpoints_vpc[0].vpc_cidr, 2)
vpc_id = module.endpoints_vpc[0].vpc_id
}
resolvers = {
outbound = {
create = true
ip_address_offset = 10
}
}
sharing = {
principals = var.services.endpoints.sharing.principals
}
depends_on = [module.endpoints_vpc]
}