SecretPathVolume

class aws_cdk.aws_batch.SecretPathVolume(*, secret_name, optional=None, name, mount_path=None, readonly=None)

Bases: EksVolume

Specifies the configuration of a Kubernetes secret volume.

See:

https://kubernetes.io/docs/concepts/storage/volumes/#secret

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_batch as batch

secret_path_volume = batch.SecretPathVolume(
    name="name",
    secret_name="secretName",

    # the properties below are optional
    mount_path="mountPath",
    optional=False,
    readonly=False
)
Parameters:
  • secret_name (str) – The name of the secret. Must be a valid DNS subdomain name.

  • optional (Optional[bool]) – Specifies whether the secret or the secret’s keys must be defined. Default: true

  • name (str) – The name of this volume. The name must be a valid DNS subdomain name.

  • mount_path (Optional[str]) – The path on the container where the volume is mounted. Default: - the volume is not mounted

  • readonly (Optional[bool]) – If specified, the container has readonly access to the volume. Otherwise, the container has read/write access. Default: false

Attributes

container_path

The path on the container where the container is mounted.

Default:
  • the container is not mounted

name

The name of this volume.

The name must be a valid DNS subdomain name.

See:

https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names

optional

Specifies whether the secret or the secret’s keys must be defined.

Default:

true

readonly

If specified, the container has readonly access to the volume.

Otherwise, the container has read/write access.

Default:

false

secret_name

The name of the secret.

Must be a valid DNS subdomain name.

See:

https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names

Static Methods

classmethod empty_dir(*, medium=None, size_limit=None, name, mount_path=None, readonly=None)

Creates a Kubernetes EmptyDir volume.

Parameters:
  • medium (Optional[EmptyDirMediumType]) – The storage type to use for this Volume. Default: EmptyDirMediumType.DISK

  • size_limit (Optional[Size]) – The maximum size for this Volume. Default: - no size limit

  • name (str) – The name of this volume. The name must be a valid DNS subdomain name.

  • mount_path (Optional[str]) – The path on the container where the volume is mounted. Default: - the volume is not mounted

  • readonly (Optional[bool]) – If specified, the container has readonly access to the volume. Otherwise, the container has read/write access. Default: false

See:

https://kubernetes.io/docs/concepts/storage/volumes/#emptydir

Return type:

EmptyDirVolume

classmethod host_path(*, host_path, name, mount_path=None, readonly=None)

Creates a Kubernetes HostPath volume.

Parameters:
  • host_path (str) – The path of the file or directory on the host to mount into containers on the pod. Note: HothPath Volumes present many security risks, and should be avoided when possible.

  • name (str) – The name of this volume. The name must be a valid DNS subdomain name.

  • mount_path (Optional[str]) – The path on the container where the volume is mounted. Default: - the volume is not mounted

  • readonly (Optional[bool]) – If specified, the container has readonly access to the volume. Otherwise, the container has read/write access. Default: false

See:

https://kubernetes.io/docs/concepts/storage/volumes/#hostpath

Return type:

HostPathVolume

classmethod is_secret_path_volume(x)

returns true if x is a SecretPathVolume and false otherwise.

Parameters:

x (Any) –

Return type:

bool

classmethod secret(*, secret_name, optional=None, name, mount_path=None, readonly=None)

Creates a Kubernetes Secret volume.

Parameters:
  • secret_name (str) – The name of the secret. Must be a valid DNS subdomain name.

  • optional (Optional[bool]) – Specifies whether the secret or the secret’s keys must be defined. Default: true

  • name (str) – The name of this volume. The name must be a valid DNS subdomain name.

  • mount_path (Optional[str]) – The path on the container where the volume is mounted. Default: - the volume is not mounted

  • readonly (Optional[bool]) – If specified, the container has readonly access to the volume. Otherwise, the container has read/write access. Default: false

See:

https://kubernetes.io/docs/concepts/storage/volumes/#secret

Return type:

SecretPathVolume