aws_sdk_ecs/operation/run_task/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::run_task::_run_task_output::RunTaskOutputBuilder;
3
4pub use crate::operation::run_task::_run_task_input::RunTaskInputBuilder;
5
6impl crate::operation::run_task::builders::RunTaskInputBuilder {
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::run_task::RunTaskOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::run_task::RunTaskError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.run_task();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `RunTask`.
24///
25/// <p>Starts a new task using the specified task definition.</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>You can allow Amazon ECS to place tasks for you, or you can customize how Amazon ECS places tasks using placement constraints and placement strategies. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html">Scheduling Tasks</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
31/// <p>Alternatively, you can use <code>StartTask</code> to use your own scheduler or place tasks manually on specific container instances.</p>
32/// <p>You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a 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>
33/// <p>The Amazon ECS API follows an eventual consistency model. This is because of the distributed nature of the system supporting the API. This means that the result of an API command you run that affects your Amazon ECS resources might not be immediately visible to all subsequent commands you run. Keep this in mind when you carry out an API command that immediately follows a previous API command.</p>
34/// <p>To manage eventual consistency, you can do the following:</p>
35/// <ul>
36/// <li>
37/// <p>Confirm the state of the resource before you run a command to modify it. Run the DescribeTasks command using an exponential backoff algorithm to ensure that you allow enough time for the previous command to propagate through the system. To do this, run the DescribeTasks command repeatedly, starting with a couple of seconds of wait time and increasing gradually up to five minutes of wait time.</p></li>
38/// <li>
39/// <p>Add wait time between subsequent commands, even if the DescribeTasks command returns an accurate response. Apply an exponential backoff algorithm starting with a couple of seconds of wait time, and increase gradually up to about five minutes of wait time.</p></li>
40/// </ul>
41/// <p>If you get a <code>ConflictException</code> error, the <code>RunTask</code> request could not be processed due to conflicts. The provided <code>clientToken</code> is already in use with a different <code>RunTask</code> request. The <code>resourceIds</code> are the existing task ARNs which are already associated with the <code>clientToken</code>.</p>
42/// <p>To fix this issue:</p>
43/// <ul>
44/// <li>
45/// <p>Run <code>RunTask</code> with a unique <code>clientToken</code>.</p></li>
46/// <li>
47/// <p>Run <code>RunTask</code> with the <code>clientToken</code> and the original set of parameters</p></li>
48/// </ul>
49/// <p>If you get a <code>ClientException</code>error, the <code>RunTask</code> could not be processed because you use managed scaling and there is a capacity error because the quota of tasks in the <code>PROVISIONING</code> per cluster has been reached. For information about the service quotas, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html">Amazon ECS service quotas</a>.</p>
50#[derive(::std::clone::Clone, ::std::fmt::Debug)]
51pub struct RunTaskFluentBuilder {
52 handle: ::std::sync::Arc<crate::client::Handle>,
53 inner: crate::operation::run_task::builders::RunTaskInputBuilder,
54 config_override: ::std::option::Option<crate::config::Builder>,
55}
56impl crate::client::customize::internal::CustomizableSend<crate::operation::run_task::RunTaskOutput, crate::operation::run_task::RunTaskError>
57 for RunTaskFluentBuilder
58{
59 fn send(
60 self,
61 config_override: crate::config::Builder,
62 ) -> crate::client::customize::internal::BoxFuture<
63 crate::client::customize::internal::SendResult<crate::operation::run_task::RunTaskOutput, crate::operation::run_task::RunTaskError>,
64 > {
65 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
66 }
67}
68impl RunTaskFluentBuilder {
69 /// Creates a new `RunTaskFluentBuilder`.
70 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
71 Self {
72 handle,
73 inner: ::std::default::Default::default(),
74 config_override: ::std::option::Option::None,
75 }
76 }
77 /// Access the RunTask as a reference.
78 pub fn as_input(&self) -> &crate::operation::run_task::builders::RunTaskInputBuilder {
79 &self.inner
80 }
81 /// Sends the request and returns the response.
82 ///
83 /// If an error occurs, an `SdkError` will be returned with additional details that
84 /// can be matched against.
85 ///
86 /// By default, any retryable failures will be retried twice. Retry behavior
87 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
88 /// set when configuring the client.
89 pub async fn send(
90 self,
91 ) -> ::std::result::Result<
92 crate::operation::run_task::RunTaskOutput,
93 ::aws_smithy_runtime_api::client::result::SdkError<
94 crate::operation::run_task::RunTaskError,
95 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
96 >,
97 > {
98 let input = self
99 .inner
100 .build()
101 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
102 let runtime_plugins = crate::operation::run_task::RunTask::operation_runtime_plugins(
103 self.handle.runtime_plugins.clone(),
104 &self.handle.conf,
105 self.config_override,
106 );
107 crate::operation::run_task::RunTask::orchestrate(&runtime_plugins, input).await
108 }
109
110 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
111 pub fn customize(
112 self,
113 ) -> crate::client::customize::CustomizableOperation<crate::operation::run_task::RunTaskOutput, crate::operation::run_task::RunTaskError, Self>
114 {
115 crate::client::customize::CustomizableOperation::new(self)
116 }
117 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118 self.set_config_override(::std::option::Option::Some(config_override.into()));
119 self
120 }
121
122 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123 self.config_override = config_override;
124 self
125 }
126 ///
127 /// Appends an item to `capacityProviderStrategy`.
128 ///
129 /// To override the contents of this collection use [`set_capacity_provider_strategy`](Self::set_capacity_provider_strategy).
130 ///
131 /// <p>The capacity provider strategy to use for the task.</p><note>
132 /// <p>If you want to use Amazon ECS Managed Instances, you must use the <code>capacityProviderStrategy</code> request parameter and omit the <code>launchType</code> request parameter.</p>
133 /// </note>
134 /// <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>
135 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
136 /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
137 pub fn capacity_provider_strategy(mut self, input: crate::types::CapacityProviderStrategyItem) -> Self {
138 self.inner = self.inner.capacity_provider_strategy(input);
139 self
140 }
141 /// <p>The capacity provider strategy to use for the task.</p><note>
142 /// <p>If you want to use Amazon ECS Managed Instances, you must use the <code>capacityProviderStrategy</code> request parameter and omit the <code>launchType</code> request parameter.</p>
143 /// </note>
144 /// <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>
145 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
146 /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
147 pub fn set_capacity_provider_strategy(
148 mut self,
149 input: ::std::option::Option<::std::vec::Vec<crate::types::CapacityProviderStrategyItem>>,
150 ) -> Self {
151 self.inner = self.inner.set_capacity_provider_strategy(input);
152 self
153 }
154 /// <p>The capacity provider strategy to use for the task.</p><note>
155 /// <p>If you want to use Amazon ECS Managed Instances, you must use the <code>capacityProviderStrategy</code> request parameter and omit the <code>launchType</code> request parameter.</p>
156 /// </note>
157 /// <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>
158 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
159 /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
160 pub fn get_capacity_provider_strategy(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CapacityProviderStrategyItem>> {
161 self.inner.get_capacity_provider_strategy()
162 }
163 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster to run your task on. If you do not specify a cluster, the default cluster is assumed.</p>
164 /// <p>Each account receives a default cluster the first time you use the service, but you may also create other clusters.</p>
165 pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166 self.inner = self.inner.cluster(input.into());
167 self
168 }
169 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster to run your task on. If you do not specify a cluster, the default cluster is assumed.</p>
170 /// <p>Each account receives a default cluster the first time you use the service, but you may also create other clusters.</p>
171 pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172 self.inner = self.inner.set_cluster(input);
173 self
174 }
175 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster to run your task on. If you do not specify a cluster, the default cluster is assumed.</p>
176 /// <p>Each account receives a default cluster the first time you use the service, but you may also create other clusters.</p>
177 pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
178 self.inner.get_cluster()
179 }
180 /// <p>The number of instantiations of the specified task to place on your cluster. You can specify up to 10 tasks for each call.</p>
181 pub fn count(mut self, input: i32) -> Self {
182 self.inner = self.inner.count(input);
183 self
184 }
185 /// <p>The number of instantiations of the specified task to place on your cluster. You can specify up to 10 tasks for each call.</p>
186 pub fn set_count(mut self, input: ::std::option::Option<i32>) -> Self {
187 self.inner = self.inner.set_count(input);
188 self
189 }
190 /// <p>The number of instantiations of the specified task to place on your cluster. You can specify up to 10 tasks for each call.</p>
191 pub fn get_count(&self) -> &::std::option::Option<i32> {
192 self.inner.get_count()
193 }
194 /// <p>Specifies whether to use Amazon ECS managed tags for the task. 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>
195 pub fn enable_ecs_managed_tags(mut self, input: bool) -> Self {
196 self.inner = self.inner.enable_ecs_managed_tags(input);
197 self
198 }
199 /// <p>Specifies whether to use Amazon ECS managed tags for the task. 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>
200 pub fn set_enable_ecs_managed_tags(mut self, input: ::std::option::Option<bool>) -> Self {
201 self.inner = self.inner.set_enable_ecs_managed_tags(input);
202 self
203 }
204 /// <p>Specifies whether to use Amazon ECS managed tags for the task. 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>
205 pub fn get_enable_ecs_managed_tags(&self) -> &::std::option::Option<bool> {
206 self.inner.get_enable_ecs_managed_tags()
207 }
208 /// <p>Determines whether to use the execute command functionality for the containers in this task. If <code>true</code>, this enables execute command functionality on all containers in the task.</p>
209 /// <p>If <code>true</code>, then the task definition must have a task role, or you must provide one as an override.</p>
210 pub fn enable_execute_command(mut self, input: bool) -> Self {
211 self.inner = self.inner.enable_execute_command(input);
212 self
213 }
214 /// <p>Determines whether to use the execute command functionality for the containers in this task. If <code>true</code>, this enables execute command functionality on all containers in the task.</p>
215 /// <p>If <code>true</code>, then the task definition must have a task role, or you must provide one as an override.</p>
216 pub fn set_enable_execute_command(mut self, input: ::std::option::Option<bool>) -> Self {
217 self.inner = self.inner.set_enable_execute_command(input);
218 self
219 }
220 /// <p>Determines whether to use the execute command functionality for the containers in this task. If <code>true</code>, this enables execute command functionality on all containers in the task.</p>
221 /// <p>If <code>true</code>, then the task definition must have a task role, or you must provide one as an override.</p>
222 pub fn get_enable_execute_command(&self) -> &::std::option::Option<bool> {
223 self.inner.get_enable_execute_command()
224 }
225 /// <p>The name of the task group to associate with the task. The default value is the family name of the task definition (for example, <code>family:my-family-name</code>).</p>
226 pub fn group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227 self.inner = self.inner.group(input.into());
228 self
229 }
230 /// <p>The name of the task group to associate with the task. The default value is the family name of the task definition (for example, <code>family:my-family-name</code>).</p>
231 pub fn set_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232 self.inner = self.inner.set_group(input);
233 self
234 }
235 /// <p>The name of the task group to associate with the task. The default value is the family name of the task definition (for example, <code>family:my-family-name</code>).</p>
236 pub fn get_group(&self) -> &::std::option::Option<::std::string::String> {
237 self.inner.get_group()
238 }
239 /// <p>The infrastructure to run your standalone task 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><note>
240 /// <p>If you want to use Amazon ECS Managed Instances, you must use the <code>capacityProviderStrategy</code> request parameter and omit the <code>launchType</code> request parameter.</p>
241 /// </note>
242 /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
243 /// <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>
244 /// </note>
245 /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
246 /// <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>
247 /// <p>A task 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>
248 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
249 pub fn launch_type(mut self, input: crate::types::LaunchType) -> Self {
250 self.inner = self.inner.launch_type(input);
251 self
252 }
253 /// <p>The infrastructure to run your standalone task 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><note>
254 /// <p>If you want to use Amazon ECS Managed Instances, you must use the <code>capacityProviderStrategy</code> request parameter and omit the <code>launchType</code> request parameter.</p>
255 /// </note>
256 /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
257 /// <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>
258 /// </note>
259 /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
260 /// <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>
261 /// <p>A task 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>
262 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
263 pub fn set_launch_type(mut self, input: ::std::option::Option<crate::types::LaunchType>) -> Self {
264 self.inner = self.inner.set_launch_type(input);
265 self
266 }
267 /// <p>The infrastructure to run your standalone task 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><note>
268 /// <p>If you want to use Amazon ECS Managed Instances, you must use the <code>capacityProviderStrategy</code> request parameter and omit the <code>launchType</code> request parameter.</p>
269 /// </note>
270 /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
271 /// <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>
272 /// </note>
273 /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
274 /// <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>
275 /// <p>A task 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>
276 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
277 pub fn get_launch_type(&self) -> &::std::option::Option<crate::types::LaunchType> {
278 self.inner.get_launch_type()
279 }
280 /// <p>The network configuration for the task. 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>
281 pub fn network_configuration(mut self, input: crate::types::NetworkConfiguration) -> Self {
282 self.inner = self.inner.network_configuration(input);
283 self
284 }
285 /// <p>The network configuration for the task. 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>
286 pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::NetworkConfiguration>) -> Self {
287 self.inner = self.inner.set_network_configuration(input);
288 self
289 }
290 /// <p>The network configuration for the task. 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>
291 pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::NetworkConfiguration> {
292 self.inner.get_network_configuration()
293 }
294 /// <p>A list of container overrides in JSON format that specify the name of a container in the specified task definition and the overrides it should receive. You can override the default command for a container (that's specified in the task definition or Docker image) with a <code>command</code> override. You can also override existing environment variables (that are specified in the task definition or Docker image) on a container or add new environment variables to it with an <code>environment</code> override.</p>
295 /// <p>A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.</p>
296 pub fn overrides(mut self, input: crate::types::TaskOverride) -> Self {
297 self.inner = self.inner.overrides(input);
298 self
299 }
300 /// <p>A list of container overrides in JSON format that specify the name of a container in the specified task definition and the overrides it should receive. You can override the default command for a container (that's specified in the task definition or Docker image) with a <code>command</code> override. You can also override existing environment variables (that are specified in the task definition or Docker image) on a container or add new environment variables to it with an <code>environment</code> override.</p>
301 /// <p>A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.</p>
302 pub fn set_overrides(mut self, input: ::std::option::Option<crate::types::TaskOverride>) -> Self {
303 self.inner = self.inner.set_overrides(input);
304 self
305 }
306 /// <p>A list of container overrides in JSON format that specify the name of a container in the specified task definition and the overrides it should receive. You can override the default command for a container (that's specified in the task definition or Docker image) with a <code>command</code> override. You can also override existing environment variables (that are specified in the task definition or Docker image) on a container or add new environment variables to it with an <code>environment</code> override.</p>
307 /// <p>A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.</p>
308 pub fn get_overrides(&self) -> &::std::option::Option<crate::types::TaskOverride> {
309 self.inner.get_overrides()
310 }
311 ///
312 /// Appends an item to `placementConstraints`.
313 ///
314 /// To override the contents of this collection use [`set_placement_constraints`](Self::set_placement_constraints).
315 ///
316 /// <p>An array of placement constraint objects to use for the task. You can specify up to 10 constraints for each task (including constraints in the task definition and those specified at runtime).</p>
317 pub fn placement_constraints(mut self, input: crate::types::PlacementConstraint) -> Self {
318 self.inner = self.inner.placement_constraints(input);
319 self
320 }
321 /// <p>An array of placement constraint objects to use for the task. You can specify up to 10 constraints for each task (including constraints in the task definition and those specified at runtime).</p>
322 pub fn set_placement_constraints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlacementConstraint>>) -> Self {
323 self.inner = self.inner.set_placement_constraints(input);
324 self
325 }
326 /// <p>An array of placement constraint objects to use for the task. You can specify up to 10 constraints for each task (including constraints in the task definition and those specified at runtime).</p>
327 pub fn get_placement_constraints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlacementConstraint>> {
328 self.inner.get_placement_constraints()
329 }
330 ///
331 /// Appends an item to `placementStrategy`.
332 ///
333 /// To override the contents of this collection use [`set_placement_strategy`](Self::set_placement_strategy).
334 ///
335 /// <p>The placement strategy objects to use for the task. You can specify a maximum of 5 strategy rules for each task.</p>
336 pub fn placement_strategy(mut self, input: crate::types::PlacementStrategy) -> Self {
337 self.inner = self.inner.placement_strategy(input);
338 self
339 }
340 /// <p>The placement strategy objects to use for the task. You can specify a maximum of 5 strategy rules for each task.</p>
341 pub fn set_placement_strategy(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlacementStrategy>>) -> Self {
342 self.inner = self.inner.set_placement_strategy(input);
343 self
344 }
345 /// <p>The placement strategy objects to use for the task. You can specify a maximum of 5 strategy rules for each task.</p>
346 pub fn get_placement_strategy(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlacementStrategy>> {
347 self.inner.get_placement_strategy()
348 }
349 /// <p>The platform version the task uses. A platform version is only specified for tasks hosted on Fargate. 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>
350 pub fn platform_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
351 self.inner = self.inner.platform_version(input.into());
352 self
353 }
354 /// <p>The platform version the task uses. A platform version is only specified for tasks hosted on Fargate. 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>
355 pub fn set_platform_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
356 self.inner = self.inner.set_platform_version(input);
357 self
358 }
359 /// <p>The platform version the task uses. A platform version is only specified for tasks hosted on Fargate. 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>
360 pub fn get_platform_version(&self) -> &::std::option::Option<::std::string::String> {
361 self.inner.get_platform_version()
362 }
363 /// <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><note>
364 /// <p>An error will be received if you specify the <code>SERVICE</code> option when running a task.</p>
365 /// </note>
366 pub fn propagate_tags(mut self, input: crate::types::PropagateTags) -> Self {
367 self.inner = self.inner.propagate_tags(input);
368 self
369 }
370 /// <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><note>
371 /// <p>An error will be received if you specify the <code>SERVICE</code> option when running a task.</p>
372 /// </note>
373 pub fn set_propagate_tags(mut self, input: ::std::option::Option<crate::types::PropagateTags>) -> Self {
374 self.inner = self.inner.set_propagate_tags(input);
375 self
376 }
377 /// <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><note>
378 /// <p>An error will be received if you specify the <code>SERVICE</code> option when running a task.</p>
379 /// </note>
380 pub fn get_propagate_tags(&self) -> &::std::option::Option<crate::types::PropagateTags> {
381 self.inner.get_propagate_tags()
382 }
383 /// <p>This parameter is only used by Amazon ECS. It is not intended for use by customers.</p>
384 pub fn reference_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
385 self.inner = self.inner.reference_id(input.into());
386 self
387 }
388 /// <p>This parameter is only used by Amazon ECS. It is not intended for use by customers.</p>
389 pub fn set_reference_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
390 self.inner = self.inner.set_reference_id(input);
391 self
392 }
393 /// <p>This parameter is only used by Amazon ECS. It is not intended for use by customers.</p>
394 pub fn get_reference_id(&self) -> &::std::option::Option<::std::string::String> {
395 self.inner.get_reference_id()
396 }
397 /// <p>An optional tag specified when a task is started. For example, if you automatically trigger a task to run a batch process job, you could apply a unique identifier for that job to your task with the <code>startedBy</code> parameter. You can then identify which tasks belong to that job by filtering the results of a <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTasks.html">ListTasks</a> call with the <code>startedBy</code> value. Up to 128 letters (uppercase and lowercase), numbers, hyphens (-), forward slash (/), and underscores (_) are allowed.</p>
398 /// <p>If a task is started by an Amazon ECS service, then the <code>startedBy</code> parameter contains the deployment ID of the service that starts it.</p>
399 pub fn started_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
400 self.inner = self.inner.started_by(input.into());
401 self
402 }
403 /// <p>An optional tag specified when a task is started. For example, if you automatically trigger a task to run a batch process job, you could apply a unique identifier for that job to your task with the <code>startedBy</code> parameter. You can then identify which tasks belong to that job by filtering the results of a <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTasks.html">ListTasks</a> call with the <code>startedBy</code> value. Up to 128 letters (uppercase and lowercase), numbers, hyphens (-), forward slash (/), and underscores (_) are allowed.</p>
404 /// <p>If a task is started by an Amazon ECS service, then the <code>startedBy</code> parameter contains the deployment ID of the service that starts it.</p>
405 pub fn set_started_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
406 self.inner = self.inner.set_started_by(input);
407 self
408 }
409 /// <p>An optional tag specified when a task is started. For example, if you automatically trigger a task to run a batch process job, you could apply a unique identifier for that job to your task with the <code>startedBy</code> parameter. You can then identify which tasks belong to that job by filtering the results of a <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTasks.html">ListTasks</a> call with the <code>startedBy</code> value. Up to 128 letters (uppercase and lowercase), numbers, hyphens (-), forward slash (/), and underscores (_) are allowed.</p>
410 /// <p>If a task is started by an Amazon ECS service, then the <code>startedBy</code> parameter contains the deployment ID of the service that starts it.</p>
411 pub fn get_started_by(&self) -> &::std::option::Option<::std::string::String> {
412 self.inner.get_started_by()
413 }
414 ///
415 /// Appends an item to `tags`.
416 ///
417 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
418 ///
419 /// <p>The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
420 /// <p>The following basic restrictions apply to tags:</p>
421 /// <ul>
422 /// <li>
423 /// <p>Maximum number of tags per resource - 50</p></li>
424 /// <li>
425 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
426 /// <li>
427 /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
428 /// <li>
429 /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
430 /// <li>
431 /// <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>
432 /// <li>
433 /// <p>Tag keys and values are case-sensitive.</p></li>
434 /// <li>
435 /// <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>
436 /// </ul>
437 pub fn tags(mut self, input: crate::types::Tag) -> Self {
438 self.inner = self.inner.tags(input);
439 self
440 }
441 /// <p>The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
442 /// <p>The following basic restrictions apply to tags:</p>
443 /// <ul>
444 /// <li>
445 /// <p>Maximum number of tags per resource - 50</p></li>
446 /// <li>
447 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
448 /// <li>
449 /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
450 /// <li>
451 /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
452 /// <li>
453 /// <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>
454 /// <li>
455 /// <p>Tag keys and values are case-sensitive.</p></li>
456 /// <li>
457 /// <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>
458 /// </ul>
459 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
460 self.inner = self.inner.set_tags(input);
461 self
462 }
463 /// <p>The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
464 /// <p>The following basic restrictions apply to tags:</p>
465 /// <ul>
466 /// <li>
467 /// <p>Maximum number of tags per resource - 50</p></li>
468 /// <li>
469 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
470 /// <li>
471 /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
472 /// <li>
473 /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
474 /// <li>
475 /// <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>
476 /// <li>
477 /// <p>Tag keys and values are case-sensitive.</p></li>
478 /// <li>
479 /// <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>
480 /// </ul>
481 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
482 self.inner.get_tags()
483 }
484 /// <p>The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full ARN of the task definition to run. If a <code>revision</code> isn't specified, the latest <code>ACTIVE</code> revision is used.</p>
485 /// <p>The full ARN value must match the value that you specified as the <code>Resource</code> of the principal's permissions policy.</p>
486 /// <p>When you specify a task definition, you must either specify a specific revision, or all revisions in the ARN.</p>
487 /// <p>To specify a specific revision, include the revision number in the ARN. For example, to specify revision 2, use <code>arn:aws:ecs:us-east-1:111122223333:task-definition/TaskFamilyName:2</code>.</p>
488 /// <p>To specify all revisions, use the wildcard (*) in the ARN. For example, to specify all revisions, use <code>arn:aws:ecs:us-east-1:111122223333:task-definition/TaskFamilyName:*</code>.</p>
489 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-resources">Policy Resources for Amazon ECS</a> in the Amazon Elastic Container Service Developer Guide.</p>
490 pub fn task_definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
491 self.inner = self.inner.task_definition(input.into());
492 self
493 }
494 /// <p>The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full ARN of the task definition to run. If a <code>revision</code> isn't specified, the latest <code>ACTIVE</code> revision is used.</p>
495 /// <p>The full ARN value must match the value that you specified as the <code>Resource</code> of the principal's permissions policy.</p>
496 /// <p>When you specify a task definition, you must either specify a specific revision, or all revisions in the ARN.</p>
497 /// <p>To specify a specific revision, include the revision number in the ARN. For example, to specify revision 2, use <code>arn:aws:ecs:us-east-1:111122223333:task-definition/TaskFamilyName:2</code>.</p>
498 /// <p>To specify all revisions, use the wildcard (*) in the ARN. For example, to specify all revisions, use <code>arn:aws:ecs:us-east-1:111122223333:task-definition/TaskFamilyName:*</code>.</p>
499 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-resources">Policy Resources for Amazon ECS</a> in the Amazon Elastic Container Service Developer Guide.</p>
500 pub fn set_task_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
501 self.inner = self.inner.set_task_definition(input);
502 self
503 }
504 /// <p>The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full ARN of the task definition to run. If a <code>revision</code> isn't specified, the latest <code>ACTIVE</code> revision is used.</p>
505 /// <p>The full ARN value must match the value that you specified as the <code>Resource</code> of the principal's permissions policy.</p>
506 /// <p>When you specify a task definition, you must either specify a specific revision, or all revisions in the ARN.</p>
507 /// <p>To specify a specific revision, include the revision number in the ARN. For example, to specify revision 2, use <code>arn:aws:ecs:us-east-1:111122223333:task-definition/TaskFamilyName:2</code>.</p>
508 /// <p>To specify all revisions, use the wildcard (*) in the ARN. For example, to specify all revisions, use <code>arn:aws:ecs:us-east-1:111122223333:task-definition/TaskFamilyName:*</code>.</p>
509 /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-resources">Policy Resources for Amazon ECS</a> in the Amazon Elastic Container Service Developer Guide.</p>
510 pub fn get_task_definition(&self) -> &::std::option::Option<::std::string::String> {
511 self.inner.get_task_definition()
512 }
513 /// <p>An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 64 characters are allowed. The valid characters are characters in the range of 33-126, inclusive. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/ECS_Idempotency.html">Ensuring idempotency</a>.</p>
514 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
515 self.inner = self.inner.client_token(input.into());
516 self
517 }
518 /// <p>An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 64 characters are allowed. The valid characters are characters in the range of 33-126, inclusive. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/ECS_Idempotency.html">Ensuring idempotency</a>.</p>
519 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
520 self.inner = self.inner.set_client_token(input);
521 self
522 }
523 /// <p>An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 64 characters are allowed. The valid characters are characters in the range of 33-126, inclusive. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/ECS_Idempotency.html">Ensuring idempotency</a>.</p>
524 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
525 self.inner.get_client_token()
526 }
527 ///
528 /// Appends an item to `volumeConfigurations`.
529 ///
530 /// To override the contents of this collection use [`set_volume_configurations`](Self::set_volume_configurations).
531 ///
532 /// <p>The details of the volume that was <code>configuredAtLaunch</code>. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskManagedEBSVolumeConfiguration.html">TaskManagedEBSVolumeConfiguration</a>. The <code>name</code> of the volume must match the <code>name</code> from the task definition.</p>
533 pub fn volume_configurations(mut self, input: crate::types::TaskVolumeConfiguration) -> Self {
534 self.inner = self.inner.volume_configurations(input);
535 self
536 }
537 /// <p>The details of the volume that was <code>configuredAtLaunch</code>. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskManagedEBSVolumeConfiguration.html">TaskManagedEBSVolumeConfiguration</a>. The <code>name</code> of the volume must match the <code>name</code> from the task definition.</p>
538 pub fn set_volume_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TaskVolumeConfiguration>>) -> Self {
539 self.inner = self.inner.set_volume_configurations(input);
540 self
541 }
542 /// <p>The details of the volume that was <code>configuredAtLaunch</code>. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskManagedEBSVolumeConfiguration.html">TaskManagedEBSVolumeConfiguration</a>. The <code>name</code> of the volume must match the <code>name</code> from the task definition.</p>
543 pub fn get_volume_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TaskVolumeConfiguration>> {
544 self.inner.get_volume_configurations()
545 }
546}