Class ApplicationLoadBalancedTaskImageOptions
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ApplicationLoadBalancedTaskImageOptions : IApplicationLoadBalancedTaskImageOptions
Syntax (vb)
Public Class ApplicationLoadBalancedTaskImageOptions Implements 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")
},
MinHealthyPercent = 100,
TaskSubnets = new SubnetSelection {
Subnets = new [] { Subnet.FromSubnetId(this, "subnet", "VpcISOLATEDSubnet1Subnet80F07FA0") }
},
LoadBalancerName = "application-lb-name"
});
Synopsis
Constructors
| ApplicationLoadBalancedTaskImageOptions() |
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. |
Constructors
ApplicationLoadBalancedTaskImageOptions()
public ApplicationLoadBalancedTaskImageOptions()
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")
},
MinHealthyPercent = 100,
TaskSubnets = new SubnetSelection {
Subnets = new [] { Subnet.FromSubnetId(this, "subnet", "VpcISOLATEDSubnet1Subnet80F07FA0") }
},
LoadBalancerName = "application-lb-name"
});
Properties
Command
The command that's passed to the container.
public string[]? Command { get; set; }
Property Value
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.
public string? ContainerName { get; set; }
Property Value
Remarks
Default: - none
ContainerPort
The port number on the container that is bound to the user-specified or automatically assigned host port.
public double? ContainerPort { get; set; }
Property Value
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.
public IDictionary<string, string>? DockerLabels { get; set; }
Property Value
Remarks
Default: - No labels.
EnableLogging
Flag to indicate whether to enable logging.
public bool? EnableLogging { get; set; }
Property Value
bool?
Remarks
Default: true
EntryPoint
The entry point that's passed to the container.
public string[]? EntryPoint { get; set; }
Property Value
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.
public IDictionary<string, string>? Environment { get; set; }
Property Value
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.
public IRole? ExecutionRole { get; set; }
Property Value
Remarks
Default: - No value
Family
The name of a family that this task definition is registered to.
public string? Family { get; set; }
Property Value
Remarks
A family groups multiple versions of a task definition.
Default: - Automatically generated name.
Image
The image used to start a container.
public ContainerImage Image { get; set; }
Property Value
Remarks
Image or taskDefinition must be specified, not both.
Default: - none
LogDriver
The log driver to use.
public LogDriver? LogDriver { get; set; }
Property Value
Remarks
Default: - AwsLogDriver if enableLogging is true
Secrets
The secret to expose to the container as an environment variable.
public IDictionary<string, Secret>? Secrets { get; set; }
Property Value
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.
public IRole? TaskRole { get; set; }
Property Value
Remarks
Default: - A task role is automatically created for you.