Interface IApplicationLoadBalancedTaskImageOptions
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IApplicationLoadBalancedTaskImageOptions
Syntax (vb)
Public Interface IApplicationLoadBalancedTaskImageOptions
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
var loadBalancedFargateService = new ApplicationLoadBalancedFargateService(this, "Service", new ApplicationLoadBalancedFargateServiceProps {
Cluster = cluster,
MemoryLimitMiB = 1024,
DesiredCount = 1,
Cpu = 512,
TaskImageOptions = new ApplicationLoadBalancedTaskImageOptions {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample")
},
TaskSubnets = new SubnetSelection {
Subnets = new [] { Subnet.FromSubnetId(this, "subnet", "VpcISOLATEDSubnet1Subnet80F07FA0") }
},
LoadBalancerName = "application-lb-name"
});
Synopsis
Properties
Command | The command that's passed to the container. |
ContainerName | The container name value to be specified in the task definition. |
ContainerPort | The port number on the container that is bound to the user-specified or automatically assigned host port. |
DockerLabels | A key/value map of labels to add to the container. |
EnableLogging | Flag to indicate whether to enable logging. |
EntryPoint | The entry point that's passed to the container. |
Environment | The environment variables to pass to the container. |
ExecutionRole | The name of the task execution IAM role that grants the Amazon ECS container agent permission to call AWS APIs on your behalf. |
Family | The name of a family that this task definition is registered to. |
Image | The image used to start a container. |
LogDriver | The log driver to use. |
Secrets | The secret to expose to the container as an environment variable. |
TaskRole | The name of the task IAM role that grants containers in the task permission to call AWS APIs on your behalf. |
Properties
Command
The command that's passed to the container.
virtual string[] Command { get; }
Property Value
System.String[]
Remarks
If there are multiple arguments, make sure that each argument is a separated string in the array.
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, see https://docs.docker.com/engine/reference/builder/#cmd.
Default: none
ContainerName
The container name value to be specified in the task definition.
virtual string ContainerName { get; }
Property Value
System.String
Remarks
Default: - none
ContainerPort
The port number on the container that is bound to the user-specified or automatically assigned host port.
virtual Nullable<double> ContainerPort { get; }
Property Value
System.Nullable<System.Double>
Remarks
If you are using containers in a task with the awsvpc or host network mode, exposed ports should be specified using containerPort. If you are using containers in a task with the bridge network mode and you specify a container port and not a host port, your container automatically receives a host port in the ephemeral port range.
Port mappings that are automatically assigned in this way do not count toward the 100 reserved ports limit of a container instance.
For more information, see hostPort.
Default: 80
DockerLabels
A key/value map of labels to add to the container.
virtual IDictionary<string, string> DockerLabels { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - No labels.
EnableLogging
Flag to indicate whether to enable logging.
virtual Nullable<bool> EnableLogging { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
EntryPoint
The entry point that's passed to the container.
virtual string[] EntryPoint { get; }
Property Value
System.String[]
Remarks
This parameter maps to Entrypoint
in the Create a container section
of the Docker Remote API and the --entrypoint
option to
docker run.
For more information about the Docker ENTRYPOINT
parameter, see https://docs.docker.com/engine/reference/builder/#entrypoint.
Default: none
Environment
The environment variables to pass to the container.
virtual IDictionary<string, string> Environment { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - No environment variables.
ExecutionRole
The name of the task execution IAM role that grants the Amazon ECS container agent permission to call AWS APIs on your behalf.
virtual IRole ExecutionRole { get; }
Property Value
Remarks
Default: - No value
Family
The name of a family that this task definition is registered to.
virtual string Family { get; }
Property Value
System.String
Remarks
A family groups multiple versions of a task definition.
Default: - Automatically generated name.
Image
The image used to start a container.
ContainerImage Image { get; }
Property Value
Remarks
Image or taskDefinition must be specified, not both.
Default: - none
LogDriver
The log driver to use.
virtual LogDriver LogDriver { get; }
Property Value
Remarks
Default: - AwsLogDriver if enableLogging is true
Secrets
The secret to expose to the container as an environment variable.
virtual IDictionary<string, Secret> Secrets { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, Secret>
Remarks
Default: - No secret environment variables.
TaskRole
The name of the task IAM role that grants containers in the task permission to call AWS APIs on your behalf.
virtual IRole TaskRole { get; }
Property Value
Remarks
Default: - A task role is automatically created for you.