MDAA TS Docs
    Preparing search index...

    A construct for creating a compliant ECS containerdefinition resource.

    Hierarchy

    • ContainerDefinition
      • MdaaECSContainerDefinition
    Index

    Constructors

    Properties

    containerDependencies: ContainerDependency[]

    An array dependencies defined for container startup and shutdown.

    containerName: string

    The name of this container

    cpu?: number

    The number of cpu units reserved for the container.

    credentialSpecs?: CredentialSpecConfig[]

    The crdential specifications for this container.

    environmentFiles?: EnvironmentFileConfig[]

    The environment files for this container

    essential: boolean

    Specifies whether the container will be marked essential.

    If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped. If the essential parameter of a container is marked as false, then its failure does not affect the rest of the containers in a task.

    If this parameter is omitted, a container is assumed to be essential.

    imageName: string

    The name of the image referenced by this container.

    linuxParameters?: LinuxParameters

    The Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.

    logDriverConfig?: LogDriverConfig

    The log configuration specification for the container.

    memoryLimitSpecified: boolean

    Whether there was at least one memory limit specified in this definition

    mountPoints: MountPoint[]

    The mount points for data volumes in your container.

    node: Node

    The tree node.

    portMappings: PortMapping[]

    The list of port mappings for the container. Port mappings allow containers to access ports on the host container instance to send or receive traffic.

    pseudoTerminal?: boolean

    Specifies whether a TTY must be allocated for this container.

    taskDefinition: TaskDefinition

    The name of the task definition that includes this container definition.

    ulimits: Ulimit[]

    An array of ulimits to set in the container.

    volumesFrom: VolumeFrom[]

    The data volumes to mount from another container in the same task definition.

    CONTAINER_PORT_USE_RANGE: 0
    PROPERTY_INJECTION_ID: string

    Uniquely identifies this class.

    Accessors

    • get containerPort(): number

      The port the container will listen on.

      Returns number

    • get ingressPort(): number

      The inbound rules associated with the security group the task or service will use.

      This property is only used for tasks that use the awsvpc network mode.

      Returns number

    • get referencesSecretJsonField(): boolean | undefined

      Whether this container definition references a specific JSON field of a secret stored in Secrets Manager.

      Returns boolean | undefined

    Methods

    • Internal

      Allows disabling version consistency if the user did not specify a value.

      Intended for CDK asset images, as asset images are tagged based upon a hash of image inputs, meaning the image won't change if the tag didn't change, making version consistency for such containers a waste of time. Literally, as version consistency can only be achieved by slowing down deployments.

      Returns void

    • This method adds one or more container dependencies to the container.

      Parameters

      • ...containerDependencies: ContainerDependency[]

      Returns void

    • This method adds a Docker label to the container.

      Parameters

      • name: string
      • value: string

      Returns void

    • This method adds an environment variable to the container.

      Parameters

      • name: string
      • value: string

      Returns void

    • This method adds one or more resources to the container.

      Parameters

      • ...inferenceAcceleratorResources: string[]

      Returns void

    • This method adds a link which allows containers to communicate with each other without the need for port mappings.

      This parameter is only supported if the task definition is using the bridge network mode. Warning: The --link flag is a legacy feature of Docker. It may eventually be removed.

      Parameters

      • container: ContainerDefinition
      • Optionalalias: string

      Returns void

    • This method adds one or more mount points for data volumes to the container.

      Parameters

      • ...mountPoints: MountPoint[]

      Returns void

    • This method adds one or more port mappings to the container.

      Parameters

      • ...portMappings: PortMapping[]

      Returns void

    • This method mounts temporary disk space to the container.

      This adds the correct container mountPoint and task definition volume.

      Parameters

      • scratch: ScratchSpace

      Returns void

    • This method adds a secret as environment variable to the container.

      Parameters

      • name: string
      • secret: Secret

      Returns void

    • This method adds the specified statement to the IAM task execution policy in the task definition.

      Parameters

      • statement: PolicyStatement

      Returns void

    • This method adds one or more ulimits to the container.

      Parameters

      • ...ulimits: Ulimit[]

      Returns void

    • This method adds one or more volumes to the container.

      Parameters

      • ...volumesFrom: VolumeFrom[]

      Returns void

    • Returns the host port for the requested container port if it exists

      Parameters

      • containerPort: number
      • protocol: Protocol

      Returns PortMapping | undefined

    • Returns the port mapping with the given name, if it exists.

      Parameters

      • name: string

      Returns PortMapping | undefined

    • Render this container definition to a CloudFormation object

      Parameters

      • Optional_taskDefinition: TaskDefinition

        [disable-awslint:ref-via-interface] (unused but kept to avoid breaking change)

      Returns ContainerDefinitionProperty

    • Returns a string representation of this construct.

      Returns string

    • Checks if x is a construct.

      Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

      Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

      Parameters

      • x: any

        Any object

      Returns x is Construct

      true if x is an object created from a class which extends Construct.