-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmain.tf
62 lines (59 loc) · 1.77 KB
/
main.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
54
55
56
57
58
59
60
61
62
##############################################################################
# Resource Group
##############################################################################
module "resource_group" {
source = "terraform-ibm-modules/resource-group/ibm"
version = "1.1.6"
# if an existing resource group is not set (null) create a new one using prefix
resource_group_name = var.resource_group == null ? "${var.prefix}-resource-group" : null
existing_resource_group_name = var.resource_group
}
#############################################################################
# Provision VPC
#############################################################################
module "slz_vpc" {
source = "../../"
resource_group_id = module.resource_group.resource_group_id
region = var.region
name = var.name
prefix = var.prefix
tags = var.resource_tags
subnets = {
zone-1 = []
zone-2 = [
{
name = "subnet-a"
cidr = "10.10.10.0/24"
public_gateway = true
acl_name = "${var.prefix}-acl"
}
]
}
use_public_gateways = {
zone-1 = false
zone-2 = true
zone-3 = false
}
network_acls = [{
name = "${var.prefix}-acl"
add_ibm_cloud_internal_rules = false
add_vpc_connectivity_rules = false
prepend_ibm_rules = false
rules = [{
name = "inbound"
action = "allow"
source = "0.0.0.0/0"
destination = "0.0.0.0/0"
direction = "inbound"
},
{
name = "outbound"
action = "allow"
source = "0.0.0.0/0"
destination = "0.0.0.0/0"
direction = "outbound"
}
]
}
]
}