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 infomation, 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#[derive(::std::clone::Clone, ::std::fmt::Debug)]
50pub struct RunTaskFluentBuilder {
51 handle: ::std::sync::Arc<crate::client::Handle>,
52 inner: crate::operation::run_task::builders::RunTaskInputBuilder,
53 config_override: ::std::option::Option<crate::config::Builder>,
54}
55impl crate::client::customize::internal::CustomizableSend<crate::operation::run_task::RunTaskOutput, crate::operation::run_task::RunTaskError>
56 for RunTaskFluentBuilder
57{
58 fn send(
59 self,
60 config_override: crate::config::Builder,
61 ) -> crate::client::customize::internal::BoxFuture<
62 crate::client::customize::internal::SendResult<crate::operation::run_task::RunTaskOutput, crate::operation::run_task::RunTaskError>,
63 > {
64 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65 }
66}
67impl RunTaskFluentBuilder {
68 /// Creates a new `RunTaskFluentBuilder`.
69 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70 Self {
71 handle,
72 inner: ::std::default::Default::default(),
73 config_override: ::std::option::Option::None,
74 }
75 }
76 /// Access the RunTask as a reference.
77 pub fn as_input(&self) -> &crate::operation::run_task::builders::RunTaskInputBuilder {
78 &self.inner
79 }
80 /// Sends the request and returns the response.
81 ///
82 /// If an error occurs, an `SdkError` will be returned with additional details that
83 /// can be matched against.
84 ///
85 /// By default, any retryable failures will be retried twice. Retry behavior
86 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87 /// set when configuring the client.
88 pub async fn send(
89 self,
90 ) -> ::std::result::Result<
91 crate::operation::run_task::RunTaskOutput,
92 ::aws_smithy_runtime_api::client::result::SdkError<
93 crate::operation::run_task::RunTaskError,
94 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95 >,
96 > {
97 let input = self
98 .inner
99 .build()
100 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101 let runtime_plugins = crate::operation::run_task::RunTask::operation_runtime_plugins(
102 self.handle.runtime_plugins.clone(),
103 &self.handle.conf,
104 self.config_override,
105 );
106 crate::operation::run_task::RunTask::orchestrate(&runtime_plugins, input).await
107 }
108
109 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110 pub fn customize(
111 self,
112 ) -> crate::client::customize::CustomizableOperation<crate::operation::run_task::RunTaskOutput, crate::operation::run_task::RunTaskError, Self>
113 {
114 crate::client::customize::CustomizableOperation::new(self)
115 }
116 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117 self.set_config_override(::std::option::Option::Some(config_override.into()));
118 self
119 }
120
121 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122 self.config_override = config_override;
123 self
124 }
125 ///
126 /// Appends an item to `capacityProviderStrategy`.
127 ///
128 /// To override the contents of this collection use [`set_capacity_provider_strategy`](Self::set_capacity_provider_strategy).
129 ///
130 /// <p>The capacity provider strategy to use for the task.</p>
131 /// <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>
132 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
133 /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
134 pub fn capacity_provider_strategy(mut self, input: crate::types::CapacityProviderStrategyItem) -> Self {
135 self.inner = self.inner.capacity_provider_strategy(input);
136 self
137 }
138 /// <p>The capacity provider strategy to use for the task.</p>
139 /// <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>
140 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
141 /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
142 pub fn set_capacity_provider_strategy(
143 mut self,
144 input: ::std::option::Option<::std::vec::Vec<crate::types::CapacityProviderStrategyItem>>,
145 ) -> Self {
146 self.inner = self.inner.set_capacity_provider_strategy(input);
147 self
148 }
149 /// <p>The capacity provider strategy to use for the task.</p>
150 /// <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>
151 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
152 /// <p>A capacity provider strategy can contain a maximum of 20 capacity providers.</p>
153 pub fn get_capacity_provider_strategy(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CapacityProviderStrategyItem>> {
154 self.inner.get_capacity_provider_strategy()
155 }
156 /// <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>
157 /// <p>Each account receives a default cluster the first time you use the service, but you may also create other clusters.</p>
158 pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.inner = self.inner.cluster(input.into());
160 self
161 }
162 /// <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>
163 /// <p>Each account receives a default cluster the first time you use the service, but you may also create other clusters.</p>
164 pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.inner = self.inner.set_cluster(input);
166 self
167 }
168 /// <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>
169 /// <p>Each account receives a default cluster the first time you use the service, but you may also create other clusters.</p>
170 pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_cluster()
172 }
173 /// <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>
174 pub fn count(mut self, input: i32) -> Self {
175 self.inner = self.inner.count(input);
176 self
177 }
178 /// <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>
179 pub fn set_count(mut self, input: ::std::option::Option<i32>) -> Self {
180 self.inner = self.inner.set_count(input);
181 self
182 }
183 /// <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>
184 pub fn get_count(&self) -> &::std::option::Option<i32> {
185 self.inner.get_count()
186 }
187 /// <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>
188 pub fn enable_ecs_managed_tags(mut self, input: bool) -> Self {
189 self.inner = self.inner.enable_ecs_managed_tags(input);
190 self
191 }
192 /// <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>
193 pub fn set_enable_ecs_managed_tags(mut self, input: ::std::option::Option<bool>) -> Self {
194 self.inner = self.inner.set_enable_ecs_managed_tags(input);
195 self
196 }
197 /// <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>
198 pub fn get_enable_ecs_managed_tags(&self) -> &::std::option::Option<bool> {
199 self.inner.get_enable_ecs_managed_tags()
200 }
201 /// <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>
202 /// <p>If <code>true</code>, then the task definition must have a task role, or you must provide one as an override.</p>
203 pub fn enable_execute_command(mut self, input: bool) -> Self {
204 self.inner = self.inner.enable_execute_command(input);
205 self
206 }
207 /// <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>
208 /// <p>If <code>true</code>, then the task definition must have a task role, or you must provide one as an override.</p>
209 pub fn set_enable_execute_command(mut self, input: ::std::option::Option<bool>) -> Self {
210 self.inner = self.inner.set_enable_execute_command(input);
211 self
212 }
213 /// <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>
214 /// <p>If <code>true</code>, then the task definition must have a task role, or you must provide one as an override.</p>
215 pub fn get_enable_execute_command(&self) -> &::std::option::Option<bool> {
216 self.inner.get_enable_execute_command()
217 }
218 /// <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>
219 pub fn group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220 self.inner = self.inner.group(input.into());
221 self
222 }
223 /// <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>
224 pub fn set_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225 self.inner = self.inner.set_group(input);
226 self
227 }
228 /// <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>
229 pub fn get_group(&self) -> &::std::option::Option<::std::string::String> {
230 self.inner.get_group()
231 }
232 /// <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>
233 /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
234 /// <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>
235 /// </note>
236 /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
237 /// <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>
238 /// <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>
239 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
240 pub fn launch_type(mut self, input: crate::types::LaunchType) -> Self {
241 self.inner = self.inner.launch_type(input);
242 self
243 }
244 /// <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>
245 /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
246 /// <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>
247 /// </note>
248 /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
249 /// <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>
250 /// <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>
251 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
252 pub fn set_launch_type(mut self, input: ::std::option::Option<crate::types::LaunchType>) -> Self {
253 self.inner = self.inner.set_launch_type(input);
254 self
255 }
256 /// <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>
257 /// <p>The <code>FARGATE</code> launch type runs your tasks on Fargate On-Demand infrastructure.</p><note>
258 /// <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>
259 /// </note>
260 /// <p>The <code>EC2</code> launch type runs your tasks on Amazon EC2 instances registered to your cluster.</p>
261 /// <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>
262 /// <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>
263 /// <p>When you use cluster auto scaling, you must specify <code>capacityProviderStrategy</code> and not <code>launchType</code>.</p>
264 pub fn get_launch_type(&self) -> &::std::option::Option<crate::types::LaunchType> {
265 self.inner.get_launch_type()
266 }
267 /// <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>
268 pub fn network_configuration(mut self, input: crate::types::NetworkConfiguration) -> Self {
269 self.inner = self.inner.network_configuration(input);
270 self
271 }
272 /// <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>
273 pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::NetworkConfiguration>) -> Self {
274 self.inner = self.inner.set_network_configuration(input);
275 self
276 }
277 /// <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>
278 pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::NetworkConfiguration> {
279 self.inner.get_network_configuration()
280 }
281 /// <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>
282 /// <p>A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.</p>
283 pub fn overrides(mut self, input: crate::types::TaskOverride) -> Self {
284 self.inner = self.inner.overrides(input);
285 self
286 }
287 /// <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>
288 /// <p>A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.</p>
289 pub fn set_overrides(mut self, input: ::std::option::Option<crate::types::TaskOverride>) -> Self {
290 self.inner = self.inner.set_overrides(input);
291 self
292 }
293 /// <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>
294 /// <p>A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.</p>
295 pub fn get_overrides(&self) -> &::std::option::Option<crate::types::TaskOverride> {
296 self.inner.get_overrides()
297 }
298 ///
299 /// Appends an item to `placementConstraints`.
300 ///
301 /// To override the contents of this collection use [`set_placement_constraints`](Self::set_placement_constraints).
302 ///
303 /// <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>
304 pub fn placement_constraints(mut self, input: crate::types::PlacementConstraint) -> Self {
305 self.inner = self.inner.placement_constraints(input);
306 self
307 }
308 /// <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>
309 pub fn set_placement_constraints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlacementConstraint>>) -> Self {
310 self.inner = self.inner.set_placement_constraints(input);
311 self
312 }
313 /// <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>
314 pub fn get_placement_constraints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlacementConstraint>> {
315 self.inner.get_placement_constraints()
316 }
317 ///
318 /// Appends an item to `placementStrategy`.
319 ///
320 /// To override the contents of this collection use [`set_placement_strategy`](Self::set_placement_strategy).
321 ///
322 /// <p>The placement strategy objects to use for the task. You can specify a maximum of 5 strategy rules for each task.</p>
323 pub fn placement_strategy(mut self, input: crate::types::PlacementStrategy) -> Self {
324 self.inner = self.inner.placement_strategy(input);
325 self
326 }
327 /// <p>The placement strategy objects to use for the task. You can specify a maximum of 5 strategy rules for each task.</p>
328 pub fn set_placement_strategy(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlacementStrategy>>) -> Self {
329 self.inner = self.inner.set_placement_strategy(input);
330 self
331 }
332 /// <p>The placement strategy objects to use for the task. You can specify a maximum of 5 strategy rules for each task.</p>
333 pub fn get_placement_strategy(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlacementStrategy>> {
334 self.inner.get_placement_strategy()
335 }
336 /// <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>
337 pub fn platform_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
338 self.inner = self.inner.platform_version(input.into());
339 self
340 }
341 /// <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>
342 pub fn set_platform_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
343 self.inner = self.inner.set_platform_version(input);
344 self
345 }
346 /// <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>
347 pub fn get_platform_version(&self) -> &::std::option::Option<::std::string::String> {
348 self.inner.get_platform_version()
349 }
350 /// <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>
351 /// <p>An error will be received if you specify the <code>SERVICE</code> option when running a task.</p>
352 /// </note>
353 pub fn propagate_tags(mut self, input: crate::types::PropagateTags) -> Self {
354 self.inner = self.inner.propagate_tags(input);
355 self
356 }
357 /// <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>
358 /// <p>An error will be received if you specify the <code>SERVICE</code> option when running a task.</p>
359 /// </note>
360 pub fn set_propagate_tags(mut self, input: ::std::option::Option<crate::types::PropagateTags>) -> Self {
361 self.inner = self.inner.set_propagate_tags(input);
362 self
363 }
364 /// <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>
365 /// <p>An error will be received if you specify the <code>SERVICE</code> option when running a task.</p>
366 /// </note>
367 pub fn get_propagate_tags(&self) -> &::std::option::Option<crate::types::PropagateTags> {
368 self.inner.get_propagate_tags()
369 }
370 /// <p>This parameter is only used by Amazon ECS. It is not intended for use by customers.</p>
371 pub fn reference_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
372 self.inner = self.inner.reference_id(input.into());
373 self
374 }
375 /// <p>This parameter is only used by Amazon ECS. It is not intended for use by customers.</p>
376 pub fn set_reference_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
377 self.inner = self.inner.set_reference_id(input);
378 self
379 }
380 /// <p>This parameter is only used by Amazon ECS. It is not intended for use by customers.</p>
381 pub fn get_reference_id(&self) -> &::std::option::Option<::std::string::String> {
382 self.inner.get_reference_id()
383 }
384 /// <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>
385 /// <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>
386 pub fn started_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
387 self.inner = self.inner.started_by(input.into());
388 self
389 }
390 /// <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>
391 /// <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>
392 pub fn set_started_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
393 self.inner = self.inner.set_started_by(input);
394 self
395 }
396 /// <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>
397 /// <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>
398 pub fn get_started_by(&self) -> &::std::option::Option<::std::string::String> {
399 self.inner.get_started_by()
400 }
401 ///
402 /// Appends an item to `tags`.
403 ///
404 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
405 ///
406 /// <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>
407 /// <p>The following basic restrictions apply to tags:</p>
408 /// <ul>
409 /// <li>
410 /// <p>Maximum number of tags per resource - 50</p></li>
411 /// <li>
412 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
413 /// <li>
414 /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
415 /// <li>
416 /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
417 /// <li>
418 /// <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>
419 /// <li>
420 /// <p>Tag keys and values are case-sensitive.</p></li>
421 /// <li>
422 /// <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>
423 /// </ul>
424 pub fn tags(mut self, input: crate::types::Tag) -> Self {
425 self.inner = self.inner.tags(input);
426 self
427 }
428 /// <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>
429 /// <p>The following basic restrictions apply to tags:</p>
430 /// <ul>
431 /// <li>
432 /// <p>Maximum number of tags per resource - 50</p></li>
433 /// <li>
434 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
435 /// <li>
436 /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
437 /// <li>
438 /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
439 /// <li>
440 /// <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>
441 /// <li>
442 /// <p>Tag keys and values are case-sensitive.</p></li>
443 /// <li>
444 /// <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>
445 /// </ul>
446 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
447 self.inner = self.inner.set_tags(input);
448 self
449 }
450 /// <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>
451 /// <p>The following basic restrictions apply to tags:</p>
452 /// <ul>
453 /// <li>
454 /// <p>Maximum number of tags per resource - 50</p></li>
455 /// <li>
456 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
457 /// <li>
458 /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
459 /// <li>
460 /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
461 /// <li>
462 /// <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>
463 /// <li>
464 /// <p>Tag keys and values are case-sensitive.</p></li>
465 /// <li>
466 /// <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>
467 /// </ul>
468 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
469 self.inner.get_tags()
470 }
471 /// <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>
472 /// <p>The full ARN value must match the value that you specified as the <code>Resource</code> of the principal's permissions policy.</p>
473 /// <p>When you specify a task definition, you must either specify a specific revision, or all revisions in the ARN.</p>
474 /// <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>
475 /// <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>
476 /// <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>
477 pub fn task_definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
478 self.inner = self.inner.task_definition(input.into());
479 self
480 }
481 /// <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>
482 /// <p>The full ARN value must match the value that you specified as the <code>Resource</code> of the principal's permissions policy.</p>
483 /// <p>When you specify a task definition, you must either specify a specific revision, or all revisions in the ARN.</p>
484 /// <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>
485 /// <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>
486 /// <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>
487 pub fn set_task_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
488 self.inner = self.inner.set_task_definition(input);
489 self
490 }
491 /// <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>
492 /// <p>The full ARN value must match the value that you specified as the <code>Resource</code> of the principal's permissions policy.</p>
493 /// <p>When you specify a task definition, you must either specify a specific revision, or all revisions in the ARN.</p>
494 /// <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>
495 /// <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>
496 /// <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>
497 pub fn get_task_definition(&self) -> &::std::option::Option<::std::string::String> {
498 self.inner.get_task_definition()
499 }
500 /// <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>
501 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
502 self.inner = self.inner.client_token(input.into());
503 self
504 }
505 /// <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>
506 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
507 self.inner = self.inner.set_client_token(input);
508 self
509 }
510 /// <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>
511 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
512 self.inner.get_client_token()
513 }
514 ///
515 /// Appends an item to `volumeConfigurations`.
516 ///
517 /// To override the contents of this collection use [`set_volume_configurations`](Self::set_volume_configurations).
518 ///
519 /// <p>The details of the volume that was <code>configuredAtLaunch</code>. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in 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>
520 pub fn volume_configurations(mut self, input: crate::types::TaskVolumeConfiguration) -> Self {
521 self.inner = self.inner.volume_configurations(input);
522 self
523 }
524 /// <p>The details of the volume that was <code>configuredAtLaunch</code>. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in 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>
525 pub fn set_volume_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TaskVolumeConfiguration>>) -> Self {
526 self.inner = self.inner.set_volume_configurations(input);
527 self
528 }
529 /// <p>The details of the volume that was <code>configuredAtLaunch</code>. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in 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>
530 pub fn get_volume_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TaskVolumeConfiguration>> {
531 self.inner.get_volume_configurations()
532 }
533}