Interface NetworkLoadBalancedEc2ServiceProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
,NetworkLoadBalancedServiceBaseProps
- All Known Implementing Classes:
NetworkLoadBalancedEc2ServiceProps.Jsii$Proxy
Example:
import software.amazon.awscdk.services.certificatemanager.Certificate; Cluster cluster; ICertificate certificate = Certificate.fromCertificateArn(this, "Cert", "arn:aws:acm:us-east-1:123456:certificate/abcdefg"); NetworkLoadBalancedEc2Service loadBalancedEcsService = NetworkLoadBalancedEc2Service.Builder.create(this, "Service") .cluster(cluster) .memoryLimitMiB(1024) // The default value of listenerPort is 443 if you pass in listenerCertificate // It is configured to port 4443 here .listenerPort(4443) .listenerCertificate(certificate) .taskImageOptions(NetworkLoadBalancedTaskImageOptions.builder() .image(ContainerImage.fromRegistry("test")) // The default value of containerPort is 443 if you pass in listenerCertificate // It is configured to port 8443 here .containerPort(8443) .environment(Map.of( "TEST_ENVIRONMENT_VARIABLE1", "test environment variable 1 value", "TEST_ENVIRONMENT_VARIABLE2", "test environment variable 2 value")) .build()) .desiredCount(2) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forNetworkLoadBalancedEc2ServiceProps
static final class
An implementation forNetworkLoadBalancedEc2ServiceProps
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default Number
getCpu()
The number of cpu units used by the task.default Number
The hard limit (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.NetworkLoadBalancedServiceBaseProps
getCapacityProviderStrategies, getCircuitBreaker, getCloudMapOptions, getCluster, getDeploymentController, getDesiredCount, getDomainName, getDomainZone, getEnableECSManagedTags, getEnableExecuteCommand, getHealthCheckGracePeriod, getIpAddressType, getListenerCertificate, getListenerPort, getLoadBalancer, getMaxHealthyPercent, getMinHealthyPercent, getPropagateTags, getPublicLoadBalancer, getRecordType, getServiceName, getTaskImageOptions, getVpc
-
Method Details
-
getCpu
The number of cpu units used by the task.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
-
getMemoryLimitMiB
The hard limit (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 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.
-
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. TaskDefinition or TaskImageOptions must be specified, but not both..[disable-awslint:ref-via-interface]
Default: - none
-
builder
-