public sealed class SecretVolume : IMessage<SecretVolume>, IEquatable<SecretVolume>, IDeepCloneable<SecretVolume>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Functions v1 API class SecretVolume.
Configuration for a secret volume. It has the information necessary to fetch
the secret value from secret manager and make it available as files mounted
at the requested paths within the application container. Secret value is not
a part of the configuration. Every filesystem read operation performs a
lookup in secret manager to retrieve the secret value.
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
Project identifier (preferrably project number but can also be the project
ID) 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.
public RepeatedField<SecretVolume.Types.SecretVersion> Versions { get; }
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eSecretVolume\u003c/code\u003e API class is 2.7.0, with multiple prior versions available, including the currently highlighted version 2.5.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSecretVolume\u003c/code\u003e is designed to fetch secret values from the secret manager and mount them as files within an application container, enabling secure secret access.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSecretVolume\u003c/code\u003e class implements multiple interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, offering various functionalities for managing secret volumes.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of \u003ccode\u003eSecretVolume\u003c/code\u003e include \u003ccode\u003eMountPath\u003c/code\u003e, \u003ccode\u003eProjectId\u003c/code\u003e, \u003ccode\u003eSecret\u003c/code\u003e, and \u003ccode\u003eVersions\u003c/code\u003e, which define where the secret is mounted, the project it is in, the secret name, and the versions of the secret to mount respectively.\u003c/p\u003e\n"],["\u003cp\u003eWhen mounting secrets, it is recommended to use paths such as \u003ccode\u003e/etc/secrets\u003c/code\u003e and to avoid restricted mount paths like \u003ccode\u003e/cloudsql\u003c/code\u003e, \u003ccode\u003e/dev/log\u003c/code\u003e, \u003ccode\u003e/pod\u003c/code\u003e, \u003ccode\u003e/proc\u003c/code\u003e, and \u003ccode\u003e/var/log\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]