@@ -59,7 +59,7 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
59
59
`${ entrypointPath . target } -neg` ,
60
60
{
61
61
networkEndpointType : 'INTERNET_FQDN_PORT' ,
62
- // defaultPort: 443,
62
+ defaultPort : 443 ,
63
63
} ,
64
64
defaultResourceOptions ,
65
65
) ;
@@ -78,9 +78,13 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
78
78
const backend = new gcp . compute . BackendService (
79
79
`${ entrypointPath . target } ` ,
80
80
{
81
+ // Default options for timeout and connection draining
82
+ // without these, receiving 502 error
83
+ timeoutSec : 10 ,
84
+ connectionDrainingTimeoutSec : 10 ,
81
85
// Link the NEG to the backend
82
86
backends : [ { group : apiGatewayNEG . id } ] ,
83
- customRequestHeaders : [ pulumi . interpolate `Host : ${ deployedApi . hostname } ` ] ,
87
+ customRequestHeaders : [ pulumi . interpolate `host : ${ deployedApi . hostname } ` ] ,
84
88
// TODO: Determine CDN requirements for API gateways
85
89
enableCdn : false ,
86
90
protocol : 'HTTPS' ,
@@ -90,6 +94,7 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
90
94
91
95
return {
92
96
name : entrypointPath . target ,
97
+ path : entrypointPath . path ,
93
98
backend,
94
99
} ;
95
100
}
@@ -103,7 +108,7 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
103
108
}
104
109
105
110
const backend = new gcp . compute . BackendBucket (
106
- `${ entrypointPath . target } ` ,
111
+ `${ entrypointPath . target } -bucket ` ,
107
112
{
108
113
bucketName : deployedSite . storage . name ,
109
114
// Enable CDN for sites
@@ -114,6 +119,7 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
114
119
115
120
return {
116
121
name : entrypointPath . target ,
122
+ path : entrypointPath . path ,
117
123
backend,
118
124
} ;
119
125
}
@@ -140,7 +146,7 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
140
146
) ;
141
147
142
148
const backend = new gcp . compute . BackendService (
143
- `${ entrypointPath . target } ` ,
149
+ `${ entrypointPath . target } - ${ entrypointPath . type } ` ,
144
150
{
145
151
// Link the NEG to the backend
146
152
backends : [ { group : serverlessNEG . id } ] ,
@@ -153,6 +159,7 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
153
159
154
160
return {
155
161
name : entrypointPath . target ,
162
+ path : entrypointPath . path ,
156
163
backend,
157
164
} ;
158
165
}
@@ -178,7 +185,7 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
178
185
const pathRules =
179
186
otherEntrypoints . length > 0
180
187
? otherEntrypoints . map ( ( ep ) => {
181
- const backend = backends . find ( ( b ) => b . name === ep . target ) ! . backend ;
188
+ const backend = backends . find ( ( b ) => b . name === ep . target && b . path == ep . path ) ! . backend ;
182
189
pulumi . log . info ( `other backend: ${ ep . target } ` , backend ) ;
183
190
return {
184
191
paths : [ `${ ep . path } *` ] ,
@@ -268,7 +275,7 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
268
275
defaultResourceOptions ,
269
276
) ;
270
277
271
- this . url = pulumi . interpolate `https://${ ipAddress } ` ;
278
+ this . url = pulumi . interpolate `https://${ ipAddress . address } ` ;
272
279
}
273
280
274
281
pulumi . log . info ( 'Connecting URL map to HTTP proxy' , urlMap ) ;
@@ -296,10 +303,10 @@ export class NitricEntrypointGoogleCloudLB extends pulumi.ComponentResource {
296
303
defaultResourceOptions ,
297
304
) ;
298
305
299
- ( this . ipAddress = forwardingRule . ipAddress ) ,
300
- this . registerOutputs ( {
301
- url : this . url ,
302
- ipAddress : this . ipAddress ,
303
- } ) ;
306
+ this . ipAddress = forwardingRule . ipAddress ;
307
+ this . registerOutputs ( {
308
+ url : this . url ,
309
+ ipAddress : this . ipAddress ,
310
+ } ) ;
304
311
}
305
312
}
0 commit comments