Class FargateService
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.ecs.BaseService
software.amazon.awscdk.services.ecs.FargateService
- All Implemented Interfaces:
IConstruct,IDependable,IResource,IConnectable,IBaseService,IFargateService,IService,ILoadBalancerTarget,IApplicationLoadBalancerTarget,INetworkLoadBalancerTarget,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.342Z")
@Stability(Stable)
public class FargateService
extends BaseService
implements IFargateService
This creates a service using the Fargate launch type on an ECS cluster.
Example:
Cluster cluster;
TaskDefinition taskDefinition;
Vpc vpc;
FargateService service = FargateService.Builder.create(this, "Service").cluster(cluster).taskDefinition(taskDefinition).build();
ApplicationLoadBalancer lb = ApplicationLoadBalancer.Builder.create(this, "LB").vpc(vpc).internetFacing(true).build();
ApplicationListener listener = lb.addListener("Listener", BaseApplicationListenerProps.builder().port(80).build());
service.registerLoadBalancerTargets(EcsTarget.builder()
.containerName("web")
.containerPort(80)
.newTargetGroupId("ECS")
.listener(ListenerConfig.applicationListener(listener, AddApplicationTargetsProps.builder()
.protocol(ApplicationProtocol.HTTPS)
.build()))
.build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.IApplicationLoadBalancerTarget
IApplicationLoadBalancerTarget.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.IBaseService
IBaseService.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.IFargateService
IFargateService.Jsii$Default, IFargateService.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancing.ILoadBalancerTarget
ILoadBalancerTarget.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.INetworkLoadBalancerTarget
INetworkLoadBalancerTarget.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFargateService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedFargateService(software.amazon.jsii.JsiiObjectRef objRef) FargateService(software.constructs.Construct scope, String id, FargateServiceProps props) Constructs a new instance of the FargateService class. -
Method Summary
Modifier and TypeMethodDescriptionstatic IFargateServicefromFargateServiceArn(software.constructs.Construct scope, String id, String fargateServiceArn) Imports from the specified service ARN.static IBaseServicefromFargateServiceAttributes(software.constructs.Construct scope, String id, FargateServiceAttributes attrs) Imports from the specified service attributes.Methods inherited from class software.amazon.awscdk.services.ecs.BaseService
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, setServiceRegistriesMethods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.Construct
toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.core.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.awscdk.services.ecs.IService
getServiceArn, getServiceNameMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
FargateService
protected FargateService(software.amazon.jsii.JsiiObjectRef objRef) -
FargateService
protected FargateService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
FargateService
@Stability(Stable) public FargateService(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull FargateServiceProps props) Constructs a new instance of the FargateService class.- Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromFargateServiceArn
@Stability(Stable) @NotNull public static IFargateService fromFargateServiceArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String fargateServiceArn) Imports from the specified service ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.fargateServiceArn- This parameter is required.
-
fromFargateServiceAttributes
@Stability(Stable) @NotNull public static IBaseService fromFargateServiceAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull FargateServiceAttributes attrs) Imports from the specified service attributes.- Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-