1414 * limitations under the License.
1515 */
1616
17+ locals {
18+ per_module_services = {
19+ root = [
20+ " cloudresourcemanager.googleapis.com" ,
21+ " storage-api.googleapis.com" ,
22+ " serviceusage.googleapis.com" ,
23+ " compute.googleapis.com" ,
24+ " run.googleapis.com" ,
25+ " iam.googleapis.com" ,
26+ " certificatemanager.googleapis.com" ,
27+ " vpcaccess.googleapis.com" ,
28+ ]
29+ backend = [
30+ " cloudresourcemanager.googleapis.com" ,
31+ " storage-api.googleapis.com" ,
32+ " serviceusage.googleapis.com" ,
33+ " compute.googleapis.com" ,
34+ " run.googleapis.com" ,
35+ " iam.googleapis.com" ,
36+ " certificatemanager.googleapis.com" ,
37+ " vpcaccess.googleapis.com" ,
38+ ]
39+ dynamic_backends = [
40+ " cloudresourcemanager.googleapis.com" ,
41+ " storage-api.googleapis.com" ,
42+ " serviceusage.googleapis.com" ,
43+ " compute.googleapis.com" ,
44+ " run.googleapis.com" ,
45+ " iam.googleapis.com" ,
46+ " certificatemanager.googleapis.com" ,
47+ " vpcaccess.googleapis.com" ,
48+ ]
49+ frontend = [
50+ " cloudresourcemanager.googleapis.com" ,
51+ " storage-api.googleapis.com" ,
52+ " serviceusage.googleapis.com" ,
53+ " compute.googleapis.com" ,
54+ " run.googleapis.com" ,
55+ " iam.googleapis.com" ,
56+ " certificatemanager.googleapis.com" ,
57+ " vpcaccess.googleapis.com" ,
58+ ]
59+ serverless_negs = [
60+ " cloudresourcemanager.googleapis.com" ,
61+ " storage-api.googleapis.com" ,
62+ " serviceusage.googleapis.com" ,
63+ " compute.googleapis.com" ,
64+ " run.googleapis.com" ,
65+ " iam.googleapis.com" ,
66+ " certificatemanager.googleapis.com" ,
67+ " vpcaccess.googleapis.com" ,
68+ ]
69+ }
70+ }
71+
1772module "project-ci-lb-http" {
1873 source = " terraform-google-modules/project-factory/google"
1974 version = " ~> 17.0"
@@ -28,16 +83,7 @@ module "project-ci-lb-http" {
2883 disable_services_on_destroy = false
2984 deletion_policy = " DELETE"
3085
31- activate_apis = [
32- " cloudresourcemanager.googleapis.com" ,
33- " storage-api.googleapis.com" ,
34- " serviceusage.googleapis.com" ,
35- " compute.googleapis.com" ,
36- " run.googleapis.com" ,
37- " iam.googleapis.com" ,
38- " certificatemanager.googleapis.com" ,
39- " vpcaccess.googleapis.com" ,
40- ]
86+ activate_apis = tolist (toset (flatten (values (local. per_module_services ))))
4187}
4288
4389module "project-ci-lb-http-1" {
@@ -54,14 +100,5 @@ module "project-ci-lb-http-1" {
54100 disable_services_on_destroy = false
55101 deletion_policy = " DELETE"
56102
57- activate_apis = [
58- " cloudresourcemanager.googleapis.com" ,
59- " storage-api.googleapis.com" ,
60- " serviceusage.googleapis.com" ,
61- " compute.googleapis.com" ,
62- " run.googleapis.com" ,
63- " iam.googleapis.com" ,
64- " certificatemanager.googleapis.com" ,
65- " vpcaccess.googleapis.com" ,
66- ]
103+ activate_apis = tolist (toset (flatten (values (local. per_module_services ))))
67104}
0 commit comments