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    /// <p>The default behavior of <code>AvailabilityZoneRebalancing</code> differs between create and update requests:</p>
227    /// <ul>
228    /// <li>
229    /// <p>For create service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults the value to <code>ENABLED</code>.</p></li>
230    /// <li>
231    /// <p>For update service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults to the existing service’s <code>AvailabilityZoneRebalancing</code> value. If the service never had an <code>AvailabilityZoneRebalancing</code> value set, Amazon ECS treats this as <code>DISABLED</code>.</p></li>
232    /// </ul>
233    pub fn availability_zone_rebalancing(mut self, input: crate::types::AvailabilityZoneRebalancing) -> Self {
234        self.inner = self.inner.availability_zone_rebalancing(input);
235        self
236    }
237    /// <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
238    /// <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>
239    /// <p>The default behavior of <code>AvailabilityZoneRebalancing</code> differs between create and update requests:</p>
240    /// <ul>
241    /// <li>
242    /// <p>For create service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults the value to <code>ENABLED</code>.</p></li>
243    /// <li>
244    /// <p>For update service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults to the existing service’s <code>AvailabilityZoneRebalancing</code> value. If the service never had an <code>AvailabilityZoneRebalancing</code> value set, Amazon ECS treats this as <code>DISABLED</code>.</p></li>
245    /// </ul>
246    pub fn set_availability_zone_rebalancing(mut self, input: ::std::option::Option<crate::types::AvailabilityZoneRebalancing>) -> Self {
247        self.inner = self.inner.set_availability_zone_rebalancing(input);
248        self
249    }
250    /// <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
251    /// <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>
252    /// <p>The default behavior of <code>AvailabilityZoneRebalancing</code> differs between create and update requests:</p>
253    /// <ul>
254    /// <li>
255    /// <p>For create service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults the value to <code>ENABLED</code>.</p></li>
256    /// <li>
257    /// <p>For update service requests, when no value is specified for <code>AvailabilityZoneRebalancing</code>, Amazon ECS defaults to the existing service’s <code>AvailabilityZoneRebalancing</code> value. If the service never had an <code>AvailabilityZoneRebalancing</code> value set, Amazon ECS treats this as <code>DISABLED</code>.</p></li>
258    /// </ul>
259    pub fn get_availability_zone_rebalancing(&self) -> &::std::option::Option<crate::types::AvailabilityZoneRebalancing> {
260        self.inner.get_availability_zone_rebalancing()
261    }
262    ///
263    /// Appends an item to `loadBalancers`.
264    ///
265    /// To override the contents of this collection use [`set_load_balancers`](Self::set_load_balancers).
266    ///
267    /// <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>
268    /// <p>If the service uses the <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>
269    /// <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>
270    /// <p>If you use the <code>CODE_DEPLOY</code> deployment controller, these values can be changed when updating the service.</p>
271    /// <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>
272    /// <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>
273    /// <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>
274    pub fn load_balancers(mut self, input: crate::types::LoadBalancer) -> Self {
275        self.inner = self.inner.load_balancers(input);
276        self
277    }
278    /// <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>
279    /// <p>If the service uses the <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>
280    /// <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>
281    /// <p>If you use the <code>CODE_DEPLOY</code> deployment controller, these values can be changed when updating the service.</p>
282    /// <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>
283    /// <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>
284    /// <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>
285    pub fn set_load_balancers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LoadBalancer>>) -> Self {
286        self.inner = self.inner.set_load_balancers(input);
287        self
288    }
289    /// <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>
290    /// <p>If the service uses the <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>
291    /// <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>
292    /// <p>If you use the <code>CODE_DEPLOY</code> deployment controller, these values can be changed when updating the service.</p>
293    /// <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>
294    /// <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>
295    /// <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>
296    pub fn get_load_balancers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LoadBalancer>> {
297        self.inner.get_load_balancers()
298    }
299    ///
300    /// Appends an item to `serviceRegistries`.
301    ///
302    /// To override the contents of this collection use [`set_service_registries`](Self::set_service_registries).
303    ///
304    /// <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>
305    /// <p>Each service may be associated with one service registry. Multiple service registries for each service isn't supported.</p>
306    /// </note>
307    pub fn service_registries(mut self, input: crate::types::ServiceRegistry) -> Self {
308        self.inner = self.inner.service_registries(input);
309        self
310    }
311    /// <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>
312    /// <p>Each service may be associated with one service registry. Multiple service registries for each service isn't supported.</p>
313    /// </note>
314    pub fn set_service_registries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ServiceRegistry>>) -> Self {
315        self.inner = self.inner.set_service_registries(input);
316        self
317    }
318    /// <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>
319    /// <p>Each service may be associated with one service registry. Multiple service registries for each service isn't supported.</p>
320    /// </note>
321    pub fn get_service_registries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ServiceRegistry>> {
322        self.inner.get_service_registries()
323    }
324    /// <p>The number of instantiations of the specified task definition to place and keep running in your service.</p>
325    /// <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>
326    pub fn desired_count(mut self, input: i32) -> Self {
327        self.inner = self.inner.desired_count(input);
328        self
329    }
330    /// <p>The number of instantiations of the specified task definition to place and keep running in your service.</p>
331    /// <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>
332    pub fn set_desired_count(mut self, input: ::std::option::Option<i32>) -> Self {
333        self.inner = self.inner.set_desired_count(input);
334        self
335    }
336    /// <p>The number of instantiations of the specified task definition to place and keep running in your service.</p>
337    /// <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>
338    pub fn get_desired_count(&self) -> &::std::option::Option<i32> {
339        self.inner.get_desired_count()
340    }
341    /// <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>
342    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
343        self.inner = self.inner.client_token(input.into());
344        self
345    }
346    /// <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>
347    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
348        self.inner = self.inner.set_client_token(input);
349        self
350    }
351    /// <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>
352    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
353        self.inner.get_client_token()
354    }
355    /// <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>
356    /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
357    /// <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>
358    /// </note>
359    /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
360    /// <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>
361    /// <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>
362    pub fn launch_type(mut self, input: crate::types::LaunchType) -> Self {
363        self.inner = self.inner.launch_type(input);
364        self
365    }
366    /// <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>
367    /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
368    /// <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>
369    /// </note>
370    /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
371    /// <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>
372    /// <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>
373    pub fn set_launch_type(mut self, input: ::std::option::Option<crate::types::LaunchType>) -> Self {
374        self.inner = self.inner.set_launch_type(input);
375        self
376    }
377    /// <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>
378    /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
379    /// <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>
380    /// </note>
381    /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
382    /// <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>
383    /// <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>
384    pub fn get_launch_type(&self) -> &::std::option::Option<crate::types::LaunchType> {
385        self.inner.get_launch_type()
386    }
387    ///
388    /// Appends an item to `capacityProviderStrategy`.
389    ///
390    /// To override the contents of this collection use [`set_capacity_provider_strategy`](Self::set_capacity_provider_strategy).
391    ///
392    /// <p>The capacity provider strategy to use for the service.</p>
393    /// <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>
394    /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
395    pub fn capacity_provider_strategy(mut self, input: crate::types::CapacityProviderStrategyItem) -> Self {
396        self.inner = self.inner.capacity_provider_strategy(input);
397        self
398    }
399    /// <p>The capacity provider strategy to use for the service.</p>
400    /// <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>
401    /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
402    pub fn set_capacity_provider_strategy(
403        mut self,
404        input: ::std::option::Option<::std::vec::Vec<crate::types::CapacityProviderStrategyItem>>,
405    ) -> Self {
406        self.inner = self.inner.set_capacity_provider_strategy(input);
407        self
408    }
409    /// <p>The capacity provider strategy to use for the service.</p>
410    /// <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>
411    /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
412    pub fn get_capacity_provider_strategy(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CapacityProviderStrategyItem>> {
413        self.inner.get_capacity_provider_strategy()
414    }
415    /// <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>
416    pub fn platform_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
417        self.inner = self.inner.platform_version(input.into());
418        self
419    }
420    /// <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>
421    pub fn set_platform_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
422        self.inner = self.inner.set_platform_version(input);
423        self
424    }
425    /// <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>
426    pub fn get_platform_version(&self) -> &::std::option::Option<::std::string::String> {
427        self.inner.get_platform_version()
428    }
429    /// <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>
430    /// <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>
431    /// </important>
432    /// <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>
433    pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
434        self.inner = self.inner.role(input.into());
435        self
436    }
437    /// <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>
438    /// <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>
439    /// </important>
440    /// <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>
441    pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
442        self.inner = self.inner.set_role(input);
443        self
444    }
445    /// <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>
446    /// <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>
447    /// </important>
448    /// <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>
449    pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
450        self.inner.get_role()
451    }
452    /// <p>Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.</p>
453    pub fn deployment_configuration(mut self, input: crate::types::DeploymentConfiguration) -> Self {
454        self.inner = self.inner.deployment_configuration(input);
455        self
456    }
457    /// <p>Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.</p>
458    pub fn set_deployment_configuration(mut self, input: ::std::option::Option<crate::types::DeploymentConfiguration>) -> Self {
459        self.inner = self.inner.set_deployment_configuration(input);
460        self
461    }
462    /// <p>Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.</p>
463    pub fn get_deployment_configuration(&self) -> &::std::option::Option<crate::types::DeploymentConfiguration> {
464        self.inner.get_deployment_configuration()
465    }
466    ///
467    /// Appends an item to `placementConstraints`.
468    ///
469    /// To override the contents of this collection use [`set_placement_constraints`](Self::set_placement_constraints).
470    ///
471    /// <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>
472    pub fn placement_constraints(mut self, input: crate::types::PlacementConstraint) -> Self {
473        self.inner = self.inner.placement_constraints(input);
474        self
475    }
476    /// <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>
477    pub fn set_placement_constraints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlacementConstraint>>) -> Self {
478        self.inner = self.inner.set_placement_constraints(input);
479        self
480    }
481    /// <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>
482    pub fn get_placement_constraints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlacementConstraint>> {
483        self.inner.get_placement_constraints()
484    }
485    ///
486    /// Appends an item to `placementStrategy`.
487    ///
488    /// To override the contents of this collection use [`set_placement_strategy`](Self::set_placement_strategy).
489    ///
490    /// <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>
491    pub fn placement_strategy(mut self, input: crate::types::PlacementStrategy) -> Self {
492        self.inner = self.inner.placement_strategy(input);
493        self
494    }
495    /// <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>
496    pub fn set_placement_strategy(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlacementStrategy>>) -> Self {
497        self.inner = self.inner.set_placement_strategy(input);
498        self
499    }
500    /// <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>
501    pub fn get_placement_strategy(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlacementStrategy>> {
502        self.inner.get_placement_strategy()
503    }
504    /// <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>
505    pub fn network_configuration(mut self, input: crate::types::NetworkConfiguration) -> Self {
506        self.inner = self.inner.network_configuration(input);
507        self
508    }
509    /// <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>
510    pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::NetworkConfiguration>) -> Self {
511        self.inner = self.inner.set_network_configuration(input);
512        self
513    }
514    /// <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>
515    pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::NetworkConfiguration> {
516        self.inner.get_network_configuration()
517    }
518    /// <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 do not specify a health check grace period value, the default value of 0 is used. If you do not use any of the health checks, then <code>healthCheckGracePeriodSeconds</code> is unused.</p>
519    /// <p>If your service has more running tasks than desired, unhealthy tasks in the grace period might be stopped to reach the desired count.</p>
520    pub fn health_check_grace_period_seconds(mut self, input: i32) -> Self {
521        self.inner = self.inner.health_check_grace_period_seconds(input);
522        self
523    }
524    /// <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 do not specify a health check grace period value, the default value of 0 is used. If you do not use any of the health checks, then <code>healthCheckGracePeriodSeconds</code> is unused.</p>
525    /// <p>If your service has more running tasks than desired, unhealthy tasks in the grace period might be stopped to reach the desired count.</p>
526    pub fn set_health_check_grace_period_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
527        self.inner = self.inner.set_health_check_grace_period_seconds(input);
528        self
529    }
530    /// <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 do not specify a health check grace period value, the default value of 0 is used. If you do not use any of the health checks, then <code>healthCheckGracePeriodSeconds</code> is unused.</p>
531    /// <p>If your service has more running tasks than desired, unhealthy tasks in the grace period might be stopped to reach the desired count.</p>
532    pub fn get_health_check_grace_period_seconds(&self) -> &::std::option::Option<i32> {
533        self.inner.get_health_check_grace_period_seconds()
534    }
535    /// <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>
536    /// <p>There are two service scheduler strategies available:</p>
537    /// <ul>
538    /// <li>
539    /// <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>
540    /// <li>
541    /// <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>
542    /// <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>
543    /// </note></li>
544    /// </ul>
545    pub fn scheduling_strategy(mut self, input: crate::types::SchedulingStrategy) -> Self {
546        self.inner = self.inner.scheduling_strategy(input);
547        self
548    }
549    /// <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>
550    /// <p>There are two service scheduler strategies available:</p>
551    /// <ul>
552    /// <li>
553    /// <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>
554    /// <li>
555    /// <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>
556    /// <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>
557    /// </note></li>
558    /// </ul>
559    pub fn set_scheduling_strategy(mut self, input: ::std::option::Option<crate::types::SchedulingStrategy>) -> Self {
560        self.inner = self.inner.set_scheduling_strategy(input);
561        self
562    }
563    /// <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>
564    /// <p>There are two service scheduler strategies available:</p>
565    /// <ul>
566    /// <li>
567    /// <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>
568    /// <li>
569    /// <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>
570    /// <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>
571    /// </note></li>
572    /// </ul>
573    pub fn get_scheduling_strategy(&self) -> &::std::option::Option<crate::types::SchedulingStrategy> {
574        self.inner.get_scheduling_strategy()
575    }
576    /// <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>
577    pub fn deployment_controller(mut self, input: crate::types::DeploymentController) -> Self {
578        self.inner = self.inner.deployment_controller(input);
579        self
580    }
581    /// <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>
582    pub fn set_deployment_controller(mut self, input: ::std::option::Option<crate::types::DeploymentController>) -> Self {
583        self.inner = self.inner.set_deployment_controller(input);
584        self
585    }
586    /// <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>
587    pub fn get_deployment_controller(&self) -> &::std::option::Option<crate::types::DeploymentController> {
588        self.inner.get_deployment_controller()
589    }
590    ///
591    /// Appends an item to `tags`.
592    ///
593    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
594    ///
595    /// <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>
596    /// <p>The following basic restrictions apply to tags:</p>
597    /// <ul>
598    /// <li>
599    /// <p>Maximum number of tags per resource - 50</p></li>
600    /// <li>
601    /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
602    /// <li>
603    /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
604    /// <li>
605    /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
606    /// <li>
607    /// <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>
608    /// <li>
609    /// <p>Tag keys and values are case-sensitive.</p></li>
610    /// <li>
611    /// <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>
612    /// </ul>
613    pub fn tags(mut self, input: crate::types::Tag) -> Self {
614        self.inner = self.inner.tags(input);
615        self
616    }
617    /// <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>
618    /// <p>The following basic restrictions apply to tags:</p>
619    /// <ul>
620    /// <li>
621    /// <p>Maximum number of tags per resource - 50</p></li>
622    /// <li>
623    /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
624    /// <li>
625    /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
626    /// <li>
627    /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
628    /// <li>
629    /// <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>
630    /// <li>
631    /// <p>Tag keys and values are case-sensitive.</p></li>
632    /// <li>
633    /// <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>
634    /// </ul>
635    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
636        self.inner = self.inner.set_tags(input);
637        self
638    }
639    /// <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>
640    /// <p>The following basic restrictions apply to tags:</p>
641    /// <ul>
642    /// <li>
643    /// <p>Maximum number of tags per resource - 50</p></li>
644    /// <li>
645    /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
646    /// <li>
647    /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
648    /// <li>
649    /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
650    /// <li>
651    /// <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>
652    /// <li>
653    /// <p>Tag keys and values are case-sensitive.</p></li>
654    /// <li>
655    /// <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>
656    /// </ul>
657    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
658        self.inner.get_tags()
659    }
660    /// <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>
661    /// <p>When you use Amazon ECS managed tags, you must set the <code>propagateTags</code> request parameter.</p>
662    pub fn enable_ecs_managed_tags(mut self, input: bool) -> Self {
663        self.inner = self.inner.enable_ecs_managed_tags(input);
664        self
665    }
666    /// <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>
667    /// <p>When you use Amazon ECS managed tags, you must set the <code>propagateTags</code> request parameter.</p>
668    pub fn set_enable_ecs_managed_tags(mut self, input: ::std::option::Option<bool>) -> Self {
669        self.inner = self.inner.set_enable_ecs_managed_tags(input);
670        self
671    }
672    /// <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>
673    /// <p>When you use Amazon ECS managed tags, you must set the <code>propagateTags</code> request parameter.</p>
674    pub fn get_enable_ecs_managed_tags(&self) -> &::std::option::Option<bool> {
675        self.inner.get_enable_ecs_managed_tags()
676    }
677    /// <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>
678    /// <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>
679    /// <p>The default is <code>NONE</code>.</p>
680    pub fn propagate_tags(mut self, input: crate::types::PropagateTags) -> Self {
681        self.inner = self.inner.propagate_tags(input);
682        self
683    }
684    /// <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>
685    /// <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>
686    /// <p>The default is <code>NONE</code>.</p>
687    pub fn set_propagate_tags(mut self, input: ::std::option::Option<crate::types::PropagateTags>) -> Self {
688        self.inner = self.inner.set_propagate_tags(input);
689        self
690    }
691    /// <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>
692    /// <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>
693    /// <p>The default is <code>NONE</code>.</p>
694    pub fn get_propagate_tags(&self) -> &::std::option::Option<crate::types::PropagateTags> {
695        self.inner.get_propagate_tags()
696    }
697    /// <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>
698    pub fn enable_execute_command(mut self, input: bool) -> Self {
699        self.inner = self.inner.enable_execute_command(input);
700        self
701    }
702    /// <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>
703    pub fn set_enable_execute_command(mut self, input: ::std::option::Option<bool>) -> Self {
704        self.inner = self.inner.set_enable_execute_command(input);
705        self
706    }
707    /// <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>
708    pub fn get_enable_execute_command(&self) -> &::std::option::Option<bool> {
709        self.inner.get_enable_execute_command()
710    }
711    /// <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>
712    /// <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>
713    pub fn service_connect_configuration(mut self, input: crate::types::ServiceConnectConfiguration) -> Self {
714        self.inner = self.inner.service_connect_configuration(input);
715        self
716    }
717    /// <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>
718    /// <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>
719    pub fn set_service_connect_configuration(mut self, input: ::std::option::Option<crate::types::ServiceConnectConfiguration>) -> Self {
720        self.inner = self.inner.set_service_connect_configuration(input);
721        self
722    }
723    /// <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>
724    /// <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>
725    pub fn get_service_connect_configuration(&self) -> &::std::option::Option<crate::types::ServiceConnectConfiguration> {
726        self.inner.get_service_connect_configuration()
727    }
728    ///
729    /// Appends an item to `volumeConfigurations`.
730    ///
731    /// To override the contents of this collection use [`set_volume_configurations`](Self::set_volume_configurations).
732    ///
733    /// <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>
734    pub fn volume_configurations(mut self, input: crate::types::ServiceVolumeConfiguration) -> Self {
735        self.inner = self.inner.volume_configurations(input);
736        self
737    }
738    /// <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>
739    pub fn set_volume_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ServiceVolumeConfiguration>>) -> Self {
740        self.inner = self.inner.set_volume_configurations(input);
741        self
742    }
743    /// <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>
744    pub fn get_volume_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ServiceVolumeConfiguration>> {
745        self.inner.get_volume_configurations()
746    }
747    ///
748    /// Appends an item to `vpcLatticeConfigurations`.
749    ///
750    /// To override the contents of this collection use [`set_vpc_lattice_configurations`](Self::set_vpc_lattice_configurations).
751    ///
752    /// <p>The VPC Lattice configuration for the service being created.</p>
753    pub fn vpc_lattice_configurations(mut self, input: crate::types::VpcLatticeConfiguration) -> Self {
754        self.inner = self.inner.vpc_lattice_configurations(input);
755        self
756    }
757    /// <p>The VPC Lattice configuration for the service being created.</p>
758    pub fn set_vpc_lattice_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VpcLatticeConfiguration>>) -> Self {
759        self.inner = self.inner.set_vpc_lattice_configurations(input);
760        self
761    }
762    /// <p>The VPC Lattice configuration for the service being created.</p>
763    pub fn get_vpc_lattice_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VpcLatticeConfiguration>> {
764        self.inner.get_vpc_lattice_configurations()
765    }
766}