Fugue.AWS.ECS.ContainerDefinition

Table of Contents

Module Members

new

(Function)

new ContainerDefinition (Constructor)

Call this constructor to create a new Fugue.Core.AWS.ECS.ContainerDefinition value.

Example usage:

mysqlContainer: ECS.ContainerDefinition.new {
  name: "mysql",
  image: "mysql",
  cpu: 10,
  memory: 500,
  environment: {
    "MYSQL_ROOT_PASSWORD": "password",
  },
}
wordpressContainer: ECS.ContainerDefinition.new {
  name: "wordpress",
  links: [
    mysqlContainer,
  ],
  image: "wordpress",
  portMappings: [
    ECS.PortMapping.tcp {
      containerPort: 80,
      hostPort: 55000,
    },
  ],
  memory: 500,
  cpu: 10,
}

Type Signature

 fun { name: String,
       image: String,
       cpu: Optional<Int>,
       memory: Optional<Int>,
       memoryReservation: Optional<Int>,
       links: Optional<List<ContainerDefinition>>,
       portMappings: Optional<List<PortMapping>>,
       essential: Optional<Bool>,
       entryPoint: Optional<List<String>>,
       command: Optional<List<String>>,
       environment: Optional<Dictionary<String>>,
       mountPoints: Optional<List<MountPoint>>,
       volumesFrom: Optional<List<VolumeFrom>>,
       hostname: Optional<String>,
       user: Optional<String>,
       workingDirectory: Optional<String>,
       disableNetworking: Optional<Bool>,
       privileged: Optional<Bool>,
       readonlyRootFilesystem: Optional<Bool>,
       dnsServers: Optional<List<String>>,
       dnsSearchDomains: Optional<List<String>>,
       extraHosts: Optional<List<HostEntry>>,
       dockerSecurityOptions: Optional<List<String>>,
       dockerLabels: Optional<Dictionary<String>>,
       ulimits: Optional<List<Ulimit>>,
       logConfiguration: Optional<LogConfiguration> } -> ContainerDefinition
Argument: name

The name of the container.

Type: String

Argument: image

The container image to launch. Up to 255 characters consisting of letters, numbers, hyphens, underscores, periods, colons, forward slashes, and number signs.

Type: String

Argument: cpu

The number of CPU units reserved for this container. Each CPU core represents 1024 CPU units. Defaults to 2 (the minimum supported by the Linux kernel).

Type: Optional<Int>

Argument: memory

The maximum memory the container may use in MiB. One of memory or memoryReservation must be specified; if both are specified memory must be greater than memoryReservation. Docker requires at least 4 MiB to launch a container.

Type: Optional<Int>

Argument: memoryReservation

The minimum amount of memory to reserve for the container in MiB. One of memory or memoryReservation must be specified; if both are specified memory must be greater than memoryReservation.

Type: Optional<Int>

Argument: links

List of container links to setup. Links allow containers in the same task to communicate without requiring port mappings. See https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/ for details on links.

Type: Optional<List<ContainerDefinition>>

Argument: portMappings

PortMappings to setup for the container. PortMappings allow exposing container ports on the host instance. Not supported when networkMode is none.

Type: Optional<List<PortMapping>>

Argument: essential

Marks the container as essential. The ECS task will be relaunched if any essential containers crash. Defaults to True.

Type: Optional<Bool>

Argument: entryPoint

The entry point passed to the container. See https://docs.docker.com/engine/reference/builder/#entrypoint for details.

Type: Optional<List<String>>

Argument: command

The command passed to the container. See https://docs.docker.com/engine/reference/builder/#cmd for details.

Type: Optional<List<String>>

Argument: environment

Environment variables to pass to the container.

Type: Optional<Dictionary<String>>

Argument: mountPoints

List of mount points for the container’s data volumes.

Type: Optional<List<MountPoint>>

Argument: volumesFrom

List of volumes to mount from another container in the same task.

Type: Optional<List<VolumeFrom>>

Argument: hostname

Hostname to use for the container.

Type: Optional<String>

Argument: user

The username to use inside the container.

Type: Optional<String>

Argument: workingDirectory

The working directory in which to start container commands.

Type: Optional<String>

Argument: disableNetworking

Disables container networking when True. Defaults to False.

Type: Optional<Bool>

Argument: privileged

Gives the container elevated permissions to access host devices when True. Defaults to False.

Type: Optional<Bool>

Argument: readonlyRootFilesystem

The container will not be able to write to its file system when True. Defaults to False.

Type: Optional<Bool>

Argument: dnsServers

List of DNS servers used by the container.

Type: Optional<List<String>>

Argument: dnsSearchDomains

List of DNS search domains used by the container.

Type: Optional<List<String>>

Argument: extraHosts

List of extra entries to add to the container’s /etc/host file.

Type: Optional<List<HostEntry>>

Argument: dockerSecurityOptions

List of labels for SELinux or AppArmor. See https://docs.docker.com/engine/reference/run/#security-configuration for more details.

Type: Optional<List<String>>

Argument: dockerLabels

Labels to apply to the container.

Type: Optional<Dictionary<String>>

Argument: ulimits

List of ulimits to set in the container. By default the container will inherit the ulimits used by the docker daemon.

Type: Optional<List<Ulimit>>

Argument: logConfiguration

The log configuration to use for the container. See Fugue.AWS.ECS.LogConfiguration for available drivers and options. Defaults to using the logging configuration configured for the docker daemon.

Type: Optional<LogConfiguration>

Returns:

A new Fugue.Core.AWS.ECS.ContainerDefinition value.

Type: ContainerDefinition