Secret
Secrets are used to inject sensitive information into tasks or image build context. Secrets can be mounted as environment variables or files. The secret key is the name of the secret in the secret store. The group is optional and maybe used with some secret stores to organize secrets. The secret_mount is used to specify how the secret should be mounted. If the secret_mount is set to "env" the secret will be mounted as an environment variable. If the secret_mount is set to "file" the secret will be mounted as a file. The as_env_var is an optional parameter that can be used to specify the name of the environment variable that the secret should be mounted as.
Attributes
-
key: string
- The name of the secret in the secret store.
-
group: Optional[str] = None
- The group of the secret in the secret store.
-
mount: pathlib.Path | None = None
- Use this to specify the path where the secret should be mounted. TODO: support arbitrary mount paths. Today only "/etc/flyte/secrets" is supported
-
as_env_var: Optional[str] = None
- The name of the environment variable that the secret should be mounted as.
Constructors
-
Secrets are used to inject sensitive information into tasks or image build context. Secrets can be mounted as environment variables or files. The secret key is the name of the secret in the secret store. The group is optional and maybe used with some secret stores to organize secrets. The secret_mount is used to specify how the secret should be mounted. If the secret_mount is set to "env" the secret will be mounted as an environment variable. If the secret_mount is set to "file" the secret will be mounted as a file. The as_env_var is an optional parameter that can be used to specify the name of the environment variable that the secret should be mounted as.
-
Parameters
- key: str
- The name of the secret in the secret store.
- group: Optional[str]
- The group of the secret in the secret store.
- mount: pathlib.Path | None
- Use this to specify the path where the secret should be mounted. TODO: support arbitrary mount paths. Today only "/etc/flyte/secrets" is supported
- as_env_var: Optional[str]
- The name of the environment variable that the secret should be mounted as.
- key: str
Methods
def stable_hash()
-
Generates a deterministic, process-independent hash for the Secret object as a hexadecimal string. It concatenates the key, group, mount path, and as_env_var to create the hash.
-
Return Value: string
- A hexadecimal string representing the SHA256 hash of the secret's attributes.