Interface INetworkMultipleTargetGroupsEc2ServiceProps
The properties for the NetworkMultipleTargetGroupsEc2Service service.
Inherited Members
Namespace: Amazon.CDK.AWS.ECS.Patterns
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface INetworkMultipleTargetGroupsEc2ServiceProps : INetworkMultipleTargetGroupsServiceBaseProps
Syntax (vb)
Public Interface INetworkMultipleTargetGroupsEc2ServiceProps
Inherits INetworkMultipleTargetGroupsServiceBaseProps
Remarks
ExampleMetadata: infused
Examples
// Two network load balancers, each with their own listener and target group.
Cluster cluster;
var loadBalancedEc2Service = new NetworkMultipleTargetGroupsEc2Service(this, "Service", new NetworkMultipleTargetGroupsEc2ServiceProps {
Cluster = cluster,
MemoryLimitMiB = 256,
TaskImageOptions = new NetworkLoadBalancedTaskImageProps {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample")
},
LoadBalancers = new [] { new NetworkLoadBalancerProps {
Name = "lb1",
Listeners = new [] { new NetworkListenerProps {
Name = "listener1"
} }
}, new NetworkLoadBalancerProps {
Name = "lb2",
Listeners = new [] { new NetworkListenerProps {
Name = "listener2"
} }
} },
TargetGroups = new [] { new NetworkTargetProps {
ContainerPort = 80,
Listener = "listener1"
}, new NetworkTargetProps {
ContainerPort = 90,
Listener = "listener2"
} }
});
Synopsis
Properties
Cpu | The minimum number of CPU units to reserve for the container. |
MemoryLimitMiB | The amount (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. Only one of TaskDefinition or TaskImageOptions must be specified. |
Properties
Cpu
The minimum number of CPU units to reserve for the container.
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:
Default: - No minimum CPU units reserved.
MemoryLimitMiB
The amount (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 heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the memory parameter (if applicable), or all of the available memory on the container instance, whichever comes first.
At least one of memoryLimitMiB and memoryReservationMiB is required.
Note that this setting will be ignored if TaskImagesOptions is specified.
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. Only one of TaskDefinition or TaskImageOptions must be specified.
virtual Ec2TaskDefinition TaskDefinition { get; }
Property Value
Remarks
[disable-awslint:ref-via-interface]
Default: - none