Interface ServiceArguments

The arguments to construct a Service object. These arguments may include container information, for simple single-container scenarios, or you may specify that information using the containers property. If a single container is specified in-line, it is implicitly given the name "default".

interface ServiceArguments {
    build?: string | ContainerBuild;
    command?: Input<string[]>;
    containers?: Containers;
    cpu?: Input<number>;
    dockerLabels?: Input<{
        [name: string]: string;
    }>;
    environment?: {
        [name: string]: pulumi.Input<string>;
    };
    function?: (() => void);
    host?: HostProperties;
    image?: Input<string>;
    memory?: Input<number>;
    memoryReservation?: Input<number>;
    ports?: ContainerPort[];
    replicas?: number;
    volumes?: ContainerVolumeMount[];
    waitForSteadyState?: boolean;
}

Hierarchy (view full)

Properties

build?: string | ContainerBuild

Either a path to a folder in which a Docker build should be run to construct the image for this Container, or a ContainerBuild object with more detailed build instructions. If image is also specified, the built container will be tagged with that name, but otherwise will get an auto-generated image name.

command?: Input<string[]>

The command line that is passed to the container. This parameter maps to Cmd in the Create a container section of the Docker Remote API and the COMMAND parameter to docker run. For more information about the Docker CMD parameter, go to https://docs.docker.com/engine/reference/builder/#cmd.

containers?: Containers

A collection of containers that will be deployed as part of this Service, if there are multiple.

cpu?: Input<number>

Number of CPUs for the container to use. Maps to the Docker --cpus option - see https://docs.docker.com/engine/reference/commandline/run.

dockerLabels?: Input<{
    [name: string]: string;
}>

A key/value map of labels to add to the container. This parameter maps to Labels in the Create a container section of the Docker Remote API and the --label option to docker run.

Type declaration

  • [name: string]: string
environment?: {
    [name: string]: pulumi.Input<string>;
}

Optional environment variables to set and make available to the container as it is running.

Type declaration

  • [name: string]: pulumi.Input<string>
function?: (() => void)

The function code to use as the implementation of the contaner. If function is specified, neither image nor build are legal.

Type declaration

    • (): void
    • Returns void

The properties of the host where this service can run.

image?: Input<string>

The image to use for the container. If image is specified, but not build, the image will be pulled from the Docker Hub. If image and build are specified, the image controls the resulting image tag for the build image that gets pushed.

memory?: Input<number>

The maximum amount of memory the container will be allowed to use. Maps to the Docker --memory option - see https://docs.docker.com/engine/reference/commandline/run.

This should be supplied in MB. i.e. A value of 1024 would equal one gigabyte.

memoryReservation?: Input<number>

The amount of memory to reserve for the container, but the container will be allowed to use more memory if it's available. At least one of memory and memoryReservation must be specified. Maps to the Docker --memory-reservation option - see https://docs.docker.com/engine/reference/commandline/run.

This should be supplied in MB. i.e. A value of 1024 would equal one gigabyte.

ports?: ContainerPort[]

An array of ports to publish from the container. Ports are exposed using the TCP protocol. If the [external] flag is true, the port will be exposed to the Internet even if the service is running in a private network. Maps to the Docker --publish option - see https://docs.docker.com/engine/reference/commandline/run.

replicas?: number

The number of copies of this Service's containers to deploy and maintain as part of the running service. Defaults to 1.

An array of volume mounts, indicating a volume to mount and a path within the container at which to mount the volume. Maps to the Docker --volume option - see https://docs.docker.com/engine/reference/commandline/run.

waitForSteadyState?: boolean

Determines whether the service should wait to fully transition to a new steady state on creation and updates. If set to false, the service may complete its deployment before it is fully ready to be used. Defaults to 'true'.

Generated using TypeDoc