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+ " compute.googleapis.com" ,
31+ " run.googleapis.com" ,
32+ " storage-api.googleapis.com" ,
33+ " vpcaccess.googleapis.com" ,
34+ " cloudresourcemanager.googleapis.com" ,
35+ ]
36+ dynamic_backends = [
37+ " cloudresourcemanager.googleapis.com" ,
38+ " storage-api.googleapis.com" ,
39+ " serviceusage.googleapis.com" ,
40+ " compute.googleapis.com" ,
41+ " run.googleapis.com" ,
42+ " iam.googleapis.com" ,
43+ " certificatemanager.googleapis.com" ,
44+ " vpcaccess.googleapis.com" ,
45+ ]
46+ frontend = [
47+ " compute.googleapis.com" ,
48+ " storage-api.googleapis.com" ,
49+ " run.googleapis.com" ,
50+ " certificatemanager.googleapis.com" ,
51+ ]
52+ serverless_negs = [
53+ " cloudresourcemanager.googleapis.com" ,
54+ " storage-api.googleapis.com" ,
55+ " serviceusage.googleapis.com" ,
56+ " compute.googleapis.com" ,
57+ " run.googleapis.com" ,
58+ " iam.googleapis.com" ,
59+ " certificatemanager.googleapis.com" ,
60+ " vpcaccess.googleapis.com" ,
61+ ]
62+ }
63+ }
64+
1765module "project-ci-lb-http" {
1866 source = " terraform-google-modules/project-factory/google"
1967 version = " ~> 17.0"
@@ -28,16 +76,7 @@ module "project-ci-lb-http" {
2876 disable_services_on_destroy = false
2977 deletion_policy = " DELETE"
3078
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- ]
79+ activate_apis = tolist (toset (flatten (values (local. per_module_services ))))
4180}
4281
4382module "project-ci-lb-http-1" {
@@ -54,14 +93,5 @@ module "project-ci-lb-http-1" {
5493 disable_services_on_destroy = false
5594 deletion_policy = " DELETE"
5695
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- ]
96+ activate_apis = tolist (toset (flatten (values (local. per_module_services ))))
6797}
0 commit comments