Skip to content

Commit 6f03fd9

Browse files
committed
integration test fix
1 parent ad0dc82 commit 6f03fd9

File tree

12 files changed

+60
-34
lines changed

12 files changed

+60
-34
lines changed

build/int.cloudbuild.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,22 @@ steps:
163163
waitFor:
164164
- teardown internal-lb-http gce-mig
165165
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
166-
args: ['/bin/bash', '-c', 'cft test run TestAll/examples/backend-with-iap --stage init --verbose']
166+
args: ['/bin/bash', '-c', 'cft test run TestLbBackendServiceIap --stage init --verbose']
167167
- id: apply backend-with-iap
168168
waitFor:
169169
- init backend-with-iap
170170
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
171-
args: ['/bin/bash', '-c', 'cft test run TestAll/examples/backend-with-iap --stage apply --verbose']
171+
args: ['/bin/bash', '-c', 'cft test run TestLbBackendServiceIap --stage apply --verbose']
172172
- id: verify backend-with-iap
173173
waitFor:
174174
- apply backend-with-iap
175175
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
176-
args: ['/bin/bash', '-c', 'cft test run TestAll/examples/backend-with-iap --stage verify --verbose']
176+
args: ['/bin/bash', '-c', 'cft test run TestLbBackendServiceIap --stage verify --verbose']
177177
- id: teardown backend-with-iap
178178
waitFor:
179179
- verify backend-with-iap
180180
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
181-
args: ['/bin/bash', '-c', 'cft test run TestAll/examples/backend-with-iap --stage teardown --verbose']
181+
args: ['/bin/bash', '-c', 'cft test run TestLbBackendServiceIap --stage teardown --verbose']
182182
tags:
183183
- 'ci'
184184
- 'integration'

examples/backend-with-iap/outputs.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
output "load-balancer-ip" {
18-
value = module.lb-frontend.external_ip
17+
18+
output "project_id" {
19+
value = module.lb-backend-iap.project_id
20+
description = "Project ID of the service"
21+
}
22+
23+
output "service_name" {
24+
value = module.lb-backend-iap.service_name
25+
description = "Name of the created service"
1926
}

examples/lb-http-separate-frontend-and-backend/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ module "lb-http-backend" {
106106

107107
iap_config = {
108108
enable = false
109-
iap_members = []
110109
}
111110
}
112111

metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,13 @@ spec:
338338
roles:
339339
- level: Project
340340
roles:
341+
- roles/iam.serviceAccountAdmin
341342
- roles/storage.admin
342343
- roles/compute.admin
343344
- roles/run.admin
344345
- roles/iam.serviceAccountUser
345346
- roles/certificatemanager.owner
346347
- roles/vpcaccess.admin
347-
- roles/iam.serviceAccountAdmin
348348
services:
349349
- certificatemanager.googleapis.com
350350
- cloudresourcemanager.googleapis.com

modules/backend/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This module creates `google_compute_backend_service` resource and its dependenci
2222
| groups | The list of backend instance group which serves the traffic. | <pre>list(object({<br> group = string<br> description = optional(string)<br><br> balancing_mode = optional(string)<br> capacity_scaler = optional(number)<br> max_connections = optional(number)<br> max_connections_per_instance = optional(number)<br> max_connections_per_endpoint = optional(number)<br> max_rate = optional(number)<br> max_rate_per_instance = optional(number)<br> max_rate_per_endpoint = optional(number)<br> max_utilization = optional(number)<br> }))</pre> | `[]` | no |
2323
| health\_check | Input for creating HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. A health check must be specified unless the backend service uses an internet or serverless NEG as a backend. | <pre>object({<br> host = optional(string, null)<br> request_path = optional(string, null)<br> request = optional(string, null)<br> response = optional(string, null)<br> port = optional(number, null)<br> port_name = optional(string, null)<br> proxy_header = optional(string, null)<br> port_specification = optional(string, null)<br> protocol = optional(string, null)<br> check_interval_sec = optional(number, 5)<br> timeout_sec = optional(number, 5)<br> healthy_threshold = optional(number, 2)<br> unhealthy_threshold = optional(number, 2)<br> logging = optional(bool, false)<br> })</pre> | `null` | no |
2424
| host\_path\_mappings | The list of host/path for which traffic could be sent to the backend service | <pre>list(object({<br> host = string<br> path = string<br> }))</pre> | <pre>[<br> {<br> "host": "*",<br> "path": "/*"<br> }<br>]</pre> | no |
25-
| iap\_config | Settings for enabling Cloud Identity Aware Proxy and Users/SAs to be given IAP HttpResourceAccessor access to the service. | <pre>object({<br> enable = bool<br> oauth2_client_id = optional(string)<br> oauth2_client_secret = optional(string)<br> iap_members = list(string)<br> })</pre> | <pre>{<br> "enable": false,<br> "iap_members": []<br>}</pre> | no |
25+
| iap\_config | Settings for enabling Cloud Identity Aware Proxy and Users/SAs to be given IAP HttpResourceAccessor access to the service. | <pre>object({<br> enable = bool<br> oauth2_client_id = optional(string)<br> oauth2_client_secret = optional(string)<br> iap_members = optional(list(string))<br> })</pre> | <pre>{<br> "enable": false<br>}</pre> | no |
2626
| load\_balancing\_scheme | Load balancing scheme type (EXTERNAL for classic external load balancer, EXTERNAL\_MANAGED for Envoy-based load balancer, INTERNAL\_MANAGED for internal load balancer and INTERNAL\_SELF\_MANAGED for traffic director) | `string` | `"EXTERNAL_MANAGED"` | no |
2727
| locality\_lb\_policy | The load balancing algorithm used within the scope of the locality. | `string` | `null` | no |
2828
| log\_config | This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. | <pre>object({<br> enable = bool<br> sample_rate = number<br> })</pre> | <pre>{<br> "enable": true,<br> "sample_rate": 1<br>}</pre> | no |
@@ -44,5 +44,7 @@ This module creates `google_compute_backend_service` resource and its dependenci
4444
|------|-------------|
4545
| apphub\_service\_uri | Service URI in CAIS style to be used by Apphub. |
4646
| backend\_service\_info | Host, path and backend service mapping |
47+
| project\_id | Project ID of the service |
48+
| service\_name | Name of the created service |
4749

4850
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/backend/metadata.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,10 @@ spec:
197197
enable = bool
198198
oauth2_client_id = optional(string)
199199
oauth2_client_secret = optional(string)
200-
iap_members = list(string)
200+
iap_members = optional(list(string))
201201
})
202202
defaultValue:
203203
enable: false
204-
iap_members: []
205204
- name: cdn_policy
206205
description: Cloud CDN configuration for this BackendService.
207206
varType: |-
@@ -331,17 +330,21 @@ spec:
331330
- backend_service: string
332331
host: string
333332
path: string
333+
- name: project_id
334+
description: Project ID of the service
335+
- name: service_name
336+
description: Name of the created service
334337
requirements:
335338
roles:
336339
- level: Project
337340
roles:
341+
- roles/iam.serviceAccountUser
338342
- roles/iam.serviceAccountAdmin
339343
- roles/compute.admin
340344
- roles/storage.admin
341345
- roles/run.admin
342346
- roles/compute.networkAdmin
343347
- roles/iap.admin
344-
- roles/iam.serviceAccountUser
345348
services:
346349
- cloudresourcemanager.googleapis.com
347350
- compute.googleapis.com

modules/backend/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,13 @@ output "apphub_service_uri" {
4343
)
4444
description = "Service URI in CAIS style to be used by Apphub."
4545
}
46+
47+
output "project_id" {
48+
value = var.project_id
49+
description = "Project ID of the service"
50+
}
51+
52+
output "service_name" {
53+
value = var.name
54+
description = "Name of the created service"
55+
}

modules/backend/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ variable "iap_config" {
159159
enable = bool
160160
oauth2_client_id = optional(string)
161161
oauth2_client_secret = optional(string)
162-
iap_members = list(string)
162+
iap_members = optional(list(string))
163163
})
164-
default = { enable = false, iap_members = [] }
164+
default = { enable = false }
165165
}
166166

167167
variable "cdn_policy" {

modules/dynamic_backends/metadata.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,13 @@ spec:
330330
roles:
331331
- level: Project
332332
roles:
333+
- roles/certificatemanager.owner
334+
- roles/vpcaccess.admin
335+
- roles/iam.serviceAccountAdmin
333336
- roles/storage.admin
334337
- roles/compute.admin
335338
- roles/run.admin
336339
- roles/iam.serviceAccountUser
337-
- roles/certificatemanager.owner
338-
- roles/vpcaccess.admin
339-
- roles/iam.serviceAccountAdmin
340340
services:
341341
- certificatemanager.googleapis.com
342342
- cloudresourcemanager.googleapis.com

modules/frontend/metadata.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,11 @@ spec:
246246
roles:
247247
- level: Project
248248
roles:
249-
- roles/iam.serviceAccountUser
250-
- roles/compute.admin
251249
- roles/storage.admin
252250
- roles/iap.admin
253251
- roles/certificatemanager.owner
252+
- roles/iam.serviceAccountUser
253+
- roles/compute.admin
254254
services:
255255
- certificatemanager.googleapis.com
256256
- compute.googleapis.com

0 commit comments

Comments
 (0)