Interface NetworkMultipleTargetGroupsEc2ServiceProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
,NetworkMultipleTargetGroupsServiceBaseProps
- All Known Implementing Classes:
NetworkMultipleTargetGroupsEc2ServiceProps.Jsii$Proxy
Example:
// Two network load balancers, each with their own listener and target group. Cluster cluster; NetworkMultipleTargetGroupsEc2Service loadBalancedEc2Service = NetworkMultipleTargetGroupsEc2Service.Builder.create(this, "Service") .cluster(cluster) .memoryLimitMiB(256) .taskImageOptions(NetworkLoadBalancedTaskImageProps.builder() .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample")) .build()) .loadBalancers(List.of(NetworkLoadBalancerProps.builder() .name("lb1") .listeners(List.of(NetworkListenerProps.builder() .name("listener1") .build())) .build(), NetworkLoadBalancerProps.builder() .name("lb2") .listeners(List.of(NetworkListenerProps.builder() .name("listener2") .build())) .build())) .targetGroups(List.of(NetworkTargetProps.builder() .containerPort(80) .listener("listener1") .build(), NetworkTargetProps.builder() .containerPort(90) .listener("listener2") .build())) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forNetworkMultipleTargetGroupsEc2ServiceProps
static final class
An implementation forNetworkMultipleTargetGroupsEc2ServiceProps
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default Number
getCpu()
The minimum number of CPU units to reserve for the container.default Number
The amount (in MiB) of memory to present to the container.default Number
The soft limit (in MiB) of memory to reserve for the container.default List<PlacementConstraint>
The placement constraints to use for tasks in the service.default List<PlacementStrategy>
The placement strategies to use for tasks in the service.default Ec2TaskDefinition
The task definition to use for tasks in the service.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
Methods inherited from interface software.amazon.awscdk.services.ecs.patterns.NetworkMultipleTargetGroupsServiceBaseProps
getCloudMapOptions, getCluster, getDesiredCount, getEnableECSManagedTags, getHealthCheckGracePeriod, getLoadBalancers, getPropagateTags, getServiceName, getTargetGroups, getTaskImageOptions, getVpc
-
Method Details
-
getCpu
The minimum number of CPU units to reserve for the container.Valid values, which determines your range of valid values for the memory parameter:
Default: - No minimum CPU units reserved.
-
getMemoryLimitMiB
The amount (in MiB) of memory to present to the container.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.
-
getMemoryReservationMiB
The soft limit (in MiB) of memory to reserve for the container.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.
-
getPlacementConstraints
The placement constraints to use for tasks in the service.For more information, see Amazon ECS Task Placement Constraints.
Default: - No constraints.
-
getPlacementStrategies
The placement strategies to use for tasks in the service.For more information, see Amazon ECS Task Placement Strategies.
Default: - No strategies.
-
getTaskDefinition
The task definition to use for tasks in the service. Only one of TaskDefinition or TaskImageOptions must be specified.[disable-awslint:ref-via-interface]
Default: - none
-
builder
-