{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ECS.UpdateService
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies the parameters of a service.
--
-- For services using the rolling update (@ECS@) you can update the desired
-- count, deployment configuration, network configuration, load balancers,
-- service registries, enable ECS managed tags option, propagate tags
-- option, task placement constraints and strategies, and task definition.
-- When you update any of these parameters, Amazon ECS starts new tasks
-- with the new configuration.
--
-- For services using the blue\/green (@CODE_DEPLOY@) deployment
-- controller, only the desired count, deployment configuration, health
-- check grace period, task placement constraints and strategies, enable
-- ECS managed tags option, and propagate tags can be updated using this
-- API. If the network configuration, platform version, task definition, or
-- load balancer need to be updated, create a new CodeDeploy deployment.
-- For more information, see
-- <https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeployment.html CreateDeployment>
-- in the /CodeDeploy API Reference/.
--
-- For services using an external deployment controller, you can update
-- only the desired count, task placement constraints and strategies,
-- health check grace period, enable ECS managed tags option, and propagate
-- tags option, using this API. If the launch type, load balancer, network
-- configuration, platform version, or task definition need to be updated,
-- create a new task set For more information, see CreateTaskSet.
--
-- You can add to or subtract from the number of instantiations of a task
-- definition in a service by specifying the cluster that the service is
-- running in and a new @desiredCount@ parameter.
--
-- If you have updated the Docker image of your application, you can create
-- a new task definition with that image and deploy it to your service. The
-- service scheduler uses the minimum healthy percent and maximum percent
-- parameters (in the service\'s deployment configuration) to determine the
-- deployment strategy.
--
-- If your updated Docker image uses the same tag as what is in the
-- existing task definition for your service (for example,
-- @my_image:latest@), you don\'t need to create a new revision of your
-- task definition. You can update the service using the
-- @forceNewDeployment@ option. The new tasks launched by the deployment
-- pull the current image\/tag combination from your repository when they
-- start.
--
-- You can also update the deployment configuration of a service. When a
-- deployment is triggered by updating the task definition of a service,
-- the service scheduler uses the deployment configuration parameters,
-- @minimumHealthyPercent@ and @maximumPercent@, to determine the
-- deployment strategy.
--
-- -   If @minimumHealthyPercent@ is below 100%, the scheduler can ignore
--     @desiredCount@ temporarily during a deployment. For example, if
--     @desiredCount@ is four tasks, a minimum of 50% allows the scheduler
--     to stop two existing tasks before starting two new tasks. Tasks for
--     services that don\'t use a load balancer are considered healthy if
--     they\'re in the @RUNNING@ state. Tasks for services that use a load
--     balancer are considered healthy if they\'re in the @RUNNING@ state
--     and are reported as healthy by the load balancer.
--
-- -   The @maximumPercent@ parameter represents an upper limit on the
--     number of running tasks during a deployment. You can use it to
--     define the deployment batch size. For example, if @desiredCount@ is
--     four tasks, a maximum of 200% starts four new tasks before stopping
--     the four older tasks (provided that the cluster resources required
--     to do this are available).
--
-- When UpdateService stops a task during a deployment, the equivalent of
-- @docker stop@ is issued to the containers running in the task. This
-- results in a @SIGTERM@ and a 30-second timeout. After this, @SIGKILL@ is
-- sent and the containers are forcibly stopped. If the container handles
-- the @SIGTERM@ gracefully and exits within 30 seconds from receiving it,
-- no @SIGKILL@ is sent.
--
-- When the service scheduler launches new tasks, it determines task
-- placement in your cluster with the following logic.
--
-- -   Determine which of the container instances in your cluster can
--     support your service\'s task definition. For example, they have the
--     required CPU, memory, ports, and container instance attributes.
--
-- -   By default, the service scheduler attempts to balance tasks across
--     Availability Zones in this manner even though you can choose a
--     different placement strategy.
--
--     -   Sort the valid container instances by the fewest number of
--         running tasks for this service in the same Availability Zone as
--         the instance. For example, if zone A has one running service
--         task and zones B and C each have zero, valid container instances
--         in either zone B or C are considered optimal for placement.
--
--     -   Place the new service task on a valid container instance in an
--         optimal Availability Zone (based on the previous steps),
--         favoring container instances with the fewest number of running
--         tasks for this service.
--
-- When the service scheduler stops running tasks, it attempts to maintain
-- balance across the Availability Zones in your cluster using the
-- following logic:
--
-- -   Sort the container instances by the largest number of running tasks
--     for this service in the same Availability Zone as the instance. For
--     example, if zone A has one running service task and zones B and C
--     each have two, container instances in either zone B or C are
--     considered optimal for termination.
--
-- -   Stop the task on a container instance in an optimal Availability
--     Zone (based on the previous steps), favoring container instances
--     with the largest number of running tasks for this service.
--
-- You must have a service-linked role when you update any of the following
-- service properties. If you specified a custom IAM role when you created
-- the service, Amazon ECS automatically replaces the
-- <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Service.html#ECS-Type-Service-roleArn roleARN>
-- associated with the service with the ARN of your service-linked role.
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html Service-linked roles>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- -   @loadBalancers,@
--
-- -   @serviceRegistries@
module Amazonka.ECS.UpdateService
  ( -- * Creating a Request
    UpdateService (..),
    newUpdateService,

    -- * Request Lenses
    updateService_capacityProviderStrategy,
    updateService_cluster,
    updateService_deploymentConfiguration,
    updateService_desiredCount,
    updateService_enableECSManagedTags,
    updateService_enableExecuteCommand,
    updateService_forceNewDeployment,
    updateService_healthCheckGracePeriodSeconds,
    updateService_loadBalancers,
    updateService_networkConfiguration,
    updateService_placementConstraints,
    updateService_placementStrategy,
    updateService_platformVersion,
    updateService_propagateTags,
    updateService_serviceConnectConfiguration,
    updateService_serviceRegistries,
    updateService_taskDefinition,
    updateService_service,

    -- * Destructuring the Response
    UpdateServiceResponse (..),
    newUpdateServiceResponse,

    -- * Response Lenses
    updateServiceResponse_service,
    updateServiceResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ECS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateService' smart constructor.
data UpdateService = UpdateService'
  { -- | The capacity provider strategy to update the service to use.
    --
    -- if the service uses the default capacity provider strategy for the
    -- cluster, the service can be updated to use one or more capacity
    -- providers as opposed to the default capacity provider strategy. However,
    -- when a service is using a capacity provider strategy that\'s not the
    -- default capacity provider strategy, the service can\'t be updated to use
    -- the cluster\'s default capacity provider strategy.
    --
    -- A capacity provider strategy consists of one or more capacity providers
    -- along with the @base@ and @weight@ to assign to them. A capacity
    -- provider must be associated with the cluster to be used in a capacity
    -- provider strategy. The PutClusterCapacityProviders API is used to
    -- associate a capacity provider with a cluster. Only capacity providers
    -- with an @ACTIVE@ or @UPDATING@ status can be used.
    --
    -- If specifying a capacity provider that uses an Auto Scaling group, the
    -- capacity provider must already be created. New capacity providers can be
    -- created with the CreateCapacityProvider API operation.
    --
    -- To use a Fargate capacity provider, specify either the @FARGATE@ or
    -- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
    -- available to all accounts and only need to be associated with a cluster
    -- to be used.
    --
    -- The PutClusterCapacityProviders API operation is used to update the list
    -- of available capacity providers for a cluster after the cluster is
    -- created.
    UpdateService -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Prelude.Maybe [CapacityProviderStrategyItem],
    -- | The short name or full Amazon Resource Name (ARN) of the cluster that
    -- your service runs on. If you do not specify a cluster, the default
    -- cluster is assumed.
    UpdateService -> Maybe Text
cluster :: Prelude.Maybe Prelude.Text,
    -- | Optional deployment parameters that control how many tasks run during
    -- the deployment and the ordering of stopping and starting tasks.
    UpdateService -> Maybe DeploymentConfiguration
deploymentConfiguration :: Prelude.Maybe DeploymentConfiguration,
    -- | The number of instantiations of the task to place and keep running in
    -- your service.
    UpdateService -> Maybe Int
desiredCount :: Prelude.Maybe Prelude.Int,
    -- | Determines whether to turn on Amazon ECS managed tags for the tasks in
    -- the service. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html Tagging Your Amazon ECS Resources>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    --
    -- Only tasks launched after the update will reflect the update. To update
    -- the tags on all tasks, set @forceNewDeployment@ to @true@, so that
    -- Amazon ECS starts new tasks with the updated tags.
    UpdateService -> Maybe Bool
enableECSManagedTags :: Prelude.Maybe Prelude.Bool,
    -- | If @true@, this enables execute command functionality on all task
    -- containers.
    --
    -- If you do not want to override the value that was set when the service
    -- was created, you can set this to @null@ when performing this action.
    UpdateService -> Maybe Bool
enableExecuteCommand :: Prelude.Maybe Prelude.Bool,
    -- | Determines whether to force a new deployment of the service. By default,
    -- deployments aren\'t forced. You can use this option to start a new
    -- deployment with no service definition changes. For example, you can
    -- update a service\'s tasks to use a newer Docker image with the same
    -- image\/tag combination (@my_image:latest@) or to roll Fargate tasks onto
    -- a newer platform version.
    UpdateService -> Maybe Bool
forceNewDeployment :: Prelude.Maybe Prelude.Bool,
    -- | 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 is only valid if your service is configured
    -- to use a load balancer. If your service\'s tasks take a while to start
    -- and respond to Elastic Load Balancing health checks, you can specify a
    -- health check grace period of up to 2,147,483,647 seconds. During that
    -- time, the Amazon ECS service scheduler ignores the Elastic Load
    -- Balancing health check status. This grace period can prevent the ECS
    -- service scheduler from marking tasks as unhealthy and stopping them
    -- before they have time to come up.
    UpdateService -> Maybe Int
healthCheckGracePeriodSeconds :: Prelude.Maybe Prelude.Int,
    -- | A list of Elastic Load Balancing load balancer objects. It contains the
    -- load balancer name, the container name, and the container port to access
    -- from the load balancer. The container name is as it appears in a
    -- container definition.
    --
    -- When you add, update, or remove a load balancer configuration, Amazon
    -- ECS starts new tasks with the updated Elastic Load Balancing
    -- configuration, and then stops the old tasks when the new tasks are
    -- running.
    --
    -- For services that use rolling updates, you can add, update, or remove
    -- Elastic Load Balancing target groups. You can update from a single
    -- target group to multiple target groups and from multiple target groups
    -- to a single target group.
    --
    -- For services that use blue\/green deployments, you can update Elastic
    -- Load Balancing target groups by using
    -- @ @<https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeployment.html CreateDeployment>@ @
    -- through CodeDeploy. Note that multiple target groups are not supported
    -- for blue\/green deployments. For more information see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html Register multiple target groups with a service>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    --
    -- For services that use the external deployment controller, you can add,
    -- update, or remove load balancers by using
    -- <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateTaskSet.html CreateTaskSet>.
    -- Note that multiple target groups are not supported for external
    -- deployments. For more information see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html Register multiple target groups with a service>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    --
    -- You can remove existing @loadBalancers@ by passing an empty list.
    UpdateService -> Maybe [LoadBalancer]
loadBalancers :: Prelude.Maybe [LoadBalancer],
    -- | An object representing the network configuration for the service.
    UpdateService -> Maybe NetworkConfiguration
networkConfiguration :: Prelude.Maybe NetworkConfiguration,
    -- | An array of task placement constraint objects to update the service to
    -- use. If no value is specified, the existing placement constraints for
    -- the service will remain unchanged. If this value is specified, it will
    -- override any existing placement constraints defined for the service. To
    -- remove all existing placement constraints, specify an empty array.
    --
    -- You can specify a maximum of 10 constraints for each task. This limit
    -- includes constraints in the task definition and those specified at
    -- runtime.
    UpdateService -> Maybe [PlacementConstraint]
placementConstraints :: Prelude.Maybe [PlacementConstraint],
    -- | The task placement strategy objects to update the service to use. If no
    -- value is specified, the existing placement strategy for the service will
    -- remain unchanged. If this value is specified, it will override the
    -- existing placement strategy defined for the service. To remove an
    -- existing placement strategy, specify an empty object.
    --
    -- You can specify a maximum of five strategy rules for each service.
    UpdateService -> Maybe [PlacementStrategy]
placementStrategy :: Prelude.Maybe [PlacementStrategy],
    -- | The platform version that your tasks in the service run on. A platform
    -- version is only specified for tasks using the Fargate launch type. If a
    -- platform version is not specified, the @LATEST@ platform version is
    -- used. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate Platform Versions>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    UpdateService -> Maybe Text
platformVersion :: Prelude.Maybe Prelude.Text,
    -- | Determines whether to propagate the tags from the task definition or the
    -- service to the task. If no value is specified, the tags aren\'t
    -- propagated.
    --
    -- Only tasks launched after the update will reflect the update. To update
    -- the tags on all tasks, set @forceNewDeployment@ to @true@, so that
    -- Amazon ECS starts new tasks with the updated tags.
    UpdateService -> Maybe PropagateTags
propagateTags :: Prelude.Maybe PropagateTags,
    -- | The configuration for this service to discover and connect to services,
    -- and be discovered by, and connected from, other services within a
    -- namespace.
    --
    -- Tasks that run in a namespace can use short names to connect to services
    -- in the namespace. Tasks can connect to services across all of the
    -- clusters in the namespace. Tasks connect through a managed proxy
    -- container that collects logs and metrics for increased visibility. Only
    -- the tasks that Amazon ECS services create are supported with Service
    -- Connect. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html Service Connect>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    UpdateService -> Maybe ServiceConnectConfiguration
serviceConnectConfiguration :: Prelude.Maybe ServiceConnectConfiguration,
    -- | The details for the service discovery registries to assign to this
    -- service. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html Service Discovery>.
    --
    -- When you add, update, or remove the service registries configuration,
    -- Amazon ECS starts new tasks with the updated service registries
    -- configuration, and then stops the old tasks when the new tasks are
    -- running.
    --
    -- You can remove existing @serviceRegistries@ by passing an empty list.
    UpdateService -> Maybe [ServiceRegistry]
serviceRegistries :: Prelude.Maybe [ServiceRegistry],
    -- | The @family@ and @revision@ (@family:revision@) or full ARN of the task
    -- definition to run in your service. If a @revision@ is not specified, the
    -- latest @ACTIVE@ revision is used. If you modify the task definition with
    -- @UpdateService@, Amazon ECS spawns a task with the new version of the
    -- task definition and then stops an old task after the new version is
    -- running.
    UpdateService -> Maybe Text
taskDefinition :: Prelude.Maybe Prelude.Text,
    -- | The name of the service to update.
    UpdateService -> Text
service :: Prelude.Text
  }
  deriving (UpdateService -> UpdateService -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateService -> UpdateService -> Bool
$c/= :: UpdateService -> UpdateService -> Bool
== :: UpdateService -> UpdateService -> Bool
$c== :: UpdateService -> UpdateService -> Bool
Prelude.Eq, ReadPrec [UpdateService]
ReadPrec UpdateService
Int -> ReadS UpdateService
ReadS [UpdateService]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateService]
$creadListPrec :: ReadPrec [UpdateService]
readPrec :: ReadPrec UpdateService
$creadPrec :: ReadPrec UpdateService
readList :: ReadS [UpdateService]
$creadList :: ReadS [UpdateService]
readsPrec :: Int -> ReadS UpdateService
$creadsPrec :: Int -> ReadS UpdateService
Prelude.Read, Int -> UpdateService -> ShowS
[UpdateService] -> ShowS
UpdateService -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateService] -> ShowS
$cshowList :: [UpdateService] -> ShowS
show :: UpdateService -> String
$cshow :: UpdateService -> String
showsPrec :: Int -> UpdateService -> ShowS
$cshowsPrec :: Int -> UpdateService -> ShowS
Prelude.Show, forall x. Rep UpdateService x -> UpdateService
forall x. UpdateService -> Rep UpdateService x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateService x -> UpdateService
$cfrom :: forall x. UpdateService -> Rep UpdateService x
Prelude.Generic)

-- |
-- Create a value of 'UpdateService' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'capacityProviderStrategy', 'updateService_capacityProviderStrategy' - The capacity provider strategy to update the service to use.
--
-- if the service uses the default capacity provider strategy for the
-- cluster, the service can be updated to use one or more capacity
-- providers as opposed to the default capacity provider strategy. However,
-- when a service is using a capacity provider strategy that\'s not the
-- default capacity provider strategy, the service can\'t be updated to use
-- the cluster\'s default capacity provider strategy.
--
-- A capacity provider strategy consists of one or more capacity providers
-- along with the @base@ and @weight@ to assign to them. A capacity
-- provider must be associated with the cluster to be used in a capacity
-- provider strategy. The PutClusterCapacityProviders API is used to
-- associate a capacity provider with a cluster. Only capacity providers
-- with an @ACTIVE@ or @UPDATING@ status can be used.
--
-- If specifying a capacity provider that uses an Auto Scaling group, the
-- capacity provider must already be created. New capacity providers can be
-- created with the CreateCapacityProvider API operation.
--
-- To use a Fargate capacity provider, specify either the @FARGATE@ or
-- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
-- available to all accounts and only need to be associated with a cluster
-- to be used.
--
-- The PutClusterCapacityProviders API operation is used to update the list
-- of available capacity providers for a cluster after the cluster is
-- created.
--
-- 'cluster', 'updateService_cluster' - The short name or full Amazon Resource Name (ARN) of the cluster that
-- your service runs on. If you do not specify a cluster, the default
-- cluster is assumed.
--
-- 'deploymentConfiguration', 'updateService_deploymentConfiguration' - Optional deployment parameters that control how many tasks run during
-- the deployment and the ordering of stopping and starting tasks.
--
-- 'desiredCount', 'updateService_desiredCount' - The number of instantiations of the task to place and keep running in
-- your service.
--
-- 'enableECSManagedTags', 'updateService_enableECSManagedTags' - Determines whether to turn on Amazon ECS managed tags for the tasks in
-- the service. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html Tagging Your Amazon ECS Resources>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- Only tasks launched after the update will reflect the update. To update
-- the tags on all tasks, set @forceNewDeployment@ to @true@, so that
-- Amazon ECS starts new tasks with the updated tags.
--
-- 'enableExecuteCommand', 'updateService_enableExecuteCommand' - If @true@, this enables execute command functionality on all task
-- containers.
--
-- If you do not want to override the value that was set when the service
-- was created, you can set this to @null@ when performing this action.
--
-- 'forceNewDeployment', 'updateService_forceNewDeployment' - Determines whether to force a new deployment of the service. By default,
-- deployments aren\'t forced. You can use this option to start a new
-- deployment with no service definition changes. For example, you can
-- update a service\'s tasks to use a newer Docker image with the same
-- image\/tag combination (@my_image:latest@) or to roll Fargate tasks onto
-- a newer platform version.
--
-- 'healthCheckGracePeriodSeconds', 'updateService_healthCheckGracePeriodSeconds' - 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 is only valid if your service is configured
-- to use a load balancer. If your service\'s tasks take a while to start
-- and respond to Elastic Load Balancing health checks, you can specify a
-- health check grace period of up to 2,147,483,647 seconds. During that
-- time, the Amazon ECS service scheduler ignores the Elastic Load
-- Balancing health check status. This grace period can prevent the ECS
-- service scheduler from marking tasks as unhealthy and stopping them
-- before they have time to come up.
--
-- 'loadBalancers', 'updateService_loadBalancers' - A list of Elastic Load Balancing load balancer objects. It contains the
-- load balancer name, the container name, and the container port to access
-- from the load balancer. The container name is as it appears in a
-- container definition.
--
-- When you add, update, or remove a load balancer configuration, Amazon
-- ECS starts new tasks with the updated Elastic Load Balancing
-- configuration, and then stops the old tasks when the new tasks are
-- running.
--
-- For services that use rolling updates, you can add, update, or remove
-- Elastic Load Balancing target groups. You can update from a single
-- target group to multiple target groups and from multiple target groups
-- to a single target group.
--
-- For services that use blue\/green deployments, you can update Elastic
-- Load Balancing target groups by using
-- @ @<https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeployment.html CreateDeployment>@ @
-- through CodeDeploy. Note that multiple target groups are not supported
-- for blue\/green deployments. For more information see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html Register multiple target groups with a service>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- For services that use the external deployment controller, you can add,
-- update, or remove load balancers by using
-- <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateTaskSet.html CreateTaskSet>.
-- Note that multiple target groups are not supported for external
-- deployments. For more information see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html Register multiple target groups with a service>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- You can remove existing @loadBalancers@ by passing an empty list.
--
-- 'networkConfiguration', 'updateService_networkConfiguration' - An object representing the network configuration for the service.
--
-- 'placementConstraints', 'updateService_placementConstraints' - An array of task placement constraint objects to update the service to
-- use. If no value is specified, the existing placement constraints for
-- the service will remain unchanged. If this value is specified, it will
-- override any existing placement constraints defined for the service. To
-- remove all existing placement constraints, specify an empty array.
--
-- You can specify a maximum of 10 constraints for each task. This limit
-- includes constraints in the task definition and those specified at
-- runtime.
--
-- 'placementStrategy', 'updateService_placementStrategy' - The task placement strategy objects to update the service to use. If no
-- value is specified, the existing placement strategy for the service will
-- remain unchanged. If this value is specified, it will override the
-- existing placement strategy defined for the service. To remove an
-- existing placement strategy, specify an empty object.
--
-- You can specify a maximum of five strategy rules for each service.
--
-- 'platformVersion', 'updateService_platformVersion' - The platform version that your tasks in the service run on. A platform
-- version is only specified for tasks using the Fargate launch type. If a
-- platform version is not specified, the @LATEST@ platform version is
-- used. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate Platform Versions>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'propagateTags', 'updateService_propagateTags' - Determines whether to propagate the tags from the task definition or the
-- service to the task. If no value is specified, the tags aren\'t
-- propagated.
--
-- Only tasks launched after the update will reflect the update. To update
-- the tags on all tasks, set @forceNewDeployment@ to @true@, so that
-- Amazon ECS starts new tasks with the updated tags.
--
-- 'serviceConnectConfiguration', 'updateService_serviceConnectConfiguration' - The configuration for this service to discover and connect to services,
-- and be discovered by, and connected from, other services within a
-- namespace.
--
-- Tasks that run in a namespace can use short names to connect to services
-- in the namespace. Tasks can connect to services across all of the
-- clusters in the namespace. Tasks connect through a managed proxy
-- container that collects logs and metrics for increased visibility. Only
-- the tasks that Amazon ECS services create are supported with Service
-- Connect. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html Service Connect>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'serviceRegistries', 'updateService_serviceRegistries' - The details for the service discovery registries to assign to this
-- service. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html Service Discovery>.
--
-- When you add, update, or remove the service registries configuration,
-- Amazon ECS starts new tasks with the updated service registries
-- configuration, and then stops the old tasks when the new tasks are
-- running.
--
-- You can remove existing @serviceRegistries@ by passing an empty list.
--
-- 'taskDefinition', 'updateService_taskDefinition' - The @family@ and @revision@ (@family:revision@) or full ARN of the task
-- definition to run in your service. If a @revision@ is not specified, the
-- latest @ACTIVE@ revision is used. If you modify the task definition with
-- @UpdateService@, Amazon ECS spawns a task with the new version of the
-- task definition and then stops an old task after the new version is
-- running.
--
-- 'service', 'updateService_service' - The name of the service to update.
newUpdateService ::
  -- | 'service'
  Prelude.Text ->
  UpdateService
newUpdateService :: Text -> UpdateService
newUpdateService Text
pService_ =
  UpdateService'
    { $sel:capacityProviderStrategy:UpdateService' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cluster:UpdateService' :: Maybe Text
cluster = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentConfiguration:UpdateService' :: Maybe DeploymentConfiguration
deploymentConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:desiredCount:UpdateService' :: Maybe Int
desiredCount = forall a. Maybe a
Prelude.Nothing,
      $sel:enableECSManagedTags:UpdateService' :: Maybe Bool
enableECSManagedTags = forall a. Maybe a
Prelude.Nothing,
      $sel:enableExecuteCommand:UpdateService' :: Maybe Bool
enableExecuteCommand = forall a. Maybe a
Prelude.Nothing,
      $sel:forceNewDeployment:UpdateService' :: Maybe Bool
forceNewDeployment = forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckGracePeriodSeconds:UpdateService' :: Maybe Int
healthCheckGracePeriodSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:loadBalancers:UpdateService' :: Maybe [LoadBalancer]
loadBalancers = forall a. Maybe a
Prelude.Nothing,
      $sel:networkConfiguration:UpdateService' :: Maybe NetworkConfiguration
networkConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:placementConstraints:UpdateService' :: Maybe [PlacementConstraint]
placementConstraints = forall a. Maybe a
Prelude.Nothing,
      $sel:placementStrategy:UpdateService' :: Maybe [PlacementStrategy]
placementStrategy = forall a. Maybe a
Prelude.Nothing,
      $sel:platformVersion:UpdateService' :: Maybe Text
platformVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:propagateTags:UpdateService' :: Maybe PropagateTags
propagateTags = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceConnectConfiguration:UpdateService' :: Maybe ServiceConnectConfiguration
serviceConnectConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceRegistries:UpdateService' :: Maybe [ServiceRegistry]
serviceRegistries = forall a. Maybe a
Prelude.Nothing,
      $sel:taskDefinition:UpdateService' :: Maybe Text
taskDefinition = forall a. Maybe a
Prelude.Nothing,
      $sel:service:UpdateService' :: Text
service = Text
pService_
    }

-- | The capacity provider strategy to update the service to use.
--
-- if the service uses the default capacity provider strategy for the
-- cluster, the service can be updated to use one or more capacity
-- providers as opposed to the default capacity provider strategy. However,
-- when a service is using a capacity provider strategy that\'s not the
-- default capacity provider strategy, the service can\'t be updated to use
-- the cluster\'s default capacity provider strategy.
--
-- A capacity provider strategy consists of one or more capacity providers
-- along with the @base@ and @weight@ to assign to them. A capacity
-- provider must be associated with the cluster to be used in a capacity
-- provider strategy. The PutClusterCapacityProviders API is used to
-- associate a capacity provider with a cluster. Only capacity providers
-- with an @ACTIVE@ or @UPDATING@ status can be used.
--
-- If specifying a capacity provider that uses an Auto Scaling group, the
-- capacity provider must already be created. New capacity providers can be
-- created with the CreateCapacityProvider API operation.
--
-- To use a Fargate capacity provider, specify either the @FARGATE@ or
-- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
-- available to all accounts and only need to be associated with a cluster
-- to be used.
--
-- The PutClusterCapacityProviders API operation is used to update the list
-- of available capacity providers for a cluster after the cluster is
-- created.
updateService_capacityProviderStrategy :: Lens.Lens' UpdateService (Prelude.Maybe [CapacityProviderStrategyItem])
updateService_capacityProviderStrategy :: Lens' UpdateService (Maybe [CapacityProviderStrategyItem])
updateService_capacityProviderStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
$sel:capacityProviderStrategy:UpdateService' :: UpdateService -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy} -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy) (\s :: UpdateService
s@UpdateService' {} Maybe [CapacityProviderStrategyItem]
a -> UpdateService
s {$sel:capacityProviderStrategy:UpdateService' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
a} :: UpdateService) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The short name or full Amazon Resource Name (ARN) of the cluster that
-- your service runs on. If you do not specify a cluster, the default
-- cluster is assumed.
updateService_cluster :: Lens.Lens' UpdateService (Prelude.Maybe Prelude.Text)
updateService_cluster :: Lens' UpdateService (Maybe Text)
updateService_cluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe Text
cluster :: Maybe Text
$sel:cluster:UpdateService' :: UpdateService -> Maybe Text
cluster} -> Maybe Text
cluster) (\s :: UpdateService
s@UpdateService' {} Maybe Text
a -> UpdateService
s {$sel:cluster:UpdateService' :: Maybe Text
cluster = Maybe Text
a} :: UpdateService)

-- | Optional deployment parameters that control how many tasks run during
-- the deployment and the ordering of stopping and starting tasks.
updateService_deploymentConfiguration :: Lens.Lens' UpdateService (Prelude.Maybe DeploymentConfiguration)
updateService_deploymentConfiguration :: Lens' UpdateService (Maybe DeploymentConfiguration)
updateService_deploymentConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe DeploymentConfiguration
deploymentConfiguration :: Maybe DeploymentConfiguration
$sel:deploymentConfiguration:UpdateService' :: UpdateService -> Maybe DeploymentConfiguration
deploymentConfiguration} -> Maybe DeploymentConfiguration
deploymentConfiguration) (\s :: UpdateService
s@UpdateService' {} Maybe DeploymentConfiguration
a -> UpdateService
s {$sel:deploymentConfiguration:UpdateService' :: Maybe DeploymentConfiguration
deploymentConfiguration = Maybe DeploymentConfiguration
a} :: UpdateService)

-- | The number of instantiations of the task to place and keep running in
-- your service.
updateService_desiredCount :: Lens.Lens' UpdateService (Prelude.Maybe Prelude.Int)
updateService_desiredCount :: Lens' UpdateService (Maybe Int)
updateService_desiredCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe Int
desiredCount :: Maybe Int
$sel:desiredCount:UpdateService' :: UpdateService -> Maybe Int
desiredCount} -> Maybe Int
desiredCount) (\s :: UpdateService
s@UpdateService' {} Maybe Int
a -> UpdateService
s {$sel:desiredCount:UpdateService' :: Maybe Int
desiredCount = Maybe Int
a} :: UpdateService)

-- | Determines whether to turn on Amazon ECS managed tags for the tasks in
-- the service. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html Tagging Your Amazon ECS Resources>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- Only tasks launched after the update will reflect the update. To update
-- the tags on all tasks, set @forceNewDeployment@ to @true@, so that
-- Amazon ECS starts new tasks with the updated tags.
updateService_enableECSManagedTags :: Lens.Lens' UpdateService (Prelude.Maybe Prelude.Bool)
updateService_enableECSManagedTags :: Lens' UpdateService (Maybe Bool)
updateService_enableECSManagedTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe Bool
enableECSManagedTags :: Maybe Bool
$sel:enableECSManagedTags:UpdateService' :: UpdateService -> Maybe Bool
enableECSManagedTags} -> Maybe Bool
enableECSManagedTags) (\s :: UpdateService
s@UpdateService' {} Maybe Bool
a -> UpdateService
s {$sel:enableECSManagedTags:UpdateService' :: Maybe Bool
enableECSManagedTags = Maybe Bool
a} :: UpdateService)

-- | If @true@, this enables execute command functionality on all task
-- containers.
--
-- If you do not want to override the value that was set when the service
-- was created, you can set this to @null@ when performing this action.
updateService_enableExecuteCommand :: Lens.Lens' UpdateService (Prelude.Maybe Prelude.Bool)
updateService_enableExecuteCommand :: Lens' UpdateService (Maybe Bool)
updateService_enableExecuteCommand = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe Bool
enableExecuteCommand :: Maybe Bool
$sel:enableExecuteCommand:UpdateService' :: UpdateService -> Maybe Bool
enableExecuteCommand} -> Maybe Bool
enableExecuteCommand) (\s :: UpdateService
s@UpdateService' {} Maybe Bool
a -> UpdateService
s {$sel:enableExecuteCommand:UpdateService' :: Maybe Bool
enableExecuteCommand = Maybe Bool
a} :: UpdateService)

-- | Determines whether to force a new deployment of the service. By default,
-- deployments aren\'t forced. You can use this option to start a new
-- deployment with no service definition changes. For example, you can
-- update a service\'s tasks to use a newer Docker image with the same
-- image\/tag combination (@my_image:latest@) or to roll Fargate tasks onto
-- a newer platform version.
updateService_forceNewDeployment :: Lens.Lens' UpdateService (Prelude.Maybe Prelude.Bool)
updateService_forceNewDeployment :: Lens' UpdateService (Maybe Bool)
updateService_forceNewDeployment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe Bool
forceNewDeployment :: Maybe Bool
$sel:forceNewDeployment:UpdateService' :: UpdateService -> Maybe Bool
forceNewDeployment} -> Maybe Bool
forceNewDeployment) (\s :: UpdateService
s@UpdateService' {} Maybe Bool
a -> UpdateService
s {$sel:forceNewDeployment:UpdateService' :: Maybe Bool
forceNewDeployment = Maybe Bool
a} :: UpdateService)

-- | 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 is only valid if your service is configured
-- to use a load balancer. If your service\'s tasks take a while to start
-- and respond to Elastic Load Balancing health checks, you can specify a
-- health check grace period of up to 2,147,483,647 seconds. During that
-- time, the Amazon ECS service scheduler ignores the Elastic Load
-- Balancing health check status. This grace period can prevent the ECS
-- service scheduler from marking tasks as unhealthy and stopping them
-- before they have time to come up.
updateService_healthCheckGracePeriodSeconds :: Lens.Lens' UpdateService (Prelude.Maybe Prelude.Int)
updateService_healthCheckGracePeriodSeconds :: Lens' UpdateService (Maybe Int)
updateService_healthCheckGracePeriodSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe Int
healthCheckGracePeriodSeconds :: Maybe Int
$sel:healthCheckGracePeriodSeconds:UpdateService' :: UpdateService -> Maybe Int
healthCheckGracePeriodSeconds} -> Maybe Int
healthCheckGracePeriodSeconds) (\s :: UpdateService
s@UpdateService' {} Maybe Int
a -> UpdateService
s {$sel:healthCheckGracePeriodSeconds:UpdateService' :: Maybe Int
healthCheckGracePeriodSeconds = Maybe Int
a} :: UpdateService)

-- | A list of Elastic Load Balancing load balancer objects. It contains the
-- load balancer name, the container name, and the container port to access
-- from the load balancer. The container name is as it appears in a
-- container definition.
--
-- When you add, update, or remove a load balancer configuration, Amazon
-- ECS starts new tasks with the updated Elastic Load Balancing
-- configuration, and then stops the old tasks when the new tasks are
-- running.
--
-- For services that use rolling updates, you can add, update, or remove
-- Elastic Load Balancing target groups. You can update from a single
-- target group to multiple target groups and from multiple target groups
-- to a single target group.
--
-- For services that use blue\/green deployments, you can update Elastic
-- Load Balancing target groups by using
-- @ @<https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeployment.html CreateDeployment>@ @
-- through CodeDeploy. Note that multiple target groups are not supported
-- for blue\/green deployments. For more information see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html Register multiple target groups with a service>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- For services that use the external deployment controller, you can add,
-- update, or remove load balancers by using
-- <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateTaskSet.html CreateTaskSet>.
-- Note that multiple target groups are not supported for external
-- deployments. For more information see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html Register multiple target groups with a service>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- You can remove existing @loadBalancers@ by passing an empty list.
updateService_loadBalancers :: Lens.Lens' UpdateService (Prelude.Maybe [LoadBalancer])
updateService_loadBalancers :: Lens' UpdateService (Maybe [LoadBalancer])
updateService_loadBalancers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe [LoadBalancer]
loadBalancers :: Maybe [LoadBalancer]
$sel:loadBalancers:UpdateService' :: UpdateService -> Maybe [LoadBalancer]
loadBalancers} -> Maybe [LoadBalancer]
loadBalancers) (\s :: UpdateService
s@UpdateService' {} Maybe [LoadBalancer]
a -> UpdateService
s {$sel:loadBalancers:UpdateService' :: Maybe [LoadBalancer]
loadBalancers = Maybe [LoadBalancer]
a} :: UpdateService) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An object representing the network configuration for the service.
updateService_networkConfiguration :: Lens.Lens' UpdateService (Prelude.Maybe NetworkConfiguration)
updateService_networkConfiguration :: Lens' UpdateService (Maybe NetworkConfiguration)
updateService_networkConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe NetworkConfiguration
networkConfiguration :: Maybe NetworkConfiguration
$sel:networkConfiguration:UpdateService' :: UpdateService -> Maybe NetworkConfiguration
networkConfiguration} -> Maybe NetworkConfiguration
networkConfiguration) (\s :: UpdateService
s@UpdateService' {} Maybe NetworkConfiguration
a -> UpdateService
s {$sel:networkConfiguration:UpdateService' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
a} :: UpdateService)

-- | An array of task placement constraint objects to update the service to
-- use. If no value is specified, the existing placement constraints for
-- the service will remain unchanged. If this value is specified, it will
-- override any existing placement constraints defined for the service. To
-- remove all existing placement constraints, specify an empty array.
--
-- You can specify a maximum of 10 constraints for each task. This limit
-- includes constraints in the task definition and those specified at
-- runtime.
updateService_placementConstraints :: Lens.Lens' UpdateService (Prelude.Maybe [PlacementConstraint])
updateService_placementConstraints :: Lens' UpdateService (Maybe [PlacementConstraint])
updateService_placementConstraints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe [PlacementConstraint]
placementConstraints :: Maybe [PlacementConstraint]
$sel:placementConstraints:UpdateService' :: UpdateService -> Maybe [PlacementConstraint]
placementConstraints} -> Maybe [PlacementConstraint]
placementConstraints) (\s :: UpdateService
s@UpdateService' {} Maybe [PlacementConstraint]
a -> UpdateService
s {$sel:placementConstraints:UpdateService' :: Maybe [PlacementConstraint]
placementConstraints = Maybe [PlacementConstraint]
a} :: UpdateService) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The task placement strategy objects to update the service to use. If no
-- value is specified, the existing placement strategy for the service will
-- remain unchanged. If this value is specified, it will override the
-- existing placement strategy defined for the service. To remove an
-- existing placement strategy, specify an empty object.
--
-- You can specify a maximum of five strategy rules for each service.
updateService_placementStrategy :: Lens.Lens' UpdateService (Prelude.Maybe [PlacementStrategy])
updateService_placementStrategy :: Lens' UpdateService (Maybe [PlacementStrategy])
updateService_placementStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe [PlacementStrategy]
placementStrategy :: Maybe [PlacementStrategy]
$sel:placementStrategy:UpdateService' :: UpdateService -> Maybe [PlacementStrategy]
placementStrategy} -> Maybe [PlacementStrategy]
placementStrategy) (\s :: UpdateService
s@UpdateService' {} Maybe [PlacementStrategy]
a -> UpdateService
s {$sel:placementStrategy:UpdateService' :: Maybe [PlacementStrategy]
placementStrategy = Maybe [PlacementStrategy]
a} :: UpdateService) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The platform version that your tasks in the service run on. A platform
-- version is only specified for tasks using the Fargate launch type. If a
-- platform version is not specified, the @LATEST@ platform version is
-- used. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate Platform Versions>
-- in the /Amazon Elastic Container Service Developer Guide/.
updateService_platformVersion :: Lens.Lens' UpdateService (Prelude.Maybe Prelude.Text)
updateService_platformVersion :: Lens' UpdateService (Maybe Text)
updateService_platformVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe Text
platformVersion :: Maybe Text
$sel:platformVersion:UpdateService' :: UpdateService -> Maybe Text
platformVersion} -> Maybe Text
platformVersion) (\s :: UpdateService
s@UpdateService' {} Maybe Text
a -> UpdateService
s {$sel:platformVersion:UpdateService' :: Maybe Text
platformVersion = Maybe Text
a} :: UpdateService)

-- | Determines whether to propagate the tags from the task definition or the
-- service to the task. If no value is specified, the tags aren\'t
-- propagated.
--
-- Only tasks launched after the update will reflect the update. To update
-- the tags on all tasks, set @forceNewDeployment@ to @true@, so that
-- Amazon ECS starts new tasks with the updated tags.
updateService_propagateTags :: Lens.Lens' UpdateService (Prelude.Maybe PropagateTags)
updateService_propagateTags :: Lens' UpdateService (Maybe PropagateTags)
updateService_propagateTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe PropagateTags
propagateTags :: Maybe PropagateTags
$sel:propagateTags:UpdateService' :: UpdateService -> Maybe PropagateTags
propagateTags} -> Maybe PropagateTags
propagateTags) (\s :: UpdateService
s@UpdateService' {} Maybe PropagateTags
a -> UpdateService
s {$sel:propagateTags:UpdateService' :: Maybe PropagateTags
propagateTags = Maybe PropagateTags
a} :: UpdateService)

-- | The configuration for this service to discover and connect to services,
-- and be discovered by, and connected from, other services within a
-- namespace.
--
-- Tasks that run in a namespace can use short names to connect to services
-- in the namespace. Tasks can connect to services across all of the
-- clusters in the namespace. Tasks connect through a managed proxy
-- container that collects logs and metrics for increased visibility. Only
-- the tasks that Amazon ECS services create are supported with Service
-- Connect. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html Service Connect>
-- in the /Amazon Elastic Container Service Developer Guide/.
updateService_serviceConnectConfiguration :: Lens.Lens' UpdateService (Prelude.Maybe ServiceConnectConfiguration)
updateService_serviceConnectConfiguration :: Lens' UpdateService (Maybe ServiceConnectConfiguration)
updateService_serviceConnectConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe ServiceConnectConfiguration
serviceConnectConfiguration :: Maybe ServiceConnectConfiguration
$sel:serviceConnectConfiguration:UpdateService' :: UpdateService -> Maybe ServiceConnectConfiguration
serviceConnectConfiguration} -> Maybe ServiceConnectConfiguration
serviceConnectConfiguration) (\s :: UpdateService
s@UpdateService' {} Maybe ServiceConnectConfiguration
a -> UpdateService
s {$sel:serviceConnectConfiguration:UpdateService' :: Maybe ServiceConnectConfiguration
serviceConnectConfiguration = Maybe ServiceConnectConfiguration
a} :: UpdateService)

-- | The details for the service discovery registries to assign to this
-- service. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html Service Discovery>.
--
-- When you add, update, or remove the service registries configuration,
-- Amazon ECS starts new tasks with the updated service registries
-- configuration, and then stops the old tasks when the new tasks are
-- running.
--
-- You can remove existing @serviceRegistries@ by passing an empty list.
updateService_serviceRegistries :: Lens.Lens' UpdateService (Prelude.Maybe [ServiceRegistry])
updateService_serviceRegistries :: Lens' UpdateService (Maybe [ServiceRegistry])
updateService_serviceRegistries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe [ServiceRegistry]
serviceRegistries :: Maybe [ServiceRegistry]
$sel:serviceRegistries:UpdateService' :: UpdateService -> Maybe [ServiceRegistry]
serviceRegistries} -> Maybe [ServiceRegistry]
serviceRegistries) (\s :: UpdateService
s@UpdateService' {} Maybe [ServiceRegistry]
a -> UpdateService
s {$sel:serviceRegistries:UpdateService' :: Maybe [ServiceRegistry]
serviceRegistries = Maybe [ServiceRegistry]
a} :: UpdateService) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The @family@ and @revision@ (@family:revision@) or full ARN of the task
-- definition to run in your service. If a @revision@ is not specified, the
-- latest @ACTIVE@ revision is used. If you modify the task definition with
-- @UpdateService@, Amazon ECS spawns a task with the new version of the
-- task definition and then stops an old task after the new version is
-- running.
updateService_taskDefinition :: Lens.Lens' UpdateService (Prelude.Maybe Prelude.Text)
updateService_taskDefinition :: Lens' UpdateService (Maybe Text)
updateService_taskDefinition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Maybe Text
taskDefinition :: Maybe Text
$sel:taskDefinition:UpdateService' :: UpdateService -> Maybe Text
taskDefinition} -> Maybe Text
taskDefinition) (\s :: UpdateService
s@UpdateService' {} Maybe Text
a -> UpdateService
s {$sel:taskDefinition:UpdateService' :: Maybe Text
taskDefinition = Maybe Text
a} :: UpdateService)

-- | The name of the service to update.
updateService_service :: Lens.Lens' UpdateService Prelude.Text
updateService_service :: Lens' UpdateService Text
updateService_service = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateService' {Text
service :: Text
$sel:service:UpdateService' :: UpdateService -> Text
service} -> Text
service) (\s :: UpdateService
s@UpdateService' {} Text
a -> UpdateService
s {$sel:service:UpdateService' :: Text
service = Text
a} :: UpdateService)

instance Core.AWSRequest UpdateService where
  type
    AWSResponse UpdateService =
      UpdateServiceResponse
  request :: (Service -> Service) -> UpdateService -> Request UpdateService
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateService
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateService)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe ContainerService -> Int -> UpdateServiceResponse
UpdateServiceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"service")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateService where
  hashWithSalt :: Int -> UpdateService -> Int
hashWithSalt Int
_salt UpdateService' {Maybe Bool
Maybe Int
Maybe [CapacityProviderStrategyItem]
Maybe [LoadBalancer]
Maybe [PlacementConstraint]
Maybe [PlacementStrategy]
Maybe [ServiceRegistry]
Maybe Text
Maybe DeploymentConfiguration
Maybe NetworkConfiguration
Maybe PropagateTags
Maybe ServiceConnectConfiguration
Text
service :: Text
taskDefinition :: Maybe Text
serviceRegistries :: Maybe [ServiceRegistry]
serviceConnectConfiguration :: Maybe ServiceConnectConfiguration
propagateTags :: Maybe PropagateTags
platformVersion :: Maybe Text
placementStrategy :: Maybe [PlacementStrategy]
placementConstraints :: Maybe [PlacementConstraint]
networkConfiguration :: Maybe NetworkConfiguration
loadBalancers :: Maybe [LoadBalancer]
healthCheckGracePeriodSeconds :: Maybe Int
forceNewDeployment :: Maybe Bool
enableExecuteCommand :: Maybe Bool
enableECSManagedTags :: Maybe Bool
desiredCount :: Maybe Int
deploymentConfiguration :: Maybe DeploymentConfiguration
cluster :: Maybe Text
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
$sel:service:UpdateService' :: UpdateService -> Text
$sel:taskDefinition:UpdateService' :: UpdateService -> Maybe Text
$sel:serviceRegistries:UpdateService' :: UpdateService -> Maybe [ServiceRegistry]
$sel:serviceConnectConfiguration:UpdateService' :: UpdateService -> Maybe ServiceConnectConfiguration
$sel:propagateTags:UpdateService' :: UpdateService -> Maybe PropagateTags
$sel:platformVersion:UpdateService' :: UpdateService -> Maybe Text
$sel:placementStrategy:UpdateService' :: UpdateService -> Maybe [PlacementStrategy]
$sel:placementConstraints:UpdateService' :: UpdateService -> Maybe [PlacementConstraint]
$sel:networkConfiguration:UpdateService' :: UpdateService -> Maybe NetworkConfiguration
$sel:loadBalancers:UpdateService' :: UpdateService -> Maybe [LoadBalancer]
$sel:healthCheckGracePeriodSeconds:UpdateService' :: UpdateService -> Maybe Int
$sel:forceNewDeployment:UpdateService' :: UpdateService -> Maybe Bool
$sel:enableExecuteCommand:UpdateService' :: UpdateService -> Maybe Bool
$sel:enableECSManagedTags:UpdateService' :: UpdateService -> Maybe Bool
$sel:desiredCount:UpdateService' :: UpdateService -> Maybe Int
$sel:deploymentConfiguration:UpdateService' :: UpdateService -> Maybe DeploymentConfiguration
$sel:cluster:UpdateService' :: UpdateService -> Maybe Text
$sel:capacityProviderStrategy:UpdateService' :: UpdateService -> Maybe [CapacityProviderStrategyItem]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cluster
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeploymentConfiguration
deploymentConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
desiredCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableECSManagedTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableExecuteCommand
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
forceNewDeployment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
healthCheckGracePeriodSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [LoadBalancer]
loadBalancers
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NetworkConfiguration
networkConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PlacementConstraint]
placementConstraints
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PlacementStrategy]
placementStrategy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platformVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PropagateTags
propagateTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceConnectConfiguration
serviceConnectConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ServiceRegistry]
serviceRegistries
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
taskDefinition
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
service

instance Prelude.NFData UpdateService where
  rnf :: UpdateService -> ()
rnf UpdateService' {Maybe Bool
Maybe Int
Maybe [CapacityProviderStrategyItem]
Maybe [LoadBalancer]
Maybe [PlacementConstraint]
Maybe [PlacementStrategy]
Maybe [ServiceRegistry]
Maybe Text
Maybe DeploymentConfiguration
Maybe NetworkConfiguration
Maybe PropagateTags
Maybe ServiceConnectConfiguration
Text
service :: Text
taskDefinition :: Maybe Text
serviceRegistries :: Maybe [ServiceRegistry]
serviceConnectConfiguration :: Maybe ServiceConnectConfiguration
propagateTags :: Maybe PropagateTags
platformVersion :: Maybe Text
placementStrategy :: Maybe [PlacementStrategy]
placementConstraints :: Maybe [PlacementConstraint]
networkConfiguration :: Maybe NetworkConfiguration
loadBalancers :: Maybe [LoadBalancer]
healthCheckGracePeriodSeconds :: Maybe Int
forceNewDeployment :: Maybe Bool
enableExecuteCommand :: Maybe Bool
enableECSManagedTags :: Maybe Bool
desiredCount :: Maybe Int
deploymentConfiguration :: Maybe DeploymentConfiguration
cluster :: Maybe Text
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
$sel:service:UpdateService' :: UpdateService -> Text
$sel:taskDefinition:UpdateService' :: UpdateService -> Maybe Text
$sel:serviceRegistries:UpdateService' :: UpdateService -> Maybe [ServiceRegistry]
$sel:serviceConnectConfiguration:UpdateService' :: UpdateService -> Maybe ServiceConnectConfiguration
$sel:propagateTags:UpdateService' :: UpdateService -> Maybe PropagateTags
$sel:platformVersion:UpdateService' :: UpdateService -> Maybe Text
$sel:placementStrategy:UpdateService' :: UpdateService -> Maybe [PlacementStrategy]
$sel:placementConstraints:UpdateService' :: UpdateService -> Maybe [PlacementConstraint]
$sel:networkConfiguration:UpdateService' :: UpdateService -> Maybe NetworkConfiguration
$sel:loadBalancers:UpdateService' :: UpdateService -> Maybe [LoadBalancer]
$sel:healthCheckGracePeriodSeconds:UpdateService' :: UpdateService -> Maybe Int
$sel:forceNewDeployment:UpdateService' :: UpdateService -> Maybe Bool
$sel:enableExecuteCommand:UpdateService' :: UpdateService -> Maybe Bool
$sel:enableECSManagedTags:UpdateService' :: UpdateService -> Maybe Bool
$sel:desiredCount:UpdateService' :: UpdateService -> Maybe Int
$sel:deploymentConfiguration:UpdateService' :: UpdateService -> Maybe DeploymentConfiguration
$sel:cluster:UpdateService' :: UpdateService -> Maybe Text
$sel:capacityProviderStrategy:UpdateService' :: UpdateService -> Maybe [CapacityProviderStrategyItem]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cluster
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentConfiguration
deploymentConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
desiredCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableECSManagedTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableExecuteCommand
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
forceNewDeployment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
healthCheckGracePeriodSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [LoadBalancer]
loadBalancers
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkConfiguration
networkConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PlacementConstraint]
placementConstraints
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PlacementStrategy]
placementStrategy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platformVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PropagateTags
propagateTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceConnectConfiguration
serviceConnectConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ServiceRegistry]
serviceRegistries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
taskDefinition
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
service

instance Data.ToHeaders UpdateService where
  toHeaders :: UpdateService -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonEC2ContainerServiceV20141113.UpdateService" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateService where
  toJSON :: UpdateService -> Value
toJSON UpdateService' {Maybe Bool
Maybe Int
Maybe [CapacityProviderStrategyItem]
Maybe [LoadBalancer]
Maybe [PlacementConstraint]
Maybe [PlacementStrategy]
Maybe [ServiceRegistry]
Maybe Text
Maybe DeploymentConfiguration
Maybe NetworkConfiguration
Maybe PropagateTags
Maybe ServiceConnectConfiguration
Text
service :: Text
taskDefinition :: Maybe Text
serviceRegistries :: Maybe [ServiceRegistry]
serviceConnectConfiguration :: Maybe ServiceConnectConfiguration
propagateTags :: Maybe PropagateTags
platformVersion :: Maybe Text
placementStrategy :: Maybe [PlacementStrategy]
placementConstraints :: Maybe [PlacementConstraint]
networkConfiguration :: Maybe NetworkConfiguration
loadBalancers :: Maybe [LoadBalancer]
healthCheckGracePeriodSeconds :: Maybe Int
forceNewDeployment :: Maybe Bool
enableExecuteCommand :: Maybe Bool
enableECSManagedTags :: Maybe Bool
desiredCount :: Maybe Int
deploymentConfiguration :: Maybe DeploymentConfiguration
cluster :: Maybe Text
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
$sel:service:UpdateService' :: UpdateService -> Text
$sel:taskDefinition:UpdateService' :: UpdateService -> Maybe Text
$sel:serviceRegistries:UpdateService' :: UpdateService -> Maybe [ServiceRegistry]
$sel:serviceConnectConfiguration:UpdateService' :: UpdateService -> Maybe ServiceConnectConfiguration
$sel:propagateTags:UpdateService' :: UpdateService -> Maybe PropagateTags
$sel:platformVersion:UpdateService' :: UpdateService -> Maybe Text
$sel:placementStrategy:UpdateService' :: UpdateService -> Maybe [PlacementStrategy]
$sel:placementConstraints:UpdateService' :: UpdateService -> Maybe [PlacementConstraint]
$sel:networkConfiguration:UpdateService' :: UpdateService -> Maybe NetworkConfiguration
$sel:loadBalancers:UpdateService' :: UpdateService -> Maybe [LoadBalancer]
$sel:healthCheckGracePeriodSeconds:UpdateService' :: UpdateService -> Maybe Int
$sel:forceNewDeployment:UpdateService' :: UpdateService -> Maybe Bool
$sel:enableExecuteCommand:UpdateService' :: UpdateService -> Maybe Bool
$sel:enableECSManagedTags:UpdateService' :: UpdateService -> Maybe Bool
$sel:desiredCount:UpdateService' :: UpdateService -> Maybe Int
$sel:deploymentConfiguration:UpdateService' :: UpdateService -> Maybe DeploymentConfiguration
$sel:cluster:UpdateService' :: UpdateService -> Maybe Text
$sel:capacityProviderStrategy:UpdateService' :: UpdateService -> Maybe [CapacityProviderStrategyItem]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"capacityProviderStrategy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy,
            (Key
"cluster" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cluster,
            (Key
"deploymentConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeploymentConfiguration
deploymentConfiguration,
            (Key
"desiredCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
desiredCount,
            (Key
"enableECSManagedTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableECSManagedTags,
            (Key
"enableExecuteCommand" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableExecuteCommand,
            (Key
"forceNewDeployment" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
forceNewDeployment,
            (Key
"healthCheckGracePeriodSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
healthCheckGracePeriodSeconds,
            (Key
"loadBalancers" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [LoadBalancer]
loadBalancers,
            (Key
"networkConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkConfiguration
networkConfiguration,
            (Key
"placementConstraints" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlacementConstraint]
placementConstraints,
            (Key
"placementStrategy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlacementStrategy]
placementStrategy,
            (Key
"platformVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
platformVersion,
            (Key
"propagateTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PropagateTags
propagateTags,
            (Key
"serviceConnectConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ServiceConnectConfiguration
serviceConnectConfiguration,
            (Key
"serviceRegistries" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ServiceRegistry]
serviceRegistries,
            (Key
"taskDefinition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
taskDefinition,
            forall a. a -> Maybe a
Prelude.Just (Key
"service" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
service)
          ]
      )

instance Data.ToPath UpdateService where
  toPath :: UpdateService -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery UpdateService where
  toQuery :: UpdateService -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateServiceResponse' smart constructor.
data UpdateServiceResponse = UpdateServiceResponse'
  { -- | The full description of your service following the update call.
    UpdateServiceResponse -> Maybe ContainerService
service :: Prelude.Maybe ContainerService,
    -- | The response's http status code.
    UpdateServiceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateServiceResponse -> UpdateServiceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceResponse -> UpdateServiceResponse -> Bool
$c/= :: UpdateServiceResponse -> UpdateServiceResponse -> Bool
== :: UpdateServiceResponse -> UpdateServiceResponse -> Bool
$c== :: UpdateServiceResponse -> UpdateServiceResponse -> Bool
Prelude.Eq, ReadPrec [UpdateServiceResponse]
ReadPrec UpdateServiceResponse
Int -> ReadS UpdateServiceResponse
ReadS [UpdateServiceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceResponse]
$creadListPrec :: ReadPrec [UpdateServiceResponse]
readPrec :: ReadPrec UpdateServiceResponse
$creadPrec :: ReadPrec UpdateServiceResponse
readList :: ReadS [UpdateServiceResponse]
$creadList :: ReadS [UpdateServiceResponse]
readsPrec :: Int -> ReadS UpdateServiceResponse
$creadsPrec :: Int -> ReadS UpdateServiceResponse
Prelude.Read, Int -> UpdateServiceResponse -> ShowS
[UpdateServiceResponse] -> ShowS
UpdateServiceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceResponse] -> ShowS
$cshowList :: [UpdateServiceResponse] -> ShowS
show :: UpdateServiceResponse -> String
$cshow :: UpdateServiceResponse -> String
showsPrec :: Int -> UpdateServiceResponse -> ShowS
$cshowsPrec :: Int -> UpdateServiceResponse -> ShowS
Prelude.Show, forall x. Rep UpdateServiceResponse x -> UpdateServiceResponse
forall x. UpdateServiceResponse -> Rep UpdateServiceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateServiceResponse x -> UpdateServiceResponse
$cfrom :: forall x. UpdateServiceResponse -> Rep UpdateServiceResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServiceResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'service', 'updateServiceResponse_service' - The full description of your service following the update call.
--
-- 'httpStatus', 'updateServiceResponse_httpStatus' - The response's http status code.
newUpdateServiceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateServiceResponse
newUpdateServiceResponse :: Int -> UpdateServiceResponse
newUpdateServiceResponse Int
pHttpStatus_ =
  UpdateServiceResponse'
    { $sel:service:UpdateServiceResponse' :: Maybe ContainerService
service = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateServiceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The full description of your service following the update call.
updateServiceResponse_service :: Lens.Lens' UpdateServiceResponse (Prelude.Maybe ContainerService)
updateServiceResponse_service :: Lens' UpdateServiceResponse (Maybe ContainerService)
updateServiceResponse_service = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceResponse' {Maybe ContainerService
service :: Maybe ContainerService
$sel:service:UpdateServiceResponse' :: UpdateServiceResponse -> Maybe ContainerService
service} -> Maybe ContainerService
service) (\s :: UpdateServiceResponse
s@UpdateServiceResponse' {} Maybe ContainerService
a -> UpdateServiceResponse
s {$sel:service:UpdateServiceResponse' :: Maybe ContainerService
service = Maybe ContainerService
a} :: UpdateServiceResponse)

-- | The response's http status code.
updateServiceResponse_httpStatus :: Lens.Lens' UpdateServiceResponse Prelude.Int
updateServiceResponse_httpStatus :: Lens' UpdateServiceResponse Int
updateServiceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServiceResponse' :: UpdateServiceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateServiceResponse
s@UpdateServiceResponse' {} Int
a -> UpdateServiceResponse
s {$sel:httpStatus:UpdateServiceResponse' :: Int
httpStatus = Int
a} :: UpdateServiceResponse)

instance Prelude.NFData UpdateServiceResponse where
  rnf :: UpdateServiceResponse -> ()
rnf UpdateServiceResponse' {Int
Maybe ContainerService
httpStatus :: Int
service :: Maybe ContainerService
$sel:httpStatus:UpdateServiceResponse' :: UpdateServiceResponse -> Int
$sel:service:UpdateServiceResponse' :: UpdateServiceResponse -> Maybe ContainerService
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ContainerService
service
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus