1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_task_set::_create_task_set_output::CreateTaskSetOutputBuilder;
pub use crate::operation::create_task_set::_create_task_set_input::CreateTaskSetInputBuilder;
/// Fluent builder constructing a request to `CreateTaskSet`.
///
/// <p>Create a task set in the specified cluster and service. This is used when a service uses the <code>EXTERNAL</code> deployment controller type. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html">Amazon ECS deployment types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CreateTaskSetFluentBuilder {
handle: std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_task_set::builders::CreateTaskSetInputBuilder,
}
impl CreateTaskSetFluentBuilder {
/// Creates a new `CreateTaskSet`.
pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::client::customize::CustomizableOperation<
crate::operation::create_task_set::CreateTaskSet,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::operation::create_task_set::CreateTaskSetError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::client::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::operation::create_task_set::CreateTaskSetOutput,
aws_smithy_http::result::SdkError<crate::operation::create_task_set::CreateTaskSetError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The short name or full Amazon Resource Name (ARN) of the service to create the task set in.</p>
pub fn service(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.service(input.into());
self
}
/// <p>The short name or full Amazon Resource Name (ARN) of the service to create the task set in.</p>
pub fn set_service(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_service(input);
self
}
/// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.</p>
pub fn cluster(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.cluster(input.into());
self
}
/// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.</p>
pub fn set_cluster(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_cluster(input);
self
}
/// <p>An optional non-unique tag that identifies this task set in external systems. If the task set is associated with a service discovery registry, the tasks in this task set will have the <code>ECS_TASK_SET_EXTERNAL_ID</code> Cloud Map attribute set to the provided value.</p>
pub fn external_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.external_id(input.into());
self
}
/// <p>An optional non-unique tag that identifies this task set in external systems. If the task set is associated with a service discovery registry, the tasks in this task set will have the <code>ECS_TASK_SET_EXTERNAL_ID</code> Cloud Map attribute set to the provided value.</p>
pub fn set_external_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_external_id(input);
self
}
/// <p>The task definition for the tasks in the task set to use.</p>
pub fn task_definition(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.task_definition(input.into());
self
}
/// <p>The task definition for the tasks in the task set to use.</p>
pub fn set_task_definition(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_task_definition(input);
self
}
/// <p>An object representing the network configuration for a task set.</p>
pub fn network_configuration(mut self, input: crate::types::NetworkConfiguration) -> Self {
self.inner = self.inner.network_configuration(input);
self
}
/// <p>An object representing the network configuration for a task set.</p>
pub fn set_network_configuration(
mut self,
input: std::option::Option<crate::types::NetworkConfiguration>,
) -> Self {
self.inner = self.inner.set_network_configuration(input);
self
}
/// Appends an item to `loadBalancers`.
///
/// To override the contents of this collection use [`set_load_balancers`](Self::set_load_balancers).
///
/// <p>A load balancer object representing the load balancer to use with the task set. The supported load balancer types are either an Application Load Balancer or a Network Load Balancer.</p>
pub fn load_balancers(mut self, input: crate::types::LoadBalancer) -> Self {
self.inner = self.inner.load_balancers(input);
self
}
/// <p>A load balancer object representing the load balancer to use with the task set. The supported load balancer types are either an Application Load Balancer or a Network Load Balancer.</p>
pub fn set_load_balancers(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::LoadBalancer>>,
) -> Self {
self.inner = self.inner.set_load_balancers(input);
self
}
/// Appends an item to `serviceRegistries`.
///
/// To override the contents of this collection use [`set_service_registries`](Self::set_service_registries).
///
/// <p>The details of the service discovery registries to assign to this task set. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html">Service discovery</a>.</p>
pub fn service_registries(mut self, input: crate::types::ServiceRegistry) -> Self {
self.inner = self.inner.service_registries(input);
self
}
/// <p>The details of the service discovery registries to assign to this task set. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html">Service discovery</a>.</p>
pub fn set_service_registries(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::ServiceRegistry>>,
) -> Self {
self.inner = self.inner.set_service_registries(input);
self
}
/// <p>The launch type that new tasks in the task set uses. 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>
/// <p>If a <code>launchType</code> is specified, the <code>capacityProviderStrategy</code> parameter must be omitted.</p>
pub fn launch_type(mut self, input: crate::types::LaunchType) -> Self {
self.inner = self.inner.launch_type(input);
self
}
/// <p>The launch type that new tasks in the task set uses. 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>
/// <p>If a <code>launchType</code> is specified, the <code>capacityProviderStrategy</code> parameter must be omitted.</p>
pub fn set_launch_type(mut self, input: std::option::Option<crate::types::LaunchType>) -> Self {
self.inner = self.inner.set_launch_type(input);
self
}
/// Appends an item to `capacityProviderStrategy`.
///
/// To override the contents of this collection use [`set_capacity_provider_strategy`](Self::set_capacity_provider_strategy).
///
/// <p>The capacity provider strategy to use for the task set.</p>
/// <p>A capacity provider strategy consists of one or more capacity providers along with the <code>base</code> and <code>weight</code> to assign to them. A capacity provider must be associated with the cluster to be used in a capacity provider strategy. The <code>PutClusterCapacityProviders</code> API is used to associate a capacity provider with a cluster. Only capacity providers with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
/// <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>
/// <p>If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New capacity providers can be created with the <code>CreateCapacityProvider</code> API operation.</p>
/// <p>To use a Fargate capacity provider, specify either the <code>FARGATE</code> or <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used.</p>
/// <p>The <code>PutClusterCapacityProviders</code> API operation is used to update the list of available capacity providers for a cluster after the cluster is created.</p>
pub fn capacity_provider_strategy(
mut self,
input: crate::types::CapacityProviderStrategyItem,
) -> Self {
self.inner = self.inner.capacity_provider_strategy(input);
self
}
/// <p>The capacity provider strategy to use for the task set.</p>
/// <p>A capacity provider strategy consists of one or more capacity providers along with the <code>base</code> and <code>weight</code> to assign to them. A capacity provider must be associated with the cluster to be used in a capacity provider strategy. The <code>PutClusterCapacityProviders</code> API is used to associate a capacity provider with a cluster. Only capacity providers with an <code>ACTIVE</code> or <code>UPDATING</code> status can be used.</p>
/// <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>
/// <p>If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New capacity providers can be created with the <code>CreateCapacityProvider</code> API operation.</p>
/// <p>To use a Fargate capacity provider, specify either the <code>FARGATE</code> or <code>FARGATE_SPOT</code> capacity providers. The Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used.</p>
/// <p>The <code>PutClusterCapacityProviders</code> API operation is used to update the list of available capacity providers for a cluster after the cluster is created.</p>
pub fn set_capacity_provider_strategy(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::CapacityProviderStrategyItem>>,
) -> Self {
self.inner = self.inner.set_capacity_provider_strategy(input);
self
}
/// <p>The platform version that the tasks in the task set uses. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the <code>LATEST</code> platform version is used.</p>
pub fn platform_version(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.platform_version(input.into());
self
}
/// <p>The platform version that the tasks in the task set uses. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the <code>LATEST</code> platform version is used.</p>
pub fn set_platform_version(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_platform_version(input);
self
}
/// <p>A floating-point percentage of the desired number of tasks to place and keep running in the task set.</p>
pub fn scale(mut self, input: crate::types::Scale) -> Self {
self.inner = self.inner.scale(input);
self
}
/// <p>A floating-point percentage of the desired number of tasks to place and keep running in the task set.</p>
pub fn set_scale(mut self, input: std::option::Option<crate::types::Scale>) -> Self {
self.inner = self.inner.set_scale(input);
self
}
/// <p>The identifier that you provide to ensure the idempotency of the request. It's case sensitive and must be unique. It can be up to 32 ASCII characters are allowed.</p>
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.client_token(input.into());
self
}
/// <p>The identifier that you provide to ensure the idempotency of the request. It's case sensitive and must be unique. It can be up to 32 ASCII characters are allowed.</p>
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_client_token(input);
self
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The metadata that you apply to the task set to help you categorize and organize them. Each tag consists of a key and an optional value. You define both. When a service is deleted, the tags are deleted.</p>
/// <p>The following basic restrictions apply to tags:</p>
/// <ul>
/// <li> <p>Maximum number of tags per resource - 50</p> </li>
/// <li> <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p> </li>
/// <li> <p>Maximum key length - 128 Unicode characters in UTF-8</p> </li>
/// <li> <p>Maximum value length - 256 Unicode characters in UTF-8</p> </li>
/// <li> <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>
/// <li> <p>Tag keys and values are case-sensitive.</p> </li>
/// <li> <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>
/// </ul>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>The metadata that you apply to the task set to help you categorize and organize them. Each tag consists of a key and an optional value. You define both. When a service is deleted, the tags are deleted.</p>
/// <p>The following basic restrictions apply to tags:</p>
/// <ul>
/// <li> <p>Maximum number of tags per resource - 50</p> </li>
/// <li> <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p> </li>
/// <li> <p>Maximum key length - 128 Unicode characters in UTF-8</p> </li>
/// <li> <p>Maximum value length - 256 Unicode characters in UTF-8</p> </li>
/// <li> <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>
/// <li> <p>Tag keys and values are case-sensitive.</p> </li>
/// <li> <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>
/// </ul>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::Tag>>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}