Interface INetworkLoadBalancedEc2ServiceProps
The properties for the NetworkLoadBalancedEc2Service service.
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface INetworkLoadBalancedEc2ServiceProps : INetworkLoadBalancedServiceBaseProps
Syntax (vb)
Public Interface INetworkLoadBalancedEc2ServiceProps
Inherits INetworkLoadBalancedServiceBaseProps
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
var loadBalancedEcsService = new NetworkLoadBalancedEc2Service(this, "Service", new NetworkLoadBalancedEc2ServiceProps {
Cluster = cluster,
MemoryLimitMiB = 1024,
TaskImageOptions = new NetworkLoadBalancedTaskImageOptions {
Image = ContainerImage.FromRegistry("test"),
Environment = new Dictionary<string, string> {
{ "TEST_ENVIRONMENT_VARIABLE1", "test environment variable 1 value" },
{ "TEST_ENVIRONMENT_VARIABLE2", "test environment variable 2 value" }
}
},
DesiredCount = 2
});
Synopsis
Properties
Cpu | The number of cpu units used by the task. |
MemoryLimitMiB | The hard limit (in MiB) of memory to present to the container. |
MemoryReservationMiB | The soft limit (in MiB) of memory to reserve for the container. |
PlacementConstraints | The placement constraints to use for tasks in the service. |
PlacementStrategies | The placement strategies to use for tasks in the service. |
TaskDefinition | The task definition to use for tasks in the service. TaskDefinition or TaskImageOptions must be specified, but not both.. |
Properties
Cpu
The number of cpu units used by the task.
virtual Nullable<double> Cpu { get; }
Property Value
System.Nullable<System.Double>
Remarks
Valid values, which determines your range of valid values for the memory parameter:
256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB
512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB
1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB
2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments
4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments
This default is set in the underlying FargateTaskDefinition construct.
Default: none
MemoryLimitMiB
The hard limit (in MiB) of memory to present to the container.
virtual Nullable<double> MemoryLimitMiB { get; }
Property Value
System.Nullable<System.Double>
Remarks
If your container attempts to exceed the allocated memory, the container is terminated.
At least one of memoryLimitMiB and memoryReservationMiB is required.
Default: - No memory limit.
MemoryReservationMiB
The soft limit (in MiB) of memory to reserve for the container.
virtual Nullable<double> MemoryReservationMiB { get; }
Property Value
System.Nullable<System.Double>
Remarks
When system memory is under contention, Docker attempts to keep the container memory within the limit. If the container requires more memory, it can consume up to the value specified by the Memory property or all of the available memory on the container instance—whichever comes first.
At least one of memoryLimitMiB and memoryReservationMiB is required.
Default: - No memory reserved.
PlacementConstraints
The placement constraints to use for tasks in the service.
virtual PlacementConstraint[] PlacementConstraints { get; }
Property Value
Remarks
For more information, see Amazon ECS Task Placement Constraints.
Default: - No constraints.
PlacementStrategies
The placement strategies to use for tasks in the service.
virtual PlacementStrategy[] PlacementStrategies { get; }
Property Value
Remarks
For more information, see Amazon ECS Task Placement Strategies.
Default: - No strategies.
TaskDefinition
The task definition to use for tasks in the service. TaskDefinition or TaskImageOptions must be specified, but not both..
virtual Ec2TaskDefinition TaskDefinition { get; }
Property Value
Remarks
[disable-awslint:ref-via-interface]
Default: - none