generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
147 lines (142 loc) · 3.62 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
##############################################################################
# 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
}
##############################################################################
# Create a VPC for this example using defaults from terraform-ibm-landing-zone-vpc
# ( 3 subnets across the 3 AZs in the region )
##############################################################################
module "vpc" {
source = "terraform-ibm-modules/landing-zone-vpc/ibm"
version = "7.19.1"
resource_group_id = module.resource_group.resource_group_id
region = var.region
prefix = var.prefix
name = "vpc"
tags = var.resource_tags
}
##############################################################################
# Create every multi-tenant VPEs in the VPC
# NOTE: forcing a shorter VPE name for some services due to length limitations
# on VPE service side
##############################################################################
module "vpes" {
source = "../../"
region = var.region
prefix = var.prefix
vpc_name = module.vpc.vpc_name
vpc_id = module.vpc.vpc_id
subnet_zone_list = module.vpc.subnet_zone_list
resource_group_id = module.resource_group.resource_group_id
cloud_services = [
{
service_name = "account-management"
},
{
service_name = "billing"
},
{
service_name = "cloud-object-storage"
vpe_name = "${var.prefix}-cos"
},
{
service_name = "cloud-object-storage-config"
vpe_name = "${var.prefix}-cos-config"
},
{
service_name = "codeengine"
},
{
service_name = "container-registry"
},
{
service_name = "containers-kubernetes"
vpe_name = "${var.prefix}-kubernetes"
},
{
service_name = "context-based-restrictions"
vpe_name = "${var.prefix}-cbr"
},
{
service_name = "directlink"
},
{
service_name = "dns-svcs"
},
{
service_name = "enterprise"
},
{
service_name = "global-search"
vpe_name = "${var.prefix}-search"
},
{
service_name = "global-tagging"
vpe_name = "${var.prefix}-tagging"
},
{
service_name = "globalcatalog"
},
{
service_name = "hs-crypto"
},
{
service_name = "hs-crypto-cert-mgr"
},
{
service_name = "hs-crypto-ep11"
},
{
service_name = "hs-crypto-ep11-az1"
},
{
service_name = "hs-crypto-ep11-az2"
},
{
service_name = "hs-crypto-ep11-az3"
},
{
service_name = "hs-crypto-kmip"
},
{
service_name = "hs-crypto-tke"
},
{
service_name = "iam-svcs"
},
{
service_name = "is"
},
{
service_name = "kms"
},
{
service_name = "messaging"
},
{
service_name = "resource-controller"
},
{
service_name = "support-center"
},
{
service_name = "transit"
},
{
service_name = "user-management"
},
{
service_name = "vmware"
},
{
service_name = "ntp"
}
]
}
##############################################################################