@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-09T19:16:43.873Z") 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 . |
IEc2Service.Jsii$Default, IEc2Service.Jsii$Proxy
IBaseService.Jsii$Default
IApplicationLoadBalancerTarget.Jsii$Default
INetworkLoadBalancerTarget.Jsii$Default
ILoadBalancerTarget.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
Ec2Service(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Ec2Service(software.amazon.jsii.JsiiObjectRef objRef) |
|
Ec2Service(software.constructs.Construct scope,
java.lang.String id,
Ec2ServiceProps props)
Constructs a new instance of the Ec2Service class.
|
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,
java.lang.String id,
java.lang.String ec2ServiceArn)
Imports from the specified service ARN.
|
static IBaseService |
fromEc2ServiceAttributes(software.constructs.Construct scope,
java.lang.String id,
Ec2ServiceAttributes attrs)
Imports from the specified service attributes.
|
protected java.util.List<java.lang.String> |
validate()
Validates this Ec2Service.
|
associateCloudMapService, attachToApplicationTargetGroup, attachToClassicLB, attachToNetworkTargetGroup, autoScaleTaskCount, configureAwsVpcNetworking, configureAwsVpcNetworking, configureAwsVpcNetworking, configureAwsVpcNetworking, 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, setServiceRegistries
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getServiceArn, getServiceName
applyRemovalPolicy, getEnv, getStack
getNode
protected Ec2Service(software.amazon.jsii.JsiiObjectRef objRef)
protected Ec2Service(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public Ec2Service(software.constructs.Construct scope, java.lang.String id, Ec2ServiceProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public static IEc2Service fromEc2ServiceArn(software.constructs.Construct scope, java.lang.String id, java.lang.String ec2ServiceArn)
scope
- This parameter is required.id
- This parameter is required.ec2ServiceArn
- This parameter is required.public static IBaseService fromEc2ServiceAttributes(software.constructs.Construct scope, java.lang.String id, Ec2ServiceAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public void addPlacementConstraints(PlacementConstraint... constraints)
For more information, see Amazon ECS Task Placement Constraints.
constraints
- This parameter is required.public void addPlacementStrategies(PlacementStrategy... strategies)
For more information, see Amazon ECS Task Placement Strategies.
strategies
- This parameter is required.