Reference documentation and code samples for the Google Cloud Run V2 Client class SecretKeySelector.
SecretEnvVarSource represents a source for the value of an EnvVar.
Generated from protobuf messagegoogle.cloud.run.v2.SecretKeySelector
Namespace
Google \ Cloud \ Run \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ secret
string
Required. The name of the secret in Cloud Secret Manager. Format: {secret_name} if the secret is in the same project. projects/{project}/secrets/{secret_name} if the secret is in a different project.
↳ version
string
The Cloud Secret Manager secret version. Can be 'latest' for the latest version, an integer for a specific version, or a version alias.
getSecret
Required. The name of the secret in Cloud Secret Manager.
Format: {secret_name} if the secret is in the same project.
projects/{project}/secrets/{secret_name} if the secret is
in a different project.
Returns
Type
Description
string
setSecret
Required. The name of the secret in Cloud Secret Manager.
Format: {secret_name} if the secret is in the same project.
projects/{project}/secrets/{secret_name} if the secret is
in a different project.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getVersion
The Cloud Secret Manager secret version.
Can be 'latest' for the latest version, an integer for a specific version,
or a version alias.
Returns
Type
Description
string
setVersion
The Cloud Secret Manager secret version.
Can be 'latest' for the latest version, an integer for a specific version,
or a version alias.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Run V2 Client - Class SecretKeySelector (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/php/docs/reference/cloud-run/latest/V2.SecretKeySelector)\n- [1.8.0](/php/docs/reference/cloud-run/1.8.0/V2.SecretKeySelector)\n- [1.7.0](/php/docs/reference/cloud-run/1.7.0/V2.SecretKeySelector)\n- [1.6.0](/php/docs/reference/cloud-run/1.6.0/V2.SecretKeySelector)\n- [1.5.2](/php/docs/reference/cloud-run/1.5.2/V2.SecretKeySelector)\n- [1.4.0](/php/docs/reference/cloud-run/1.4.0/V2.SecretKeySelector)\n- [1.3.0](/php/docs/reference/cloud-run/1.3.0/V2.SecretKeySelector)\n- [1.2.0](/php/docs/reference/cloud-run/1.2.0/V2.SecretKeySelector)\n- [1.1.0](/php/docs/reference/cloud-run/1.1.0/V2.SecretKeySelector)\n- [1.0.0](/php/docs/reference/cloud-run/1.0.0/V2.SecretKeySelector)\n- [0.9.3](/php/docs/reference/cloud-run/0.9.3/V2.SecretKeySelector)\n- [0.8.0](/php/docs/reference/cloud-run/0.8.0/V2.SecretKeySelector)\n- [0.7.2](/php/docs/reference/cloud-run/0.7.2/V2.SecretKeySelector)\n- [0.6.0](/php/docs/reference/cloud-run/0.6.0/V2.SecretKeySelector)\n- [0.5.2](/php/docs/reference/cloud-run/0.5.2/V2.SecretKeySelector)\n- [0.4.0](/php/docs/reference/cloud-run/0.4.0/V2.SecretKeySelector)\n- [0.3.4](/php/docs/reference/cloud-run/0.3.4/V2.SecretKeySelector) \nReference documentation and code samples for the Google Cloud Run V2 Client class SecretKeySelector.\n\nSecretEnvVarSource represents a source for the value of an EnvVar.\n\nGenerated from protobuf message `google.cloud.run.v2.SecretKeySelector`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Run \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getSecret\n\nRequired. The name of the secret in Cloud Secret Manager.\n\nFormat: {secret_name} if the secret is in the same project.\nprojects/{project}/secrets/{secret_name} if the secret is\nin a different project.\n\n### setSecret\n\nRequired. The name of the secret in Cloud Secret Manager.\n\nFormat: {secret_name} if the secret is in the same project.\nprojects/{project}/secrets/{secret_name} if the secret is\nin a different project.\n\n### getVersion\n\nThe Cloud Secret Manager secret version.\n\nCan be 'latest' for the latest version, an integer for a specific version,\nor a version alias.\n\n### setVersion\n\nThe Cloud Secret Manager secret version.\n\nCan be 'latest' for the latest version, an integer for a specific version,\nor a version alias."]]