Class FargateService.Builder

java.lang.Object
software.amazon.awscdk.services.ecs.FargateService.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<FargateService>
Enclosing class:
FargateService

@Stability(Stable) public static final class FargateService.Builder extends Object implements software.amazon.jsii.Builder<FargateService>
A fluent builder for FargateService.
  • Method Details

    • create

      @Stability(Stable) public static FargateService.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of FargateService.Builder.
    • cluster

      @Stability(Stable) public FargateService.Builder cluster(ICluster cluster)
      The name of the cluster that hosts the service.

      Parameters:
      cluster - The name of the cluster that hosts the service. This parameter is required.
      Returns:
      this
    • capacityProviderStrategies

      @Stability(Stable) public FargateService.Builder capacityProviderStrategies(List<? extends CapacityProviderStrategy> capacityProviderStrategies)
      A list of Capacity Provider strategies used to place a service.

      Default: - undefined

      Parameters:
      capacityProviderStrategies - A list of Capacity Provider strategies used to place a service. This parameter is required.
      Returns:
      this
    • circuitBreaker

      @Stability(Stable) public FargateService.Builder circuitBreaker(DeploymentCircuitBreaker circuitBreaker)
      Whether to enable the deployment circuit breaker.

      If this property is defined, circuit breaker will be implicitly enabled.

      Default: - disabled

      Parameters:
      circuitBreaker - Whether to enable the deployment circuit breaker. This parameter is required.
      Returns:
      this
    • cloudMapOptions

      @Stability(Stable) public FargateService.Builder cloudMapOptions(CloudMapOptions cloudMapOptions)
      The options for configuring an Amazon ECS service to use service discovery.

      Default: - AWS Cloud Map service discovery is not enabled.

      Parameters:
      cloudMapOptions - The options for configuring an Amazon ECS service to use service discovery. This parameter is required.
      Returns:
      this
    • deploymentAlarms

      @Stability(Stable) public FargateService.Builder deploymentAlarms(DeploymentAlarmConfig deploymentAlarms)
      The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time.

      Default: - No alarms will be monitored during deployment.

      Parameters:
      deploymentAlarms - The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. This parameter is required.
      Returns:
      this
    • deploymentController

      @Stability(Stable) public FargateService.Builder deploymentController(DeploymentController deploymentController)
      Specifies which deployment controller to use for the service.

      For more information, see Amazon ECS Deployment Types

      Default: - Rolling update (ECS)

      Parameters:
      deploymentController - Specifies which deployment controller to use for the service. This parameter is required.
      Returns:
      this
    • desiredCount

      @Stability(Stable) public FargateService.Builder desiredCount(Number desiredCount)
      The desired number of instantiations of the task definition to keep running on the service.

      Default: - When creating the service, default is 1; when updating the service, default uses the current task number.

      Parameters:
      desiredCount - The desired number of instantiations of the task definition to keep running on the service. This parameter is required.
      Returns:
      this
    • enableEcsManagedTags

      @Stability(Stable) public FargateService.Builder enableEcsManagedTags(Boolean enableEcsManagedTags)
      Specifies whether to enable Amazon ECS managed tags for the tasks within the service.

      For more information, see Tagging Your Amazon ECS Resources

      Default: false

      Parameters:
      enableEcsManagedTags - Specifies whether to enable Amazon ECS managed tags for the tasks within the service. This parameter is required.
      Returns:
      this
    • enableExecuteCommand

      @Stability(Stable) public FargateService.Builder enableExecuteCommand(Boolean enableExecuteCommand)
      Whether to enable the ability to execute into a container.

      Default: - undefined

      Parameters:
      enableExecuteCommand - Whether to enable the ability to execute into a container. This parameter is required.
      Returns:
      this
    • healthCheckGracePeriod

      @Stability(Stable) public FargateService.Builder healthCheckGracePeriod(Duration healthCheckGracePeriod)
      The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.

      Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set

      Parameters:
      healthCheckGracePeriod - The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. This parameter is required.
      Returns:
      this
    • maxHealthyPercent

      @Stability(Stable) public FargateService.Builder maxHealthyPercent(Number maxHealthyPercent)
      The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.

      Default: - 100 if daemon, otherwise 200

      Parameters:
      maxHealthyPercent - The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. This parameter is required.
      Returns:
      this
    • minHealthyPercent

      @Stability(Stable) public FargateService.Builder minHealthyPercent(Number minHealthyPercent)
      The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.

      Default: - 0 if daemon, otherwise 50

      Parameters:
      minHealthyPercent - The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. This parameter is required.
      Returns:
      this
    • propagateTags

      @Stability(Stable) public FargateService.Builder propagateTags(PropagatedTagSource propagateTags)
      Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.

      Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE

      Default: PropagatedTagSource.NONE

      Parameters:
      propagateTags - Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. This parameter is required.
      Returns:
      this
    • serviceConnectConfiguration

      @Stability(Stable) public FargateService.Builder serviceConnectConfiguration(ServiceConnectProps serviceConnectConfiguration)
      Configuration for Service Connect.

      Default: No ports are advertised via Service Connect on this service, and the service cannot make requests to other services via Service Connect.

      Parameters:
      serviceConnectConfiguration - Configuration for Service Connect. This parameter is required.
      Returns:
      this
    • serviceName

      @Stability(Stable) public FargateService.Builder serviceName(String serviceName)
      The name of the service.

      Default: - CloudFormation-generated name.

      Parameters:
      serviceName - The name of the service. This parameter is required.
      Returns:
      this
    • taskDefinitionRevision

      @Stability(Stable) public FargateService.Builder taskDefinitionRevision(TaskDefinitionRevision taskDefinitionRevision)
      Revision number for the task definition or latest to use the latest active task revision.

      Default: - Uses the revision of the passed task definition deployed by CloudFormation

      Parameters:
      taskDefinitionRevision - Revision number for the task definition or latest to use the latest active task revision. This parameter is required.
      Returns:
      this
    • volumeConfigurations

      @Stability(Stable) public FargateService.Builder volumeConfigurations(List<? extends ServiceManagedVolume> volumeConfigurations)
      Configuration details for a volume used by the service.

      This allows you to specify details about the EBS volume that can be attched to ECS tasks.

      Default: - undefined

      Parameters:
      volumeConfigurations - Configuration details for a volume used by the service. This parameter is required.
      Returns:
      this
    • taskDefinition

      @Stability(Stable) public FargateService.Builder taskDefinition(TaskDefinition taskDefinition)
      The task definition to use for tasks in the service.

      [disable-awslint:ref-via-interface]

      Parameters:
      taskDefinition - The task definition to use for tasks in the service. This parameter is required.
      Returns:
      this
    • assignPublicIp

      @Stability(Stable) public FargateService.Builder assignPublicIp(Boolean assignPublicIp)
      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

      Parameters:
      assignPublicIp - Specifies whether the task's elastic network interface receives a public IP address. This parameter is required.
      Returns:
      this
    • platformVersion

      @Stability(Stable) public FargateService.Builder platformVersion(FargatePlatformVersion platformVersion)
      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

      Parameters:
      platformVersion - The platform version on which to run your service. This parameter is required.
      Returns:
      this
    • securityGroups

      @Stability(Stable) public FargateService.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      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.

      Parameters:
      securityGroups - The security groups to associate with the service. This parameter is required.
      Returns:
      this
    • vpcSubnets

      @Stability(Stable) public FargateService.Builder vpcSubnets(SubnetSelection vpcSubnets)
      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.

      Parameters:
      vpcSubnets - The subnets to associate with the service. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public FargateService build()
      Specified by:
      build in interface software.amazon.jsii.Builder<FargateService>
      Returns:
      a newly built instance of FargateService.