/
zz_function_types.go
executable file
·650 lines (472 loc) · 39.9 KB
/
zz_function_types.go
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
// SPDX-FileCopyrightText: 2024 The Crossplane Authors <https://crossplane.io>
//
// SPDX-License-Identifier: Apache-2.0
// Code generated by upjet. DO NOT EDIT.
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
v1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
)
type EventTriggerInitParameters struct {
// The type of event to observe. For example: "google.storage.object.finalize".
// See the documentation on calling Cloud Functions for a
// full reference of accepted triggers.
EventType *string `json:"eventType,omitempty" tf:"event_type,omitempty"`
// Specifies policy for failed executions. Structure is documented below.
FailurePolicy []FailurePolicyInitParameters `json:"failurePolicy,omitempty" tf:"failure_policy,omitempty"`
// Required. The name or partial URI of the resource from
// which to observe events. For example, "myBucket" or "projects/my-project/topics/my-topic"
Resource *string `json:"resource,omitempty" tf:"resource,omitempty"`
}
type EventTriggerObservation struct {
// The type of event to observe. For example: "google.storage.object.finalize".
// See the documentation on calling Cloud Functions for a
// full reference of accepted triggers.
EventType *string `json:"eventType,omitempty" tf:"event_type,omitempty"`
// Specifies policy for failed executions. Structure is documented below.
FailurePolicy []FailurePolicyObservation `json:"failurePolicy,omitempty" tf:"failure_policy,omitempty"`
// Required. The name or partial URI of the resource from
// which to observe events. For example, "myBucket" or "projects/my-project/topics/my-topic"
Resource *string `json:"resource,omitempty" tf:"resource,omitempty"`
}
type EventTriggerParameters struct {
// The type of event to observe. For example: "google.storage.object.finalize".
// See the documentation on calling Cloud Functions for a
// full reference of accepted triggers.
// +kubebuilder:validation:Optional
EventType *string `json:"eventType" tf:"event_type,omitempty"`
// Specifies policy for failed executions. Structure is documented below.
// +kubebuilder:validation:Optional
FailurePolicy []FailurePolicyParameters `json:"failurePolicy,omitempty" tf:"failure_policy,omitempty"`
// Required. The name or partial URI of the resource from
// which to observe events. For example, "myBucket" or "projects/my-project/topics/my-topic"
// +kubebuilder:validation:Optional
Resource *string `json:"resource" tf:"resource,omitempty"`
}
type FailurePolicyInitParameters struct {
// Whether the function should be retried on failure. Defaults to false.
Retry *bool `json:"retry,omitempty" tf:"retry,omitempty"`
}
type FailurePolicyObservation struct {
// Whether the function should be retried on failure. Defaults to false.
Retry *bool `json:"retry,omitempty" tf:"retry,omitempty"`
}
type FailurePolicyParameters struct {
// Whether the function should be retried on failure. Defaults to false.
// +kubebuilder:validation:Optional
Retry *bool `json:"retry" tf:"retry,omitempty"`
}
type FunctionInitParameters struct {
// Memory (in MB), available to the function. Default value is 256. Possible values include 128, 256, 512, 1024, etc.
AvailableMemoryMb *float64 `json:"availableMemoryMb,omitempty" tf:"available_memory_mb,omitempty"`
// A set of key/value environment variable pairs available during build time.
BuildEnvironmentVariables map[string]string `json:"buildEnvironmentVariables,omitempty" tf:"build_environment_variables,omitempty"`
// Name of the Cloud Build Custom Worker Pool that should be used to build the function.
BuildWorkerPool *string `json:"buildWorkerPool,omitempty" tf:"build_worker_pool,omitempty"`
// Description of the function.
Description *string `json:"description,omitempty" tf:"description,omitempty"`
// Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER_REGISTRY (default) and ARTIFACT_REGISTRY.
DockerRegistry *string `json:"dockerRegistry,omitempty" tf:"docker_registry,omitempty"`
// User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, Container Registry will be used by default, unless specified otherwise by other means.
DockerRepository *string `json:"dockerRepository,omitempty" tf:"docker_repository,omitempty"`
// Name of the function that will be executed when the Google Cloud Function is triggered.
EntryPoint *string `json:"entryPoint,omitempty" tf:"entry_point,omitempty"`
// A set of key/value environment variable pairs to assign to the function.
EnvironmentVariables map[string]string `json:"environmentVariables,omitempty" tf:"environment_variables,omitempty"`
// A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with trigger_http.
EventTrigger []EventTriggerInitParameters `json:"eventTrigger,omitempty" tf:"event_trigger,omitempty"`
// The security level for the function. The following options are available:
HTTPSTriggerSecurityLevel *string `json:"httpsTriggerSecurityLevel,omitempty" tf:"https_trigger_security_level,omitempty"`
// URL which triggers function execution. Returned only if trigger_http is used.
HTTPSTriggerURL *string `json:"httpsTriggerUrl,omitempty" tf:"https_trigger_url,omitempty"`
// String value that controls what traffic can reach the function. Allowed values are ALLOW_ALL, ALLOW_INTERNAL_AND_GCLB and ALLOW_INTERNAL_ONLY. Check ingress documentation to see the impact of each settings value. Changes to this field will recreate the cloud function.
IngressSettings *string `json:"ingressSettings,omitempty" tf:"ingress_settings,omitempty"`
// Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
// If specified, you must also provide an artifact registry repository using the docker_repository field that was created with the same KMS crypto key. Before deploying, please complete all pre-requisites described in https://cloud.google.com/functions/docs/securing/cmek#granting_service_accounts_access_to_the_key
KMSKeyName *string `json:"kmsKeyName,omitempty" tf:"kms_key_name,omitempty"`
// A set of key/value label pairs to assign to the function. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements.
Labels map[string]string `json:"labels,omitempty" tf:"labels,omitempty"`
// The limit on the maximum number of function instances that may coexist at a given time.
MaxInstances *float64 `json:"maxInstances,omitempty" tf:"max_instances,omitempty"`
// The limit on the minimum number of function instances that may coexist at a given time.
MinInstances *float64 `json:"minInstances,omitempty" tf:"min_instances,omitempty"`
// Project of the function. If it is not provided, the provider project is used.
Project *string `json:"project,omitempty" tf:"project,omitempty"`
// The runtime in which the function is going to run.
// Eg. "nodejs16", "python39", "dotnet3", "go116", "java11", "ruby30", "php74", etc. Check the official doc for the up-to-date list.
Runtime *string `json:"runtime,omitempty" tf:"runtime,omitempty"`
// Secret environment variables configuration. Structure is documented below.
SecretEnvironmentVariables []SecretEnvironmentVariablesInitParameters `json:"secretEnvironmentVariables,omitempty" tf:"secret_environment_variables,omitempty"`
// Secret volumes configuration. Structure is documented below.
SecretVolumes []SecretVolumesInitParameters `json:"secretVolumes,omitempty" tf:"secret_volumes,omitempty"`
// If provided, the self-provided service account to run the function with.
ServiceAccountEmail *string `json:"serviceAccountEmail,omitempty" tf:"service_account_email,omitempty"`
// The GCS bucket containing the zip archive which contains the function.
// +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/storage/v1beta1.Bucket
SourceArchiveBucket *string `json:"sourceArchiveBucket,omitempty" tf:"source_archive_bucket,omitempty"`
// Reference to a Bucket in storage to populate sourceArchiveBucket.
// +kubebuilder:validation:Optional
SourceArchiveBucketRef *v1.Reference `json:"sourceArchiveBucketRef,omitempty" tf:"-"`
// Selector for a Bucket in storage to populate sourceArchiveBucket.
// +kubebuilder:validation:Optional
SourceArchiveBucketSelector *v1.Selector `json:"sourceArchiveBucketSelector,omitempty" tf:"-"`
// The source archive object (file) in archive bucket.
// +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/storage/v1beta1.BucketObject
// +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("name",false)
SourceArchiveObject *string `json:"sourceArchiveObject,omitempty" tf:"source_archive_object,omitempty"`
// Reference to a BucketObject in storage to populate sourceArchiveObject.
// +kubebuilder:validation:Optional
SourceArchiveObjectRef *v1.Reference `json:"sourceArchiveObjectRef,omitempty" tf:"-"`
// Selector for a BucketObject in storage to populate sourceArchiveObject.
// +kubebuilder:validation:Optional
SourceArchiveObjectSelector *v1.Selector `json:"sourceArchiveObjectSelector,omitempty" tf:"-"`
// Represents parameters related to source repository where a function is hosted.
// Cannot be set alongside source_archive_bucket or source_archive_object. Structure is documented below. It must match the pattern projects/{project}/locations/{location}/repositories/{repository}.*
SourceRepository []SourceRepositoryInitParameters `json:"sourceRepository,omitempty" tf:"source_repository,omitempty"`
// Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.
Timeout *float64 `json:"timeout,omitempty" tf:"timeout,omitempty"`
// Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as https_trigger_url. Cannot be used with event_trigger.
TriggerHTTP *bool `json:"triggerHttp,omitempty" tf:"trigger_http,omitempty"`
// The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is projects/*/locations/*/connectors/*.
VPCConnector *string `json:"vpcConnector,omitempty" tf:"vpc_connector,omitempty"`
// The egress settings for the connector, controlling what traffic is diverted through it. Allowed values are ALL_TRAFFIC and PRIVATE_RANGES_ONLY. Defaults to PRIVATE_RANGES_ONLY. If unset, this field preserves the previously set value.
VPCConnectorEgressSettings *string `json:"vpcConnectorEgressSettings,omitempty" tf:"vpc_connector_egress_settings,omitempty"`
}
type FunctionObservation struct {
// Memory (in MB), available to the function. Default value is 256. Possible values include 128, 256, 512, 1024, etc.
AvailableMemoryMb *float64 `json:"availableMemoryMb,omitempty" tf:"available_memory_mb,omitempty"`
// A set of key/value environment variable pairs available during build time.
BuildEnvironmentVariables map[string]string `json:"buildEnvironmentVariables,omitempty" tf:"build_environment_variables,omitempty"`
// Name of the Cloud Build Custom Worker Pool that should be used to build the function.
BuildWorkerPool *string `json:"buildWorkerPool,omitempty" tf:"build_worker_pool,omitempty"`
// Description of the function.
Description *string `json:"description,omitempty" tf:"description,omitempty"`
// Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER_REGISTRY (default) and ARTIFACT_REGISTRY.
DockerRegistry *string `json:"dockerRegistry,omitempty" tf:"docker_registry,omitempty"`
// User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, Container Registry will be used by default, unless specified otherwise by other means.
DockerRepository *string `json:"dockerRepository,omitempty" tf:"docker_repository,omitempty"`
// +mapType=granular
EffectiveLabels map[string]*string `json:"effectiveLabels,omitempty" tf:"effective_labels,omitempty"`
// Name of the function that will be executed when the Google Cloud Function is triggered.
EntryPoint *string `json:"entryPoint,omitempty" tf:"entry_point,omitempty"`
// A set of key/value environment variable pairs to assign to the function.
EnvironmentVariables map[string]string `json:"environmentVariables,omitempty" tf:"environment_variables,omitempty"`
// A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with trigger_http.
EventTrigger []EventTriggerObservation `json:"eventTrigger,omitempty" tf:"event_trigger,omitempty"`
// The security level for the function. The following options are available:
HTTPSTriggerSecurityLevel *string `json:"httpsTriggerSecurityLevel,omitempty" tf:"https_trigger_security_level,omitempty"`
// URL which triggers function execution. Returned only if trigger_http is used.
HTTPSTriggerURL *string `json:"httpsTriggerUrl,omitempty" tf:"https_trigger_url,omitempty"`
// an identifier for the resource with format {{name}}
ID *string `json:"id,omitempty" tf:"id,omitempty"`
// String value that controls what traffic can reach the function. Allowed values are ALLOW_ALL, ALLOW_INTERNAL_AND_GCLB and ALLOW_INTERNAL_ONLY. Check ingress documentation to see the impact of each settings value. Changes to this field will recreate the cloud function.
IngressSettings *string `json:"ingressSettings,omitempty" tf:"ingress_settings,omitempty"`
// Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
// If specified, you must also provide an artifact registry repository using the docker_repository field that was created with the same KMS crypto key. Before deploying, please complete all pre-requisites described in https://cloud.google.com/functions/docs/securing/cmek#granting_service_accounts_access_to_the_key
KMSKeyName *string `json:"kmsKeyName,omitempty" tf:"kms_key_name,omitempty"`
// A set of key/value label pairs to assign to the function. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements.
Labels map[string]string `json:"labels,omitempty" tf:"labels,omitempty"`
// The limit on the maximum number of function instances that may coexist at a given time.
MaxInstances *float64 `json:"maxInstances,omitempty" tf:"max_instances,omitempty"`
// The limit on the minimum number of function instances that may coexist at a given time.
MinInstances *float64 `json:"minInstances,omitempty" tf:"min_instances,omitempty"`
// Project of the function. If it is not provided, the provider project is used.
Project *string `json:"project,omitempty" tf:"project,omitempty"`
// Region of function. If it is not provided, the provider region is used.
Region *string `json:"region,omitempty" tf:"region,omitempty"`
// The runtime in which the function is going to run.
// Eg. "nodejs16", "python39", "dotnet3", "go116", "java11", "ruby30", "php74", etc. Check the official doc for the up-to-date list.
Runtime *string `json:"runtime,omitempty" tf:"runtime,omitempty"`
// Secret environment variables configuration. Structure is documented below.
SecretEnvironmentVariables []SecretEnvironmentVariablesObservation `json:"secretEnvironmentVariables,omitempty" tf:"secret_environment_variables,omitempty"`
// Secret volumes configuration. Structure is documented below.
SecretVolumes []SecretVolumesObservation `json:"secretVolumes,omitempty" tf:"secret_volumes,omitempty"`
// If provided, the self-provided service account to run the function with.
ServiceAccountEmail *string `json:"serviceAccountEmail,omitempty" tf:"service_account_email,omitempty"`
// The GCS bucket containing the zip archive which contains the function.
SourceArchiveBucket *string `json:"sourceArchiveBucket,omitempty" tf:"source_archive_bucket,omitempty"`
// The source archive object (file) in archive bucket.
SourceArchiveObject *string `json:"sourceArchiveObject,omitempty" tf:"source_archive_object,omitempty"`
// Represents parameters related to source repository where a function is hosted.
// Cannot be set alongside source_archive_bucket or source_archive_object. Structure is documented below. It must match the pattern projects/{project}/locations/{location}/repositories/{repository}.*
SourceRepository []SourceRepositoryObservation `json:"sourceRepository,omitempty" tf:"source_repository,omitempty"`
Status *string `json:"status,omitempty" tf:"status,omitempty"`
// The combination of labels configured directly on the resource and default labels configured on the provider.
// +mapType=granular
TerraformLabels map[string]*string `json:"terraformLabels,omitempty" tf:"terraform_labels,omitempty"`
// Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.
Timeout *float64 `json:"timeout,omitempty" tf:"timeout,omitempty"`
// Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as https_trigger_url. Cannot be used with event_trigger.
TriggerHTTP *bool `json:"triggerHttp,omitempty" tf:"trigger_http,omitempty"`
// The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is projects/*/locations/*/connectors/*.
VPCConnector *string `json:"vpcConnector,omitempty" tf:"vpc_connector,omitempty"`
// The egress settings for the connector, controlling what traffic is diverted through it. Allowed values are ALL_TRAFFIC and PRIVATE_RANGES_ONLY. Defaults to PRIVATE_RANGES_ONLY. If unset, this field preserves the previously set value.
VPCConnectorEgressSettings *string `json:"vpcConnectorEgressSettings,omitempty" tf:"vpc_connector_egress_settings,omitempty"`
// an identifier for the resource with format {{name}}
VersionID *string `json:"versionId,omitempty" tf:"version_id,omitempty"`
}
type FunctionParameters struct {
// Memory (in MB), available to the function. Default value is 256. Possible values include 128, 256, 512, 1024, etc.
// +kubebuilder:validation:Optional
AvailableMemoryMb *float64 `json:"availableMemoryMb,omitempty" tf:"available_memory_mb,omitempty"`
// A set of key/value environment variable pairs available during build time.
// +kubebuilder:validation:Optional
BuildEnvironmentVariables map[string]string `json:"buildEnvironmentVariables,omitempty" tf:"build_environment_variables,omitempty"`
// Name of the Cloud Build Custom Worker Pool that should be used to build the function.
// +kubebuilder:validation:Optional
BuildWorkerPool *string `json:"buildWorkerPool,omitempty" tf:"build_worker_pool,omitempty"`
// Description of the function.
// +kubebuilder:validation:Optional
Description *string `json:"description,omitempty" tf:"description,omitempty"`
// Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER_REGISTRY (default) and ARTIFACT_REGISTRY.
// +kubebuilder:validation:Optional
DockerRegistry *string `json:"dockerRegistry,omitempty" tf:"docker_registry,omitempty"`
// User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, Container Registry will be used by default, unless specified otherwise by other means.
// +kubebuilder:validation:Optional
DockerRepository *string `json:"dockerRepository,omitempty" tf:"docker_repository,omitempty"`
// Name of the function that will be executed when the Google Cloud Function is triggered.
// +kubebuilder:validation:Optional
EntryPoint *string `json:"entryPoint,omitempty" tf:"entry_point,omitempty"`
// A set of key/value environment variable pairs to assign to the function.
// +kubebuilder:validation:Optional
EnvironmentVariables map[string]string `json:"environmentVariables,omitempty" tf:"environment_variables,omitempty"`
// A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with trigger_http.
// +kubebuilder:validation:Optional
EventTrigger []EventTriggerParameters `json:"eventTrigger,omitempty" tf:"event_trigger,omitempty"`
// The security level for the function. The following options are available:
// +kubebuilder:validation:Optional
HTTPSTriggerSecurityLevel *string `json:"httpsTriggerSecurityLevel,omitempty" tf:"https_trigger_security_level,omitempty"`
// URL which triggers function execution. Returned only if trigger_http is used.
// +kubebuilder:validation:Optional
HTTPSTriggerURL *string `json:"httpsTriggerUrl,omitempty" tf:"https_trigger_url,omitempty"`
// String value that controls what traffic can reach the function. Allowed values are ALLOW_ALL, ALLOW_INTERNAL_AND_GCLB and ALLOW_INTERNAL_ONLY. Check ingress documentation to see the impact of each settings value. Changes to this field will recreate the cloud function.
// +kubebuilder:validation:Optional
IngressSettings *string `json:"ingressSettings,omitempty" tf:"ingress_settings,omitempty"`
// Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
// If specified, you must also provide an artifact registry repository using the docker_repository field that was created with the same KMS crypto key. Before deploying, please complete all pre-requisites described in https://cloud.google.com/functions/docs/securing/cmek#granting_service_accounts_access_to_the_key
// +kubebuilder:validation:Optional
KMSKeyName *string `json:"kmsKeyName,omitempty" tf:"kms_key_name,omitempty"`
// A set of key/value label pairs to assign to the function. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements.
// +kubebuilder:validation:Optional
Labels map[string]string `json:"labels,omitempty" tf:"labels,omitempty"`
// The limit on the maximum number of function instances that may coexist at a given time.
// +kubebuilder:validation:Optional
MaxInstances *float64 `json:"maxInstances,omitempty" tf:"max_instances,omitempty"`
// The limit on the minimum number of function instances that may coexist at a given time.
// +kubebuilder:validation:Optional
MinInstances *float64 `json:"minInstances,omitempty" tf:"min_instances,omitempty"`
// Project of the function. If it is not provided, the provider project is used.
// +kubebuilder:validation:Optional
Project *string `json:"project,omitempty" tf:"project,omitempty"`
// Region of function. If it is not provided, the provider region is used.
// +kubebuilder:validation:Required
Region *string `json:"region" tf:"region,omitempty"`
// The runtime in which the function is going to run.
// Eg. "nodejs16", "python39", "dotnet3", "go116", "java11", "ruby30", "php74", etc. Check the official doc for the up-to-date list.
// +kubebuilder:validation:Optional
Runtime *string `json:"runtime,omitempty" tf:"runtime,omitempty"`
// Secret environment variables configuration. Structure is documented below.
// +kubebuilder:validation:Optional
SecretEnvironmentVariables []SecretEnvironmentVariablesParameters `json:"secretEnvironmentVariables,omitempty" tf:"secret_environment_variables,omitempty"`
// Secret volumes configuration. Structure is documented below.
// +kubebuilder:validation:Optional
SecretVolumes []SecretVolumesParameters `json:"secretVolumes,omitempty" tf:"secret_volumes,omitempty"`
// If provided, the self-provided service account to run the function with.
// +kubebuilder:validation:Optional
ServiceAccountEmail *string `json:"serviceAccountEmail,omitempty" tf:"service_account_email,omitempty"`
// The GCS bucket containing the zip archive which contains the function.
// +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/storage/v1beta1.Bucket
// +kubebuilder:validation:Optional
SourceArchiveBucket *string `json:"sourceArchiveBucket,omitempty" tf:"source_archive_bucket,omitempty"`
// Reference to a Bucket in storage to populate sourceArchiveBucket.
// +kubebuilder:validation:Optional
SourceArchiveBucketRef *v1.Reference `json:"sourceArchiveBucketRef,omitempty" tf:"-"`
// Selector for a Bucket in storage to populate sourceArchiveBucket.
// +kubebuilder:validation:Optional
SourceArchiveBucketSelector *v1.Selector `json:"sourceArchiveBucketSelector,omitempty" tf:"-"`
// The source archive object (file) in archive bucket.
// +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/storage/v1beta1.BucketObject
// +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("name",false)
// +kubebuilder:validation:Optional
SourceArchiveObject *string `json:"sourceArchiveObject,omitempty" tf:"source_archive_object,omitempty"`
// Reference to a BucketObject in storage to populate sourceArchiveObject.
// +kubebuilder:validation:Optional
SourceArchiveObjectRef *v1.Reference `json:"sourceArchiveObjectRef,omitempty" tf:"-"`
// Selector for a BucketObject in storage to populate sourceArchiveObject.
// +kubebuilder:validation:Optional
SourceArchiveObjectSelector *v1.Selector `json:"sourceArchiveObjectSelector,omitempty" tf:"-"`
// Represents parameters related to source repository where a function is hosted.
// Cannot be set alongside source_archive_bucket or source_archive_object. Structure is documented below. It must match the pattern projects/{project}/locations/{location}/repositories/{repository}.*
// +kubebuilder:validation:Optional
SourceRepository []SourceRepositoryParameters `json:"sourceRepository,omitempty" tf:"source_repository,omitempty"`
// Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.
// +kubebuilder:validation:Optional
Timeout *float64 `json:"timeout,omitempty" tf:"timeout,omitempty"`
// Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as https_trigger_url. Cannot be used with event_trigger.
// +kubebuilder:validation:Optional
TriggerHTTP *bool `json:"triggerHttp,omitempty" tf:"trigger_http,omitempty"`
// The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is projects/*/locations/*/connectors/*.
// +kubebuilder:validation:Optional
VPCConnector *string `json:"vpcConnector,omitempty" tf:"vpc_connector,omitempty"`
// The egress settings for the connector, controlling what traffic is diverted through it. Allowed values are ALL_TRAFFIC and PRIVATE_RANGES_ONLY. Defaults to PRIVATE_RANGES_ONLY. If unset, this field preserves the previously set value.
// +kubebuilder:validation:Optional
VPCConnectorEgressSettings *string `json:"vpcConnectorEgressSettings,omitempty" tf:"vpc_connector_egress_settings,omitempty"`
}
type SecretEnvironmentVariablesInitParameters struct {
// Name of the environment variable.
Key *string `json:"key,omitempty" tf:"key,omitempty"`
// Project identifier (due to a known limitation, only project number is supported by this field) of the project that contains the secret. If not set, it will be populated with the function's project, assuming that the secret exists in the same project as of the function.
ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"`
// ID of the secret in secret manager (not the full resource name).
Secret *string `json:"secret,omitempty" tf:"secret,omitempty"`
// Version of the secret (version number or the string "latest"). It is recommended to use a numeric version for secret environment variables as any updates to the secret value is not reflected until new clones start.
Version *string `json:"version,omitempty" tf:"version,omitempty"`
}
type SecretEnvironmentVariablesObservation struct {
// Name of the environment variable.
Key *string `json:"key,omitempty" tf:"key,omitempty"`
// Project identifier (due to a known limitation, only project number is supported by this field) of the project that contains the secret. If not set, it will be populated with the function's project, assuming that the secret exists in the same project as of the function.
ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"`
// ID of the secret in secret manager (not the full resource name).
Secret *string `json:"secret,omitempty" tf:"secret,omitempty"`
// Version of the secret (version number or the string "latest"). It is recommended to use a numeric version for secret environment variables as any updates to the secret value is not reflected until new clones start.
Version *string `json:"version,omitempty" tf:"version,omitempty"`
}
type SecretEnvironmentVariablesParameters struct {
// Name of the environment variable.
// +kubebuilder:validation:Optional
Key *string `json:"key" tf:"key,omitempty"`
// Project identifier (due to a known limitation, only project number is supported by this field) of the project that contains the secret. If not set, it will be populated with the function's project, assuming that the secret exists in the same project as of the function.
// +kubebuilder:validation:Optional
ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"`
// ID of the secret in secret manager (not the full resource name).
// +kubebuilder:validation:Optional
Secret *string `json:"secret" tf:"secret,omitempty"`
// Version of the secret (version number or the string "latest"). It is recommended to use a numeric version for secret environment variables as any updates to the secret value is not reflected until new clones start.
// +kubebuilder:validation:Optional
Version *string `json:"version" tf:"version,omitempty"`
}
type SecretVolumesInitParameters struct {
// The path within the container to mount the secret volume. For example, setting the mount_path as "/etc/secrets" would mount the secret value files under the "/etc/secrets" directory. This directory will also be completely shadowed and unavailable to mount any other secrets. Recommended mount paths: "/etc/secrets" Restricted mount paths: "/cloudsql", "/dev/log", "/pod", "/proc", "/var/log".
MountPath *string `json:"mountPath,omitempty" tf:"mount_path,omitempty"`
// Project identifier (due to a known limitation, only project number is supported by this field) of the project that contains the secret. If not set, it will be populated with the function's project, assuming that the secret exists in the same project as of the function.
ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"`
// ID of the secret in secret manager (not the full resource name).
Secret *string `json:"secret,omitempty" tf:"secret,omitempty"`
// List of secret versions to mount for this secret. If empty, the "latest" version of the secret will be made available in a file named after the secret under the mount point. Structure is documented below.
Versions []VersionsInitParameters `json:"versions,omitempty" tf:"versions,omitempty"`
}
type SecretVolumesObservation struct {
// The path within the container to mount the secret volume. For example, setting the mount_path as "/etc/secrets" would mount the secret value files under the "/etc/secrets" directory. This directory will also be completely shadowed and unavailable to mount any other secrets. Recommended mount paths: "/etc/secrets" Restricted mount paths: "/cloudsql", "/dev/log", "/pod", "/proc", "/var/log".
MountPath *string `json:"mountPath,omitempty" tf:"mount_path,omitempty"`
// Project identifier (due to a known limitation, only project number is supported by this field) of the project that contains the secret. If not set, it will be populated with the function's project, assuming that the secret exists in the same project as of the function.
ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"`
// ID of the secret in secret manager (not the full resource name).
Secret *string `json:"secret,omitempty" tf:"secret,omitempty"`
// List of secret versions to mount for this secret. If empty, the "latest" version of the secret will be made available in a file named after the secret under the mount point. Structure is documented below.
Versions []VersionsObservation `json:"versions,omitempty" tf:"versions,omitempty"`
}
type SecretVolumesParameters struct {
// The path within the container to mount the secret volume. For example, setting the mount_path as "/etc/secrets" would mount the secret value files under the "/etc/secrets" directory. This directory will also be completely shadowed and unavailable to mount any other secrets. Recommended mount paths: "/etc/secrets" Restricted mount paths: "/cloudsql", "/dev/log", "/pod", "/proc", "/var/log".
// +kubebuilder:validation:Optional
MountPath *string `json:"mountPath" tf:"mount_path,omitempty"`
// Project identifier (due to a known limitation, only project number is supported by this field) of the project that contains the secret. If not set, it will be populated with the function's project, assuming that the secret exists in the same project as of the function.
// +kubebuilder:validation:Optional
ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"`
// ID of the secret in secret manager (not the full resource name).
// +kubebuilder:validation:Optional
Secret *string `json:"secret" tf:"secret,omitempty"`
// List of secret versions to mount for this secret. If empty, the "latest" version of the secret will be made available in a file named after the secret under the mount point. Structure is documented below.
// +kubebuilder:validation:Optional
Versions []VersionsParameters `json:"versions,omitempty" tf:"versions,omitempty"`
}
type SourceRepositoryInitParameters struct {
// The URL pointing to the hosted repository where the function is defined. There are supported Cloud Source Repository URLs in the following formats:
URL *string `json:"url,omitempty" tf:"url,omitempty"`
}
type SourceRepositoryObservation struct {
// The URL pointing to the hosted repository where the function was defined at the time of deployment.
DeployedURL *string `json:"deployedUrl,omitempty" tf:"deployed_url,omitempty"`
// The URL pointing to the hosted repository where the function is defined. There are supported Cloud Source Repository URLs in the following formats:
URL *string `json:"url,omitempty" tf:"url,omitempty"`
}
type SourceRepositoryParameters struct {
// The URL pointing to the hosted repository where the function is defined. There are supported Cloud Source Repository URLs in the following formats:
// +kubebuilder:validation:Optional
URL *string `json:"url" tf:"url,omitempty"`
}
type VersionsInitParameters struct {
// Relative path of the file under the mount path where the secret value for this version will be fetched and made available. For example, setting the mount_path as "/etc/secrets" and path as "/secret_foo" would mount the secret value file at "/etc/secrets/secret_foo".
Path *string `json:"path,omitempty" tf:"path,omitempty"`
// Version of the secret (version number or the string "latest"). It is preferable to use "latest" version with secret volumes as secret value changes are reflected immediately.
Version *string `json:"version,omitempty" tf:"version,omitempty"`
}
type VersionsObservation struct {
// Relative path of the file under the mount path where the secret value for this version will be fetched and made available. For example, setting the mount_path as "/etc/secrets" and path as "/secret_foo" would mount the secret value file at "/etc/secrets/secret_foo".
Path *string `json:"path,omitempty" tf:"path,omitempty"`
// Version of the secret (version number or the string "latest"). It is preferable to use "latest" version with secret volumes as secret value changes are reflected immediately.
Version *string `json:"version,omitempty" tf:"version,omitempty"`
}
type VersionsParameters struct {
// Relative path of the file under the mount path where the secret value for this version will be fetched and made available. For example, setting the mount_path as "/etc/secrets" and path as "/secret_foo" would mount the secret value file at "/etc/secrets/secret_foo".
// +kubebuilder:validation:Optional
Path *string `json:"path" tf:"path,omitempty"`
// Version of the secret (version number or the string "latest"). It is preferable to use "latest" version with secret volumes as secret value changes are reflected immediately.
// +kubebuilder:validation:Optional
Version *string `json:"version" tf:"version,omitempty"`
}
// FunctionSpec defines the desired state of Function
type FunctionSpec struct {
v1.ResourceSpec `json:",inline"`
ForProvider FunctionParameters `json:"forProvider"`
// THIS IS A BETA FIELD. It will be honored
// unless the Management Policies feature flag is disabled.
// InitProvider holds the same fields as ForProvider, with the exception
// of Identifier and other resource reference fields. The fields that are
// in InitProvider are merged into ForProvider when the resource is created.
// The same fields are also added to the terraform ignore_changes hook, to
// avoid updating them after creation. This is useful for fields that are
// required on creation, but we do not desire to update them after creation,
// for example because of an external controller is managing them, like an
// autoscaler.
InitProvider FunctionInitParameters `json:"initProvider,omitempty"`
}
// FunctionStatus defines the observed state of Function.
type FunctionStatus struct {
v1.ResourceStatus `json:",inline"`
AtProvider FunctionObservation `json:"atProvider,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// Function is the Schema for the Functions API. Creates a new Cloud Function.
// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status"
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name"
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gcp}
type Function struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.runtime) || (has(self.initProvider) && has(self.initProvider.runtime))",message="spec.forProvider.runtime is a required parameter"
Spec FunctionSpec `json:"spec"`
Status FunctionStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// FunctionList contains a list of Functions
type FunctionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Function `json:"items"`
}
// Repository type metadata.
var (
Function_Kind = "Function"
Function_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Function_Kind}.String()
Function_KindAPIVersion = Function_Kind + "." + CRDGroupVersion.String()
Function_GroupVersionKind = CRDGroupVersion.WithKind(Function_Kind)
)
func init() {
SchemeBuilder.Register(&Function{}, &FunctionList{})
}