Class NetworkLoadBalancedEc2Service
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.services.ecs.patterns.NetworkLoadBalancedServiceBase
software.amazon.awscdk.services.ecs.patterns.NetworkLoadBalancedEc2Service
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-27T16:50:57.166Z")
@Stability(Stable)
public class NetworkLoadBalancedEc2Service
extends NetworkLoadBalancedServiceBase
An EC2 service running on an ECS cluster fronted by a network load balancer.
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 TypeClassDescriptionstatic final class
A fluent builder forNetworkLoadBalancedEc2Service
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
NetworkLoadBalancedEc2Service
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
NetworkLoadBalancedEc2Service
(software.amazon.jsii.JsiiObjectRef objRef) NetworkLoadBalancedEc2Service
(software.constructs.Construct scope, String id) Constructs a new instance of the NetworkLoadBalancedEc2Service class.NetworkLoadBalancedEc2Service
(software.constructs.Construct scope, String id, NetworkLoadBalancedEc2ServiceProps props) Constructs a new instance of the NetworkLoadBalancedEc2Service class. -
Method Summary
Modifier and TypeMethodDescriptionThe ECS service in this construct.The EC2 Task Definition in this construct.Methods inherited from class software.amazon.awscdk.services.ecs.patterns.NetworkLoadBalancedServiceBase
addServiceAsTarget, createAWSLogDriver, getCluster, getDefaultCluster, getDefaultCluster, getInternalDesiredCount, getListener, getLoadBalancer, getTargetGroup
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
NetworkLoadBalancedEc2Service
protected NetworkLoadBalancedEc2Service(software.amazon.jsii.JsiiObjectRef objRef) -
NetworkLoadBalancedEc2Service
protected NetworkLoadBalancedEc2Service(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
NetworkLoadBalancedEc2Service
@Stability(Stable) public NetworkLoadBalancedEc2Service(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable NetworkLoadBalancedEc2ServiceProps props) Constructs a new instance of the NetworkLoadBalancedEc2Service class.- Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
NetworkLoadBalancedEc2Service
@Stability(Stable) public NetworkLoadBalancedEc2Service(@NotNull software.constructs.Construct scope, @NotNull String id) Constructs a new instance of the NetworkLoadBalancedEc2Service class.- Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
getService
The ECS service in this construct. -
getTaskDefinition
The EC2 Task Definition in this construct.
-