You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add SecretManager integration support to GCF. (#5663) (#4040)
* Add SecretManager integration support to GCF.
* bug fix
* Correcting field requirements.
* Using zips created as part of the test.
* bug fix.
* addressing review comments.
* project_id is computed, otherwise project number
* test computedness of project_id for secret_env_vars
* test computedness
* removes unused declaration
* updating doc for project number.
Co-authored-by: Bakh Inamov <[email protected]>
Signed-off-by: Modular Magician <[email protected]>
Co-authored-by: Bakh Inamov <[email protected]>
Description: `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.`,
335
+
},
336
+
"secret": {
337
+
Type: schema.TypeString,
338
+
Required: true,
339
+
Description: `ID of the secret in secret manager (not the full resource name).`,
340
+
},
341
+
"version": {
342
+
Type: schema.TypeString,
343
+
Required: true,
344
+
Description: `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.`,
345
+
},
346
+
},
347
+
},
348
+
},
349
+
350
+
"secret_volumes": {
351
+
Type: schema.TypeList,
352
+
Optional: true,
353
+
Description: `Secret volumes configuration.`,
354
+
Elem: &schema.Resource{
355
+
Schema: map[string]*schema.Schema{
356
+
"mount_path": {
357
+
Type: schema.TypeString,
358
+
Required: true,
359
+
Description: `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".`,
360
+
},
361
+
"project_id": {
362
+
Type: schema.TypeString,
363
+
Optional: true,
364
+
Computed: true,
365
+
Description: `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.`,
366
+
},
367
+
"secret": {
368
+
Type: schema.TypeString,
369
+
Required: true,
370
+
Description: `ID of the secret in secret manager (not the full resource name).`,
371
+
},
372
+
"versions": {
373
+
Type: schema.TypeList,
374
+
Optional: true,
375
+
Description: `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.`,
376
+
Elem: &schema.Resource{
377
+
Schema: map[string]*schema.Schema{
378
+
"path": {
379
+
Type: schema.TypeString,
380
+
Required: true,
381
+
Description: `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".`,
382
+
},
383
+
"version": {
384
+
Type: schema.TypeString,
385
+
Required: true,
386
+
Description: `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.`,
387
+
},
388
+
},
389
+
},
390
+
},
391
+
},
392
+
},
393
+
},
318
394
},
319
395
UseJSONNumber: true,
320
396
}
@@ -362,6 +438,16 @@ func resourceCloudFunctionsCreate(d *schema.ResourceData, meta interface{}) erro
0 commit comments