aws_sdk_ecs/operation/create_service/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_service::_create_service_output::CreateServiceOutputBuilder;
3
4pub use crate::operation::create_service::_create_service_input::CreateServiceInputBuilder;
5
6impl crate::operation::create_service::builders::CreateServiceInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_service::CreateServiceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_service::CreateServiceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_service();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateService`.
24///
25/// <p>Runs and maintains your desired number of tasks from a specified task definition. If the number of tasks running in a service drops below the <code>desiredCount</code>, Amazon ECS runs another copy of the task in the specified cluster. To update an existing service, use <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html">UpdateService</a>.</p><note>
26/// <p>On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition.</p>
27/// </note> <note>
28/// <p>Amazon Elastic Inference (EI) is no longer available to customers.</p>
29/// </note>
30/// <p>In addition to maintaining the desired count of tasks in your service, you can optionally run your service behind one or more load balancers. The load balancers distribute traffic across the tasks that are associated with the service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html">Service load balancing</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
31/// <p>You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. <code>volumeConfigurations</code> is only supported for REPLICA service and not DAEMON service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types">Amazon EBS volumes</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
32/// <p>Tasks for services that don't use a load balancer are considered healthy if they're in the <code>RUNNING</code> state. Tasks for services that use a load balancer are considered healthy if they're in the <code>RUNNING</code> state and are reported as healthy by the load balancer.</p>
33/// <p>There are two service scheduler strategies available:</p>
34/// <ul>
35/// <li>
36/// <p><code>REPLICA</code> - The replica scheduling strategy places and maintains your desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html">Service scheduler concepts</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p></li>
37/// <li>
38/// <p><code>DAEMON</code> - The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks. It also stops tasks that don't meet the placement constraints. When using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html">Amazon ECS services</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p></li>
39/// </ul>
40/// <p>The deployment controller is the mechanism that determines how tasks are deployed for your service. The valid options are:</p>
41/// <ul>
42/// <li>
43/// <p>ECS</p>
44/// <p>When you create a service which uses the <code>ECS</code> deployment controller, you can choose between the following deployment strategies (which you can set in the “<code>strategy</code>” field in “<code>deploymentConfiguration</code>”): :</p>
45/// <ul>
46/// <li>
47/// <p><code>ROLLING</code>: When you create a service which uses the <i>rolling update</i> (<code>ROLLING</code>) deployment strategy, the Amazon ECS service scheduler replaces the currently running tasks with new tasks. The number of tasks that Amazon ECS adds or removes from the service during a rolling update is controlled by the service deployment configuration. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html">Deploy Amazon ECS services by replacing tasks</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
48/// <p>Rolling update deployments are best suited for the following scenarios:</p>
49/// <ul>
50/// <li>
51/// <p>Gradual service updates: You need to update your service incrementally without taking the entire service offline at once.</p></li>
52/// <li>
53/// <p>Limited resource requirements: You want to avoid the additional resource costs of running two complete environments simultaneously (as required by blue/green deployments).</p></li>
54/// <li>
55/// <p>Acceptable deployment time: Your application can tolerate a longer deployment process, as rolling updates replace tasks one by one.</p></li>
56/// <li>
57/// <p>No need for instant roll back: Your service can tolerate a rollback process that takes minutes rather than seconds.</p></li>
58/// <li>
59/// <p>Simple deployment process: You prefer a straightforward deployment approach without the complexity of managing multiple environments, target groups, and listeners.</p></li>
60/// <li>
61/// <p>No load balancer requirement: Your service doesn't use or require a load balancer, Application Load Balancer, Network Load Balancer, or Service Connect (which are required for blue/green deployments).</p></li>
62/// <li>
63/// <p>Stateful applications: Your application maintains state that makes it difficult to run two parallel environments.</p></li>
64/// <li>
65/// <p>Cost sensitivity: You want to minimize deployment costs by not running duplicate environments during deployment.</p></li>
66/// </ul>
67/// <p>Rolling updates are the default deployment strategy for services and provide a balance between deployment safety and resource efficiency for many common application scenarios.</p></li>
68/// <li>
69/// <p><code>BLUE_GREEN</code>: A <i>blue/green</i> deployment strategy (<code>BLUE_GREEN</code>) is a release methodology that reduces downtime and risk by running two identical production environments called blue and green. With Amazon ECS blue/green deployments, you can validate new service revisions before directing production traffic to them. This approach provides a safer way to deploy changes with the ability to quickly roll back if needed. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-blue-green.html">Amazon ECS blue/green deployments</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
70/// <p>Amazon ECS blue/green deployments are best suited for the following scenarios:</p>
71/// <ul>
72/// <li>
73/// <p>Service validation: When you need to validate new service revisions before directing production traffic to them</p></li>
74/// <li>
75/// <p>Zero downtime: When your service requires zero-downtime deployments</p></li>
76/// <li>
77/// <p>Instant roll back: When you need the ability to quickly roll back if issues are detected</p></li>
78/// <li>
79/// <p>Load balancer requirement: When your service uses Application Load Balancer, Network Load Balancer, or Service Connect</p></li>
80/// </ul></li>
81/// </ul></li>
82/// <li>
83/// <p>External</p>
84/// <p>Use a third-party deployment controller.</p></li>
85/// <li>
86/// <p>Blue/green deployment (powered by CodeDeploy)</p>
87/// <p>CodeDeploy installs an updated version of the application as a new replacement task set and reroutes production traffic from the original application task set to the replacement task set. The original task set is terminated after a successful deployment. Use this deployment controller to verify a new deployment of a service before sending production traffic to it.</p></li>
88/// </ul>
89/// <p>When creating a service that uses the <code>EXTERNAL</code> deployment controller, you can specify only parameters that aren't controlled at the task set level. The only required parameter is the service name. You control your services using the <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateTaskSet.html">CreateTaskSet</a>. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html">Amazon ECS deployment types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
90/// <p>When the service scheduler launches new tasks, it determines task placement. For information about task placement and task placement strategies, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement.html">Amazon ECS task placement</a> in the <i>Amazon Elastic Container Service Developer Guide</i></p>
91#[derive(::std::clone::Clone, ::std::fmt::Debug)]
92pub struct CreateServiceFluentBuilder {
93    handle: ::std::sync::Arc<crate::client::Handle>,
94    inner: crate::operation::create_service::builders::CreateServiceInputBuilder,
95    config_override: ::std::option::Option<crate::config::Builder>,
96}
97impl
98    crate::client::customize::internal::CustomizableSend<
99        crate::operation::create_service::CreateServiceOutput,
100        crate::operation::create_service::CreateServiceError,
101    > for CreateServiceFluentBuilder
102{
103    fn send(
104        self,
105        config_override: crate::config::Builder,
106    ) -> crate::client::customize::internal::BoxFuture<
107        crate::client::customize::internal::SendResult<
108            crate::operation::create_service::CreateServiceOutput,
109            crate::operation::create_service::CreateServiceError,
110        >,
111    > {
112        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
113    }
114}
115impl CreateServiceFluentBuilder {
116    /// Creates a new `CreateServiceFluentBuilder`.
117    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
118        Self {
119            handle,
120            inner: ::std::default::Default::default(),
121            config_override: ::std::option::Option::None,
122        }
123    }
124    /// Access the CreateService as a reference.
125    pub fn as_input(&self) -> &crate::operation::create_service::builders::CreateServiceInputBuilder {
126        &self.inner
127    }
128    /// Sends the request and returns the response.
129    ///
130    /// If an error occurs, an `SdkError` will be returned with additional details that
131    /// can be matched against.
132    ///
133    /// By default, any retryable failures will be retried twice. Retry behavior
134    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
135    /// set when configuring the client.
136    pub async fn send(
137        self,
138    ) -> ::std::result::Result<
139        crate::operation::create_service::CreateServiceOutput,
140        ::aws_smithy_runtime_api::client::result::SdkError<
141            crate::operation::create_service::CreateServiceError,
142            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
143        >,
144    > {
145        let input = self
146            .inner
147            .build()
148            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
149        let runtime_plugins = crate::operation::create_service::CreateService::operation_runtime_plugins(
150            self.handle.runtime_plugins.clone(),
151            &self.handle.conf,
152            self.config_override,
153        );
154        crate::operation::create_service::CreateService::orchestrate(&runtime_plugins, input).await
155    }
156
157    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
158    pub fn customize(
159        self,
160    ) -> crate::client::customize::CustomizableOperation<
161        crate::operation::create_service::CreateServiceOutput,
162        crate::operation::create_service::CreateServiceError,
163        Self,
164    > {
165        crate::client::customize::CustomizableOperation::new(self)
166    }
167    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
168        self.set_config_override(::std::option::Option::Some(config_override.into()));
169        self
170    }
171
172    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
173        self.config_override = config_override;
174        self
175    }
176    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on. If you do not specify a cluster, the default cluster is assumed.</p>
177    pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.cluster(input.into());
179        self
180    }
181    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on. If you do not specify a cluster, the default cluster is assumed.</p>
182    pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_cluster(input);
184        self
185    }
186    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on. If you do not specify a cluster, the default cluster is assumed.</p>
187    pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_cluster()
189    }
190    /// <p>The name of your service. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a Region or across multiple Regions.</p>
191    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.inner = self.inner.service_name(input.into());
193        self
194    }
195    /// <p>The name of your service. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a Region or across multiple Regions.</p>
196    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.inner = self.inner.set_service_name(input);
198        self
199    }
200    /// <p>The name of your service. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a Region or across multiple Regions.</p>
201    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
202        self.inner.get_service_name()
203    }
204    /// <p>The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full ARN of the task definition to run in your service. If a <code>revision</code> isn't specified, the latest <code>ACTIVE</code> revision is used.</p>
205    /// <p>A task definition must be specified if the service uses either the <code>ECS</code> or <code>CODE_DEPLOY</code> deployment controllers.</p>
206    /// <p>For more information about deployment types, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html">Amazon ECS deployment types</a>.</p>
207    pub fn task_definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.task_definition(input.into());
209        self
210    }
211    /// <p>The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full ARN of the task definition to run in your service. If a <code>revision</code> isn't specified, the latest <code>ACTIVE</code> revision is used.</p>
212    /// <p>A task definition must be specified if the service uses either the <code>ECS</code> or <code>CODE_DEPLOY</code> deployment controllers.</p>
213    /// <p>For more information about deployment types, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html">Amazon ECS deployment types</a>.</p>
214    pub fn set_task_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.inner = self.inner.set_task_definition(input);
216        self
217    }
218    /// <p>The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full ARN of the task definition to run in your service. If a <code>revision</code> isn't specified, the latest <code>ACTIVE</code> revision is used.</p>
219    /// <p>A task definition must be specified if the service uses either the <code>ECS</code> or <code>CODE_DEPLOY</code> deployment controllers.</p>
220    /// <p>For more information about deployment types, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html">Amazon ECS deployment types</a>.</p>
221    pub fn get_task_definition(&self) -> &::std::option::Option<::std::string::String> {
222        self.inner.get_task_definition()
223    }
224    /// <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
225    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html">Balancing an Amazon ECS service across Availability Zones</a> in the <i> <i>Amazon Elastic Container Service Developer Guide</i> </i>.</p>
226    pub fn availability_zone_rebalancing(mut self, input: crate::types::AvailabilityZoneRebalancing) -> Self {
227        self.inner = self.inner.availability_zone_rebalancing(input);
228        self
229    }
230    /// <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
231    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html">Balancing an Amazon ECS service across Availability Zones</a> in the <i> <i>Amazon Elastic Container Service Developer Guide</i> </i>.</p>
232    pub fn set_availability_zone_rebalancing(mut self, input: ::std::option::Option<crate::types::AvailabilityZoneRebalancing>) -> Self {
233        self.inner = self.inner.set_availability_zone_rebalancing(input);
234        self
235    }
236    /// <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
237    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html">Balancing an Amazon ECS service across Availability Zones</a> in the <i> <i>Amazon Elastic Container Service Developer Guide</i> </i>.</p>
238    pub fn get_availability_zone_rebalancing(&self) -> &::std::option::Option<crate::types::AvailabilityZoneRebalancing> {
239        self.inner.get_availability_zone_rebalancing()
240    }
241    ///
242    /// Appends an item to `loadBalancers`.
243    ///
244    /// To override the contents of this collection use [`set_load_balancers`](Self::set_load_balancers).
245    ///
246    /// <p>A load balancer object representing the load balancers to use with your service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html">Service load balancing</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
247    /// <p>If the service uses the rolling update (<code>ECS</code>) deployment controller and using either an Application Load Balancer or Network Load Balancer, you must specify one or more target group ARNs to attach to the service. The service-linked role is required for services that use multiple target groups. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html">Using service-linked roles for Amazon ECS</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
248    /// <p>If the service uses the <code>CODE_DEPLOY</code> deployment controller, the service is required to use either an Application Load Balancer or Network Load Balancer. When creating an CodeDeploy deployment group, you specify two target groups (referred to as a <code>targetGroupPair</code>). During a deployment, CodeDeploy determines which task set in your service has the status <code>PRIMARY</code>, and it associates one target group with it. Then, it also associates the other target group with the replacement task set. The load balancer can also have up to two listeners: a required listener for production traffic and an optional listener that you can use to perform validation tests with Lambda functions before routing production traffic to it.</p>
249    /// <p>If you use the <code>CODE_DEPLOY</code> deployment controller, these values can be changed when updating the service.</p>
250    /// <p>For Application Load Balancers and Network Load Balancers, this object must contain the load balancer target group ARN, the container name, and the container port to access from the load balancer. The container name must be as it appears in a container definition. The load balancer name parameter must be omitted. When a task from this service is placed on a container instance, the container instance and port combination is registered as a target in the target group that's specified here.</p>
251    /// <p>For Classic Load Balancers, this object must contain the load balancer name, the container name , and the container port to access from the load balancer. The container name must be as it appears in a container definition. The target group ARN parameter must be omitted. When a task from this service is placed on a container instance, the container instance is registered with the load balancer that's specified here.</p>
252    /// <p>Services with tasks that use the <code>awsvpc</code> network mode (for example, those with the Fargate launch type) only support Application Load Balancers and Network Load Balancers. Classic Load Balancers aren't supported. Also, when you create any target groups for these services, you must choose <code>ip</code> as the target type, not <code>instance</code>. This is because tasks that use the <code>awsvpc</code> network mode are associated with an elastic network interface, not an Amazon EC2 instance.</p>
253    pub fn load_balancers(mut self, input: crate::types::LoadBalancer) -> Self {
254        self.inner = self.inner.load_balancers(input);
255        self
256    }
257    /// <p>A load balancer object representing the load balancers to use with your service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html">Service load balancing</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
258    /// <p>If the service uses the rolling update (<code>ECS</code>) deployment controller and using either an Application Load Balancer or Network Load Balancer, you must specify one or more target group ARNs to attach to the service. The service-linked role is required for services that use multiple target groups. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html">Using service-linked roles for Amazon ECS</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
259    /// <p>If the service uses the <code>CODE_DEPLOY</code> deployment controller, the service is required to use either an Application Load Balancer or Network Load Balancer. When creating an CodeDeploy deployment group, you specify two target groups (referred to as a <code>targetGroupPair</code>). During a deployment, CodeDeploy determines which task set in your service has the status <code>PRIMARY</code>, and it associates one target group with it. Then, it also associates the other target group with the replacement task set. The load balancer can also have up to two listeners: a required listener for production traffic and an optional listener that you can use to perform validation tests with Lambda functions before routing production traffic to it.</p>
260    /// <p>If you use the <code>CODE_DEPLOY</code> deployment controller, these values can be changed when updating the service.</p>
261    /// <p>For Application Load Balancers and Network Load Balancers, this object must contain the load balancer target group ARN, the container name, and the container port to access from the load balancer. The container name must be as it appears in a container definition. The load balancer name parameter must be omitted. When a task from this service is placed on a container instance, the container instance and port combination is registered as a target in the target group that's specified here.</p>
262    /// <p>For Classic Load Balancers, this object must contain the load balancer name, the container name , and the container port to access from the load balancer. The container name must be as it appears in a container definition. The target group ARN parameter must be omitted. When a task from this service is placed on a container instance, the container instance is registered with the load balancer that's specified here.</p>
263    /// <p>Services with tasks that use the <code>awsvpc</code> network mode (for example, those with the Fargate launch type) only support Application Load Balancers and Network Load Balancers. Classic Load Balancers aren't supported. Also, when you create any target groups for these services, you must choose <code>ip</code> as the target type, not <code>instance</code>. This is because tasks that use the <code>awsvpc</code> network mode are associated with an elastic network interface, not an Amazon EC2 instance.</p>
264    pub fn set_load_balancers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LoadBalancer>>) -> Self {
265        self.inner = self.inner.set_load_balancers(input);
266        self
267    }
268    /// <p>A load balancer object representing the load balancers to use with your service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html">Service load balancing</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
269    /// <p>If the service uses the rolling update (<code>ECS</code>) deployment controller and using either an Application Load Balancer or Network Load Balancer, you must specify one or more target group ARNs to attach to the service. The service-linked role is required for services that use multiple target groups. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html">Using service-linked roles for Amazon ECS</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
270    /// <p>If the service uses the <code>CODE_DEPLOY</code> deployment controller, the service is required to use either an Application Load Balancer or Network Load Balancer. When creating an CodeDeploy deployment group, you specify two target groups (referred to as a <code>targetGroupPair</code>). During a deployment, CodeDeploy determines which task set in your service has the status <code>PRIMARY</code>, and it associates one target group with it. Then, it also associates the other target group with the replacement task set. The load balancer can also have up to two listeners: a required listener for production traffic and an optional listener that you can use to perform validation tests with Lambda functions before routing production traffic to it.</p>
271    /// <p>If you use the <code>CODE_DEPLOY</code> deployment controller, these values can be changed when updating the service.</p>
272    /// <p>For Application Load Balancers and Network Load Balancers, this object must contain the load balancer target group ARN, the container name, and the container port to access from the load balancer. The container name must be as it appears in a container definition. The load balancer name parameter must be omitted. When a task from this service is placed on a container instance, the container instance and port combination is registered as a target in the target group that's specified here.</p>
273    /// <p>For Classic Load Balancers, this object must contain the load balancer name, the container name , and the container port to access from the load balancer. The container name must be as it appears in a container definition. The target group ARN parameter must be omitted. When a task from this service is placed on a container instance, the container instance is registered with the load balancer that's specified here.</p>
274    /// <p>Services with tasks that use the <code>awsvpc</code> network mode (for example, those with the Fargate launch type) only support Application Load Balancers and Network Load Balancers. Classic Load Balancers aren't supported. Also, when you create any target groups for these services, you must choose <code>ip</code> as the target type, not <code>instance</code>. This is because tasks that use the <code>awsvpc</code> network mode are associated with an elastic network interface, not an Amazon EC2 instance.</p>
275    pub fn get_load_balancers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LoadBalancer>> {
276        self.inner.get_load_balancers()
277    }
278    ///
279    /// Appends an item to `serviceRegistries`.
280    ///
281    /// To override the contents of this collection use [`set_service_registries`](Self::set_service_registries).
282    ///
283    /// <p>The details of the service discovery registry to associate with this service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html">Service discovery</a>.</p><note>
284    /// <p>Each service may be associated with one service registry. Multiple service registries for each service isn't supported.</p>
285    /// </note>
286    pub fn service_registries(mut self, input: crate::types::ServiceRegistry) -> Self {
287        self.inner = self.inner.service_registries(input);
288        self
289    }
290    /// <p>The details of the service discovery registry to associate with this service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html">Service discovery</a>.</p><note>
291    /// <p>Each service may be associated with one service registry. Multiple service registries for each service isn't supported.</p>
292    /// </note>
293    pub fn set_service_registries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ServiceRegistry>>) -> Self {
294        self.inner = self.inner.set_service_registries(input);
295        self
296    }
297    /// <p>The details of the service discovery registry to associate with this service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html">Service discovery</a>.</p><note>
298    /// <p>Each service may be associated with one service registry. Multiple service registries for each service isn't supported.</p>
299    /// </note>
300    pub fn get_service_registries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ServiceRegistry>> {
301        self.inner.get_service_registries()
302    }
303    /// <p>The number of instantiations of the specified task definition to place and keep running in your service.</p>
304    /// <p>This is required if <code>schedulingStrategy</code> is <code>REPLICA</code> or isn't specified. If <code>schedulingStrategy</code> is <code>DAEMON</code> then this isn't required.</p>
305    pub fn desired_count(mut self, input: i32) -> Self {
306        self.inner = self.inner.desired_count(input);
307        self
308    }
309    /// <p>The number of instantiations of the specified task definition to place and keep running in your service.</p>
310    /// <p>This is required if <code>schedulingStrategy</code> is <code>REPLICA</code> or isn't specified. If <code>schedulingStrategy</code> is <code>DAEMON</code> then this isn't required.</p>
311    pub fn set_desired_count(mut self, input: ::std::option::Option<i32>) -> Self {
312        self.inner = self.inner.set_desired_count(input);
313        self
314    }
315    /// <p>The number of instantiations of the specified task definition to place and keep running in your service.</p>
316    /// <p>This is required if <code>schedulingStrategy</code> is <code>REPLICA</code> or isn't specified. If <code>schedulingStrategy</code> is <code>DAEMON</code> then this isn't required.</p>
317    pub fn get_desired_count(&self) -> &::std::option::Option<i32> {
318        self.inner.get_desired_count()
319    }
320    /// <p>An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 36 ASCII characters in the range of 33-126 (inclusive) are allowed.</p>
321    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
322        self.inner = self.inner.client_token(input.into());
323        self
324    }
325    /// <p>An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 36 ASCII characters in the range of 33-126 (inclusive) are allowed.</p>
326    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
327        self.inner = self.inner.set_client_token(input);
328        self
329    }
330    /// <p>An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 36 ASCII characters in the range of 33-126 (inclusive) are allowed.</p>
331    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
332        self.inner.get_client_token()
333    }
334    /// <p>The infrastructure that you run your service on. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html">Amazon ECS launch types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
335    /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
336    /// <p>Fargate Spot infrastructure is available for use but a capacity provider strategy must be used. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-capacity-providers.html">Fargate capacity providers</a> in the <i>Amazon ECS Developer Guide</i>.</p>
337    /// </note>
338    /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
339    /// <p>The <code>EXTERNAL</code> launch type runs your tasks on your on-premises server or virtual machine (VM) capacity registered to your cluster.</p>
340    /// <p>A service can use either a launch type or a capacity provider strategy. If a <code>launchType</code> is specified, the <code>capacityProviderStrategy</code> parameter must be omitted.</p>
341    pub fn launch_type(mut self, input: crate::types::LaunchType) -> Self {
342        self.inner = self.inner.launch_type(input);
343        self
344    }
345    /// <p>The infrastructure that you run your service on. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html">Amazon ECS launch types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
346    /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
347    /// <p>Fargate Spot infrastructure is available for use but a capacity provider strategy must be used. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-capacity-providers.html">Fargate capacity providers</a> in the <i>Amazon ECS Developer Guide</i>.</p>
348    /// </note>
349    /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
350    /// <p>The <code>EXTERNAL</code> launch type runs your tasks on your on-premises server or virtual machine (VM) capacity registered to your cluster.</p>
351    /// <p>A service can use either a launch type or a capacity provider strategy. If a <code>launchType</code> is specified, the <code>capacityProviderStrategy</code> parameter must be omitted.</p>
352    pub fn set_launch_type(mut self, input: ::std::option::Option<crate::types::LaunchType>) -> Self {
353        self.inner = self.inner.set_launch_type(input);
354        self
355    }
356    /// <p>The infrastructure that you run your service on. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html">Amazon ECS launch types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
357    /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
358    /// <p>Fargate Spot infrastructure is available for use but a capacity provider strategy must be used. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-capacity-providers.html">Fargate capacity providers</a> in the <i>Amazon ECS Developer Guide</i>.</p>
359    /// </note>
360    /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
361    /// <p>The <code>EXTERNAL</code> launch type runs your tasks on your on-premises server or virtual machine (VM) capacity registered to your cluster.</p>
362    /// <p>A service can use either a launch type or a capacity provider strategy. If a <code>launchType</code> is specified, the <code>capacityProviderStrategy</code> parameter must be omitted.</p>
363    pub fn get_launch_type(&self) -> &::std::option::Option<crate::types::LaunchType> {
364        self.inner.get_launch_type()
365    }
366    ///
367    /// Appends an item to `capacityProviderStrategy`.
368    ///
369    /// To override the contents of this collection use [`set_capacity_provider_strategy`](Self::set_capacity_provider_strategy).
370    ///
371    /// <p>The capacity provider strategy to use for the service.</p>
372    /// <p>If a <code>capacityProviderStrategy</code> is specified, the <code>launchType</code> parameter must be omitted. If no <code>capacityProviderStrategy</code> or <code>launchType</code> is specified, the <code>defaultCapacityProviderStrategy</code> for the cluster is used.</p>
373    /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
374    pub fn capacity_provider_strategy(mut self, input: crate::types::CapacityProviderStrategyItem) -> Self {
375        self.inner = self.inner.capacity_provider_strategy(input);
376        self
377    }
378    /// <p>The capacity provider strategy to use for the service.</p>
379    /// <p>If a <code>capacityProviderStrategy</code> is specified, the <code>launchType</code> parameter must be omitted. If no <code>capacityProviderStrategy</code> or <code>launchType</code> is specified, the <code>defaultCapacityProviderStrategy</code> for the cluster is used.</p>
380    /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
381    pub fn set_capacity_provider_strategy(
382        mut self,
383        input: ::std::option::Option<::std::vec::Vec<crate::types::CapacityProviderStrategyItem>>,
384    ) -> Self {
385        self.inner = self.inner.set_capacity_provider_strategy(input);
386        self
387    }
388    /// <p>The capacity provider strategy to use for the service.</p>
389    /// <p>If a <code>capacityProviderStrategy</code> is specified, the <code>launchType</code> parameter must be omitted. If no <code>capacityProviderStrategy</code> or <code>launchType</code> is specified, the <code>defaultCapacityProviderStrategy</code> for the cluster is used.</p>
390    /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
391    pub fn get_capacity_provider_strategy(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CapacityProviderStrategyItem>> {
392        self.inner.get_capacity_provider_strategy()
393    }
394    /// <p>The platform version that your tasks in the service are running on. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the <code>LATEST</code> platform version is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html">Fargate platform versions</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
395    pub fn platform_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
396        self.inner = self.inner.platform_version(input.into());
397        self
398    }
399    /// <p>The platform version that your tasks in the service are running on. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the <code>LATEST</code> platform version is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html">Fargate platform versions</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
400    pub fn set_platform_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
401        self.inner = self.inner.set_platform_version(input);
402        self
403    }
404    /// <p>The platform version that your tasks in the service are running on. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the <code>LATEST</code> platform version is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html">Fargate platform versions</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
405    pub fn get_platform_version(&self) -> &::std::option::Option<::std::string::String> {
406        self.inner.get_platform_version()
407    }
408    /// <p>The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is only permitted if you are using a load balancer with your service and your task definition doesn't use the <code>awsvpc</code> network mode. If you specify the <code>role</code> parameter, you must also specify a load balancer object with the <code>loadBalancers</code> parameter.</p><important>
409    /// <p>If your account has already created the Amazon ECS service-linked role, that role is used for your service unless you specify a role here. The service-linked role is required if your task definition uses the <code>awsvpc</code> network mode or if the service is configured to use service discovery, an external deployment controller, multiple target groups, or Elastic Inference accelerators in which case you don't specify a role here. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html">Using service-linked roles for Amazon ECS</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
410    /// </important>
411    /// <p>If your specified role has a path other than <code>/</code>, then you must either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a role with the name <code>bar</code> has a path of <code>/foo/</code> then you would specify <code>/foo/bar</code> as the role name. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names">Friendly names and paths</a> in the <i>IAM User Guide</i>.</p>
412    pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
413        self.inner = self.inner.role(input.into());
414        self
415    }
416    /// <p>The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is only permitted if you are using a load balancer with your service and your task definition doesn't use the <code>awsvpc</code> network mode. If you specify the <code>role</code> parameter, you must also specify a load balancer object with the <code>loadBalancers</code> parameter.</p><important>
417    /// <p>If your account has already created the Amazon ECS service-linked role, that role is used for your service unless you specify a role here. The service-linked role is required if your task definition uses the <code>awsvpc</code> network mode or if the service is configured to use service discovery, an external deployment controller, multiple target groups, or Elastic Inference accelerators in which case you don't specify a role here. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html">Using service-linked roles for Amazon ECS</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
418    /// </important>
419    /// <p>If your specified role has a path other than <code>/</code>, then you must either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a role with the name <code>bar</code> has a path of <code>/foo/</code> then you would specify <code>/foo/bar</code> as the role name. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names">Friendly names and paths</a> in the <i>IAM User Guide</i>.</p>
420    pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
421        self.inner = self.inner.set_role(input);
422        self
423    }
424    /// <p>The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is only permitted if you are using a load balancer with your service and your task definition doesn't use the <code>awsvpc</code> network mode. If you specify the <code>role</code> parameter, you must also specify a load balancer object with the <code>loadBalancers</code> parameter.</p><important>
425    /// <p>If your account has already created the Amazon ECS service-linked role, that role is used for your service unless you specify a role here. The service-linked role is required if your task definition uses the <code>awsvpc</code> network mode or if the service is configured to use service discovery, an external deployment controller, multiple target groups, or Elastic Inference accelerators in which case you don't specify a role here. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html">Using service-linked roles for Amazon ECS</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
426    /// </important>
427    /// <p>If your specified role has a path other than <code>/</code>, then you must either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a role with the name <code>bar</code> has a path of <code>/foo/</code> then you would specify <code>/foo/bar</code> as the role name. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names">Friendly names and paths</a> in the <i>IAM User Guide</i>.</p>
428    pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
429        self.inner.get_role()
430    }
431    /// <p>Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.</p>
432    pub fn deployment_configuration(mut self, input: crate::types::DeploymentConfiguration) -> Self {
433        self.inner = self.inner.deployment_configuration(input);
434        self
435    }
436    /// <p>Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.</p>
437    pub fn set_deployment_configuration(mut self, input: ::std::option::Option<crate::types::DeploymentConfiguration>) -> Self {
438        self.inner = self.inner.set_deployment_configuration(input);
439        self
440    }
441    /// <p>Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.</p>
442    pub fn get_deployment_configuration(&self) -> &::std::option::Option<crate::types::DeploymentConfiguration> {
443        self.inner.get_deployment_configuration()
444    }
445    ///
446    /// Appends an item to `placementConstraints`.
447    ///
448    /// To override the contents of this collection use [`set_placement_constraints`](Self::set_placement_constraints).
449    ///
450    /// <p>An array of placement constraint objects to use for tasks in your service. You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition and those specified at runtime.</p>
451    pub fn placement_constraints(mut self, input: crate::types::PlacementConstraint) -> Self {
452        self.inner = self.inner.placement_constraints(input);
453        self
454    }
455    /// <p>An array of placement constraint objects to use for tasks in your service. You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition and those specified at runtime.</p>
456    pub fn set_placement_constraints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlacementConstraint>>) -> Self {
457        self.inner = self.inner.set_placement_constraints(input);
458        self
459    }
460    /// <p>An array of placement constraint objects to use for tasks in your service. You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition and those specified at runtime.</p>
461    pub fn get_placement_constraints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlacementConstraint>> {
462        self.inner.get_placement_constraints()
463    }
464    ///
465    /// Appends an item to `placementStrategy`.
466    ///
467    /// To override the contents of this collection use [`set_placement_strategy`](Self::set_placement_strategy).
468    ///
469    /// <p>The placement strategy objects to use for tasks in your service. You can specify a maximum of 5 strategy rules for each service.</p>
470    pub fn placement_strategy(mut self, input: crate::types::PlacementStrategy) -> Self {
471        self.inner = self.inner.placement_strategy(input);
472        self
473    }
474    /// <p>The placement strategy objects to use for tasks in your service. You can specify a maximum of 5 strategy rules for each service.</p>
475    pub fn set_placement_strategy(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlacementStrategy>>) -> Self {
476        self.inner = self.inner.set_placement_strategy(input);
477        self
478    }
479    /// <p>The placement strategy objects to use for tasks in your service. You can specify a maximum of 5 strategy rules for each service.</p>
480    pub fn get_placement_strategy(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlacementStrategy>> {
481        self.inner.get_placement_strategy()
482    }
483    /// <p>The network configuration for the service. This parameter is required for task definitions that use the <code>awsvpc</code> network mode to receive their own elastic network interface, and it isn't supported for other network modes. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html">Task networking</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
484    pub fn network_configuration(mut self, input: crate::types::NetworkConfiguration) -> Self {
485        self.inner = self.inner.network_configuration(input);
486        self
487    }
488    /// <p>The network configuration for the service. This parameter is required for task definitions that use the <code>awsvpc</code> network mode to receive their own elastic network interface, and it isn't supported for other network modes. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html">Task networking</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
489    pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::NetworkConfiguration>) -> Self {
490        self.inner = self.inner.set_network_configuration(input);
491        self
492    }
493    /// <p>The network configuration for the service. This parameter is required for task definitions that use the <code>awsvpc</code> network mode to receive their own elastic network interface, and it isn't supported for other network modes. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html">Task networking</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
494    pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::NetworkConfiguration> {
495        self.inner.get_network_configuration()
496    }
497    /// <p>The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing, VPC Lattice, and container health checks after a task has first started. If you don't specify a health check grace period value, the default value of <code>0</code> is used. If you don't use any of the health checks, then <code>healthCheckGracePeriodSeconds</code> is unused.</p>
498    /// <p>If your service's tasks take a while to start and respond to health checks, you can specify a health check grace period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy and stopping them before they have time to come up.</p>
499    pub fn health_check_grace_period_seconds(mut self, input: i32) -> Self {
500        self.inner = self.inner.health_check_grace_period_seconds(input);
501        self
502    }
503    /// <p>The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing, VPC Lattice, and container health checks after a task has first started. If you don't specify a health check grace period value, the default value of <code>0</code> is used. If you don't use any of the health checks, then <code>healthCheckGracePeriodSeconds</code> is unused.</p>
504    /// <p>If your service's tasks take a while to start and respond to health checks, you can specify a health check grace period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy and stopping them before they have time to come up.</p>
505    pub fn set_health_check_grace_period_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
506        self.inner = self.inner.set_health_check_grace_period_seconds(input);
507        self
508    }
509    /// <p>The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing, VPC Lattice, and container health checks after a task has first started. If you don't specify a health check grace period value, the default value of <code>0</code> is used. If you don't use any of the health checks, then <code>healthCheckGracePeriodSeconds</code> is unused.</p>
510    /// <p>If your service's tasks take a while to start and respond to health checks, you can specify a health check grace period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy and stopping them before they have time to come up.</p>
511    pub fn get_health_check_grace_period_seconds(&self) -> &::std::option::Option<i32> {
512        self.inner.get_health_check_grace_period_seconds()
513    }
514    /// <p>The scheduling strategy to use for the service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html">Services</a>.</p>
515    /// <p>There are two service scheduler strategies available:</p>
516    /// <ul>
517    /// <li>
518    /// <p><code>REPLICA</code>-The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. This scheduler strategy is required if the service uses the <code>CODE_DEPLOY</code> or <code>EXTERNAL</code> deployment controller types.</p></li>
519    /// <li>
520    /// <p><code>DAEMON</code>-The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies.</p><note>
521    /// <p>Tasks using the Fargate launch type or the <code>CODE_DEPLOY</code> or <code>EXTERNAL</code> deployment controller types don't support the <code>DAEMON</code> scheduling strategy.</p>
522    /// </note></li>
523    /// </ul>
524    pub fn scheduling_strategy(mut self, input: crate::types::SchedulingStrategy) -> Self {
525        self.inner = self.inner.scheduling_strategy(input);
526        self
527    }
528    /// <p>The scheduling strategy to use for the service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html">Services</a>.</p>
529    /// <p>There are two service scheduler strategies available:</p>
530    /// <ul>
531    /// <li>
532    /// <p><code>REPLICA</code>-The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. This scheduler strategy is required if the service uses the <code>CODE_DEPLOY</code> or <code>EXTERNAL</code> deployment controller types.</p></li>
533    /// <li>
534    /// <p><code>DAEMON</code>-The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies.</p><note>
535    /// <p>Tasks using the Fargate launch type or the <code>CODE_DEPLOY</code> or <code>EXTERNAL</code> deployment controller types don't support the <code>DAEMON</code> scheduling strategy.</p>
536    /// </note></li>
537    /// </ul>
538    pub fn set_scheduling_strategy(mut self, input: ::std::option::Option<crate::types::SchedulingStrategy>) -> Self {
539        self.inner = self.inner.set_scheduling_strategy(input);
540        self
541    }
542    /// <p>The scheduling strategy to use for the service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html">Services</a>.</p>
543    /// <p>There are two service scheduler strategies available:</p>
544    /// <ul>
545    /// <li>
546    /// <p><code>REPLICA</code>-The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. This scheduler strategy is required if the service uses the <code>CODE_DEPLOY</code> or <code>EXTERNAL</code> deployment controller types.</p></li>
547    /// <li>
548    /// <p><code>DAEMON</code>-The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies.</p><note>
549    /// <p>Tasks using the Fargate launch type or the <code>CODE_DEPLOY</code> or <code>EXTERNAL</code> deployment controller types don't support the <code>DAEMON</code> scheduling strategy.</p>
550    /// </note></li>
551    /// </ul>
552    pub fn get_scheduling_strategy(&self) -> &::std::option::Option<crate::types::SchedulingStrategy> {
553        self.inner.get_scheduling_strategy()
554    }
555    /// <p>The deployment controller to use for the service. If no deployment controller is specified, the default value of <code>ECS</code> is used.</p>
556    pub fn deployment_controller(mut self, input: crate::types::DeploymentController) -> Self {
557        self.inner = self.inner.deployment_controller(input);
558        self
559    }
560    /// <p>The deployment controller to use for the service. If no deployment controller is specified, the default value of <code>ECS</code> is used.</p>
561    pub fn set_deployment_controller(mut self, input: ::std::option::Option<crate::types::DeploymentController>) -> Self {
562        self.inner = self.inner.set_deployment_controller(input);
563        self
564    }
565    /// <p>The deployment controller to use for the service. If no deployment controller is specified, the default value of <code>ECS</code> is used.</p>
566    pub fn get_deployment_controller(&self) -> &::std::option::Option<crate::types::DeploymentController> {
567        self.inner.get_deployment_controller()
568    }
569    ///
570    /// Appends an item to `tags`.
571    ///
572    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
573    ///
574    /// <p>The metadata that you apply to the service to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. When a service is deleted, the tags are deleted as well.</p>
575    /// <p>The following basic restrictions apply to tags:</p>
576    /// <ul>
577    /// <li>
578    /// <p>Maximum number of tags per resource - 50</p></li>
579    /// <li>
580    /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
581    /// <li>
582    /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
583    /// <li>
584    /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
585    /// <li>
586    /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
587    /// <li>
588    /// <p>Tag keys and values are case-sensitive.</p></li>
589    /// <li>
590    /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li>
591    /// </ul>
592    pub fn tags(mut self, input: crate::types::Tag) -> Self {
593        self.inner = self.inner.tags(input);
594        self
595    }
596    /// <p>The metadata that you apply to the service to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. When a service is deleted, the tags are deleted as well.</p>
597    /// <p>The following basic restrictions apply to tags:</p>
598    /// <ul>
599    /// <li>
600    /// <p>Maximum number of tags per resource - 50</p></li>
601    /// <li>
602    /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
603    /// <li>
604    /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
605    /// <li>
606    /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
607    /// <li>
608    /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
609    /// <li>
610    /// <p>Tag keys and values are case-sensitive.</p></li>
611    /// <li>
612    /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li>
613    /// </ul>
614    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
615        self.inner = self.inner.set_tags(input);
616        self
617    }
618    /// <p>The metadata that you apply to the service to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. When a service is deleted, the tags are deleted as well.</p>
619    /// <p>The following basic restrictions apply to tags:</p>
620    /// <ul>
621    /// <li>
622    /// <p>Maximum number of tags per resource - 50</p></li>
623    /// <li>
624    /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
625    /// <li>
626    /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
627    /// <li>
628    /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
629    /// <li>
630    /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
631    /// <li>
632    /// <p>Tag keys and values are case-sensitive.</p></li>
633    /// <li>
634    /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li>
635    /// </ul>
636    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
637        self.inner.get_tags()
638    }
639    /// <p>Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html">Tagging your Amazon ECS resources</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
640    /// <p>When you use Amazon ECS managed tags, you must set the <code>propagateTags</code> request parameter.</p>
641    pub fn enable_ecs_managed_tags(mut self, input: bool) -> Self {
642        self.inner = self.inner.enable_ecs_managed_tags(input);
643        self
644    }
645    /// <p>Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html">Tagging your Amazon ECS resources</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
646    /// <p>When you use Amazon ECS managed tags, you must set the <code>propagateTags</code> request parameter.</p>
647    pub fn set_enable_ecs_managed_tags(mut self, input: ::std::option::Option<bool>) -> Self {
648        self.inner = self.inner.set_enable_ecs_managed_tags(input);
649        self
650    }
651    /// <p>Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html">Tagging your Amazon ECS resources</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
652    /// <p>When you use Amazon ECS managed tags, you must set the <code>propagateTags</code> request parameter.</p>
653    pub fn get_enable_ecs_managed_tags(&self) -> &::std::option::Option<bool> {
654        self.inner.get_enable_ecs_managed_tags()
655    }
656    /// <p>Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html">TagResource</a> API action.</p>
657    /// <p>You must set this to a value other than <code>NONE</code> when you use Cost Explorer. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/usage-reports.html">Amazon ECS usage reports</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
658    /// <p>The default is <code>NONE</code>.</p>
659    pub fn propagate_tags(mut self, input: crate::types::PropagateTags) -> Self {
660        self.inner = self.inner.propagate_tags(input);
661        self
662    }
663    /// <p>Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html">TagResource</a> API action.</p>
664    /// <p>You must set this to a value other than <code>NONE</code> when you use Cost Explorer. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/usage-reports.html">Amazon ECS usage reports</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
665    /// <p>The default is <code>NONE</code>.</p>
666    pub fn set_propagate_tags(mut self, input: ::std::option::Option<crate::types::PropagateTags>) -> Self {
667        self.inner = self.inner.set_propagate_tags(input);
668        self
669    }
670    /// <p>Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html">TagResource</a> API action.</p>
671    /// <p>You must set this to a value other than <code>NONE</code> when you use Cost Explorer. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/usage-reports.html">Amazon ECS usage reports</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
672    /// <p>The default is <code>NONE</code>.</p>
673    pub fn get_propagate_tags(&self) -> &::std::option::Option<crate::types::PropagateTags> {
674        self.inner.get_propagate_tags()
675    }
676    /// <p>Determines whether the execute command functionality is turned on for the service. If <code>true</code>, this enables execute command functionality on all containers in the service tasks.</p>
677    pub fn enable_execute_command(mut self, input: bool) -> Self {
678        self.inner = self.inner.enable_execute_command(input);
679        self
680    }
681    /// <p>Determines whether the execute command functionality is turned on for the service. If <code>true</code>, this enables execute command functionality on all containers in the service tasks.</p>
682    pub fn set_enable_execute_command(mut self, input: ::std::option::Option<bool>) -> Self {
683        self.inner = self.inner.set_enable_execute_command(input);
684        self
685    }
686    /// <p>Determines whether the execute command functionality is turned on for the service. If <code>true</code>, this enables execute command functionality on all containers in the service tasks.</p>
687    pub fn get_enable_execute_command(&self) -> &::std::option::Option<bool> {
688        self.inner.get_enable_execute_command()
689    }
690    /// <p>The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace.</p>
691    /// <p>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 <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
692    pub fn service_connect_configuration(mut self, input: crate::types::ServiceConnectConfiguration) -> Self {
693        self.inner = self.inner.service_connect_configuration(input);
694        self
695    }
696    /// <p>The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace.</p>
697    /// <p>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 <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
698    pub fn set_service_connect_configuration(mut self, input: ::std::option::Option<crate::types::ServiceConnectConfiguration>) -> Self {
699        self.inner = self.inner.set_service_connect_configuration(input);
700        self
701    }
702    /// <p>The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace.</p>
703    /// <p>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 <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
704    pub fn get_service_connect_configuration(&self) -> &::std::option::Option<crate::types::ServiceConnectConfiguration> {
705        self.inner.get_service_connect_configuration()
706    }
707    ///
708    /// Appends an item to `volumeConfigurations`.
709    ///
710    /// To override the contents of this collection use [`set_volume_configurations`](Self::set_volume_configurations).
711    ///
712    /// <p>The configuration for a volume specified in the task definition as a volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume.</p>
713    pub fn volume_configurations(mut self, input: crate::types::ServiceVolumeConfiguration) -> Self {
714        self.inner = self.inner.volume_configurations(input);
715        self
716    }
717    /// <p>The configuration for a volume specified in the task definition as a volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume.</p>
718    pub fn set_volume_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ServiceVolumeConfiguration>>) -> Self {
719        self.inner = self.inner.set_volume_configurations(input);
720        self
721    }
722    /// <p>The configuration for a volume specified in the task definition as a volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume.</p>
723    pub fn get_volume_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ServiceVolumeConfiguration>> {
724        self.inner.get_volume_configurations()
725    }
726    ///
727    /// Appends an item to `vpcLatticeConfigurations`.
728    ///
729    /// To override the contents of this collection use [`set_vpc_lattice_configurations`](Self::set_vpc_lattice_configurations).
730    ///
731    /// <p>The VPC Lattice configuration for the service being created.</p>
732    pub fn vpc_lattice_configurations(mut self, input: crate::types::VpcLatticeConfiguration) -> Self {
733        self.inner = self.inner.vpc_lattice_configurations(input);
734        self
735    }
736    /// <p>The VPC Lattice configuration for the service being created.</p>
737    pub fn set_vpc_lattice_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VpcLatticeConfiguration>>) -> Self {
738        self.inner = self.inner.set_vpc_lattice_configurations(input);
739        self
740    }
741    /// <p>The VPC Lattice configuration for the service being created.</p>
742    pub fn get_vpc_lattice_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VpcLatticeConfiguration>> {
743        self.inner.get_vpc_lattice_configurations()
744    }
745}