@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.691Z") @Stability(value=Stable) public class Ec2Service extends BaseService implements IEc2Service
Example:
Cluster cluster;
TaskDefinition taskDefinition;
Vpc vpc;
Ec2Service service = Ec2Service.Builder.create(this, "Service").cluster(cluster).taskDefinition(taskDefinition).build();
LoadBalancer lb = LoadBalancer.Builder.create(this, "LB").vpc(vpc).build();
lb.addListener(LoadBalancerListener.builder().externalPort(80).build());
lb.addTarget(service.loadBalancerTarget(LoadBalancerTargetOptions.builder()
.containerName("MyContainer")
.containerPort(80)
.build()));
| Modifier and Type | Class and Description |
|---|---|
static class |
Ec2Service.Builder
A fluent builder for
Ec2Service. |
software.amazon.jsii.JsiiObject.InitializationModeIEc2Service.Jsii$Default, IEc2Service.Jsii$ProxyIBaseService.Jsii$DefaultIApplicationLoadBalancerTarget.Jsii$DefaultINetworkLoadBalancerTarget.Jsii$DefaultILoadBalancerTarget.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
Ec2Service(software.constructs.Construct scope,
String id,
Ec2ServiceProps props)
Constructs a new instance of the Ec2Service class.
|
protected |
Ec2Service(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Ec2Service(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPlacementConstraints(PlacementConstraint... constraints)
Adds one or more placement constraints to use for tasks in the service.
|
void |
addPlacementStrategies(PlacementStrategy... strategies)
Adds one or more placement strategies to use for tasks in the service.
|
static IEc2Service |
fromEc2ServiceArn(software.constructs.Construct scope,
String id,
String ec2ServiceArn)
Imports from the specified service ARN.
|
static IBaseService |
fromEc2ServiceAttributes(software.constructs.Construct scope,
String id,
Ec2ServiceAttributes attrs)
Imports from the specified service attributes.
|
associateCloudMapService, attachToApplicationTargetGroup, attachToClassicLB, attachToNetworkTargetGroup, autoScaleTaskCount, configureAwsVpcNetworkingWithSecurityGroups, configureAwsVpcNetworkingWithSecurityGroups, configureAwsVpcNetworkingWithSecurityGroups, configureAwsVpcNetworkingWithSecurityGroups, enableCloudMap, fromServiceArnWithCluster, getCloudmapService, getCloudMapService, getCluster, getConnections, getLoadBalancers, getNetworkConfiguration, getServiceArn, getServiceName, getServiceRegistries, getTaskDefinition, loadBalancerTarget, metric, metric, metricCpuUtilization, metricCpuUtilization, metricMemoryUtilization, metricMemoryUtilization, registerLoadBalancerTargets, setCloudmapService, setLoadBalancers, setNetworkConfiguration, setServiceRegistriesapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetServiceArn, getServiceNameapplyRemovalPolicy, getEnv, getStackprotected Ec2Service(software.amazon.jsii.JsiiObjectRef objRef)
protected Ec2Service(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public Ec2Service(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
Ec2ServiceProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public static IEc2Service fromEc2ServiceArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String ec2ServiceArn)
scope - This parameter is required.id - This parameter is required.ec2ServiceArn - This parameter is required.@Stability(value=Stable) @NotNull public static IBaseService fromEc2ServiceAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull Ec2ServiceAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Stable)
public void addPlacementConstraints(@NotNull
PlacementConstraint... constraints)
For more information, see Amazon ECS Task Placement Constraints.
constraints - This parameter is required.@Stability(value=Stable)
public void addPlacementStrategies(@NotNull
PlacementStrategy... strategies)
For more information, see Amazon ECS Task Placement Strategies.
strategies - This parameter is required.Copyright © 2022. All rights reserved.