Interface FargateServiceProps

All Superinterfaces:
BaseServiceOptions, software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
FargateServiceProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.345Z") @Stability(Stable) public interface FargateServiceProps extends software.amazon.jsii.JsiiSerializable, BaseServiceOptions
The properties for defining a service using the Fargate launch type.

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());
 
  • Method Details

    • getTaskDefinition

      @Stability(Stable) @NotNull TaskDefinition getTaskDefinition()
      The task definition to use for tasks in the service.

      [disable-awslint:ref-via-interface]

    • getAssignPublicIp

      @Stability(Stable) @Nullable default Boolean getAssignPublicIp()
      Specifies whether the task's elastic network interface receives a public IP address.

      If true, each task will receive a public IP address.

      Default: false

    • getPlatformVersion

      @Stability(Stable) @Nullable default FargatePlatformVersion getPlatformVersion()
      The platform version on which to run your service.

      If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.

      Default: Latest

    • getSecurityGroup

      @Stability(Deprecated) @Deprecated @Nullable default ISecurityGroup getSecurityGroup()
      Deprecated.
      use securityGroups instead.
      (deprecated) The security groups to associate with the service.

      If you do not specify a security group, a new security group is created.

      Default: - A new security group is created.

    • getSecurityGroups

      @Stability(Stable) @Nullable default List<ISecurityGroup> getSecurityGroups()
      The security groups to associate with the service.

      If you do not specify a security group, a new security group is created.

      Default: - A new security group is created.

    • getVpcSubnets

      @Stability(Stable) @Nullable default SubnetSelection getVpcSubnets()
      The subnets to associate with the service.

      Default: - Public subnets if `assignPublicIp` is set, otherwise the first available one of Private, Isolated, Public, in that order.

    • builder

      @Stability(Stable) static FargateServiceProps.Builder builder()
      Returns:
      a FargateServiceProps.Builder of FargateServiceProps