aws_sdk_ecs/operation/create_express_gateway_service/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_express_gateway_service::_create_express_gateway_service_output::CreateExpressGatewayServiceOutputBuilder;
3
4pub use crate::operation::create_express_gateway_service::_create_express_gateway_service_input::CreateExpressGatewayServiceInputBuilder;
5
6impl crate::operation::create_express_gateway_service::builders::CreateExpressGatewayServiceInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_express_gateway_service::CreateExpressGatewayServiceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_express_gateway_service::CreateExpressGatewayServiceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_express_gateway_service();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateExpressGatewayService`.
24///
25/// <p>Creates an Express service that simplifies deploying containerized web applications on Amazon ECS with managed Amazon Web Services infrastructure. This operation provisions and configures Application Load Balancers, target groups, security groups, and auto-scaling policies automatically.</p>
26/// <p>Specify a primary container configuration with your application image and basic settings. Amazon ECS creates the necessary Amazon Web Services resources for traffic distribution, health monitoring, network access control, and capacity management.</p>
27/// <p>Provide an execution role for task operations and an infrastructure role for managing Amazon Web Services resources on your behalf.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateExpressGatewayServiceFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_express_gateway_service::builders::CreateExpressGatewayServiceInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_express_gateway_service::CreateExpressGatewayServiceOutput,
37        crate::operation::create_express_gateway_service::CreateExpressGatewayServiceError,
38    > for CreateExpressGatewayServiceFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::create_express_gateway_service::CreateExpressGatewayServiceOutput,
46            crate::operation::create_express_gateway_service::CreateExpressGatewayServiceError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateExpressGatewayServiceFluentBuilder {
53    /// Creates a new `CreateExpressGatewayServiceFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the CreateExpressGatewayService as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_express_gateway_service::builders::CreateExpressGatewayServiceInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::create_express_gateway_service::CreateExpressGatewayServiceOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_express_gateway_service::CreateExpressGatewayServiceError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::create_express_gateway_service::CreateExpressGatewayService::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_express_gateway_service::CreateExpressGatewayService::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::create_express_gateway_service::CreateExpressGatewayServiceOutput,
99        crate::operation::create_express_gateway_service::CreateExpressGatewayServiceError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make Amazon Web Services API calls on your behalf. This role is required for Amazon ECS to pull container images from Amazon ECR, send container logs to Amazon CloudWatch Logs, and retrieve sensitive data from Amazon Web Services Systems Manager Parameter Store or Amazon Web Services Secrets Manager.</p>
114    /// <p>The execution role must include the <code>AmazonECSTaskExecutionRolePolicy</code> managed policy or equivalent permissions. For Express services, this role is used during task startup and runtime for container management operations.</p>
115    pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.execution_role_arn(input.into());
117        self
118    }
119    /// <p>The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make Amazon Web Services API calls on your behalf. This role is required for Amazon ECS to pull container images from Amazon ECR, send container logs to Amazon CloudWatch Logs, and retrieve sensitive data from Amazon Web Services Systems Manager Parameter Store or Amazon Web Services Secrets Manager.</p>
120    /// <p>The execution role must include the <code>AmazonECSTaskExecutionRolePolicy</code> managed policy or equivalent permissions. For Express services, this role is used during task startup and runtime for container management operations.</p>
121    pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_execution_role_arn(input);
123        self
124    }
125    /// <p>The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make Amazon Web Services API calls on your behalf. This role is required for Amazon ECS to pull container images from Amazon ECR, send container logs to Amazon CloudWatch Logs, and retrieve sensitive data from Amazon Web Services Systems Manager Parameter Store or Amazon Web Services Secrets Manager.</p>
126    /// <p>The execution role must include the <code>AmazonECSTaskExecutionRolePolicy</code> managed policy or equivalent permissions. For Express services, this role is used during task startup and runtime for container management operations.</p>
127    pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_execution_role_arn()
129    }
130    /// <p>The Amazon Resource Name (ARN) of the infrastructure role that grants Amazon ECS permission to create and manage Amazon Web Services resources on your behalf for the Express service. This role is used to provision and manage Application Load Balancers, target groups, security groups, auto-scaling policies, and other Amazon Web Services infrastructure components.</p>
131    /// <p>The infrastructure role must include permissions for Elastic Load Balancing, Application Auto Scaling, Amazon EC2 (for security groups), and other services required for managed infrastructure. This role is only used during Express service creation, updates, and deletion operations.</p>
132    pub fn infrastructure_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.infrastructure_role_arn(input.into());
134        self
135    }
136    /// <p>The Amazon Resource Name (ARN) of the infrastructure role that grants Amazon ECS permission to create and manage Amazon Web Services resources on your behalf for the Express service. This role is used to provision and manage Application Load Balancers, target groups, security groups, auto-scaling policies, and other Amazon Web Services infrastructure components.</p>
137    /// <p>The infrastructure role must include permissions for Elastic Load Balancing, Application Auto Scaling, Amazon EC2 (for security groups), and other services required for managed infrastructure. This role is only used during Express service creation, updates, and deletion operations.</p>
138    pub fn set_infrastructure_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_infrastructure_role_arn(input);
140        self
141    }
142    /// <p>The Amazon Resource Name (ARN) of the infrastructure role that grants Amazon ECS permission to create and manage Amazon Web Services resources on your behalf for the Express service. This role is used to provision and manage Application Load Balancers, target groups, security groups, auto-scaling policies, and other Amazon Web Services infrastructure components.</p>
143    /// <p>The infrastructure role must include permissions for Elastic Load Balancing, Application Auto Scaling, Amazon EC2 (for security groups), and other services required for managed infrastructure. This role is only used during Express service creation, updates, and deletion operations.</p>
144    pub fn get_infrastructure_role_arn(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_infrastructure_role_arn()
146    }
147    /// <p>The name of the Express service. This name must be unique within the specified cluster and can contain up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens. The name is used to identify the service in the Amazon ECS console and API operations.</p>
148    /// <p>If you don't specify a service name, Amazon ECS generates a unique name for the service. The service name becomes part of the service ARN and cannot be changed after the service is created.</p>
149    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.service_name(input.into());
151        self
152    }
153    /// <p>The name of the Express service. This name must be unique within the specified cluster and can contain up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens. The name is used to identify the service in the Amazon ECS console and API operations.</p>
154    /// <p>If you don't specify a service name, Amazon ECS generates a unique name for the service. The service name becomes part of the service ARN and cannot be changed after the service is created.</p>
155    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_service_name(input);
157        self
158    }
159    /// <p>The name of the Express service. This name must be unique within the specified cluster and can contain up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens. The name is used to identify the service in the Amazon ECS console and API operations.</p>
160    /// <p>If you don't specify a service name, Amazon ECS generates a unique name for the service. The service name becomes part of the service ARN and cannot be changed after the service is created.</p>
161    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
162        self.inner.get_service_name()
163    }
164    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster on which to create the Express service. If you do not specify a cluster, the <code>default</code> cluster is assumed.</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 on which to create the Express service. If you do not specify a cluster, the <code>default</code> cluster is assumed.</p>
170    pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_cluster(input);
172        self
173    }
174    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster on which to create the Express service. If you do not specify a cluster, the <code>default</code> cluster is assumed.</p>
175    pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
176        self.inner.get_cluster()
177    }
178    /// <p>The path on the container that the Application Load Balancer uses for health checks. This should be a valid HTTP endpoint that returns a successful response (HTTP 200) when the application is healthy.</p>
179    /// <p>If not specified, the default health check path is <code>/ping</code>. The health check path must start with a forward slash and can include query parameters. Examples: <code>/health</code>, <code>/api/status</code>, <code>/ping?format=json</code>.</p>
180    pub fn health_check_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.inner = self.inner.health_check_path(input.into());
182        self
183    }
184    /// <p>The path on the container that the Application Load Balancer uses for health checks. This should be a valid HTTP endpoint that returns a successful response (HTTP 200) when the application is healthy.</p>
185    /// <p>If not specified, the default health check path is <code>/ping</code>. The health check path must start with a forward slash and can include query parameters. Examples: <code>/health</code>, <code>/api/status</code>, <code>/ping?format=json</code>.</p>
186    pub fn set_health_check_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.inner = self.inner.set_health_check_path(input);
188        self
189    }
190    /// <p>The path on the container that the Application Load Balancer uses for health checks. This should be a valid HTTP endpoint that returns a successful response (HTTP 200) when the application is healthy.</p>
191    /// <p>If not specified, the default health check path is <code>/ping</code>. The health check path must start with a forward slash and can include query parameters. Examples: <code>/health</code>, <code>/api/status</code>, <code>/ping?format=json</code>.</p>
192    pub fn get_health_check_path(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_health_check_path()
194    }
195    /// <p>The primary container configuration for the Express service. This defines the main application container that will receive traffic from the Application Load Balancer.</p>
196    /// <p>The primary container must specify at minimum a container image. You can also configure the container port (defaults to 80), logging configuration, environment variables, secrets, and startup commands. The container image can be from Amazon ECR, Docker Hub, or any other container registry accessible to your execution role.</p>
197    pub fn primary_container(mut self, input: crate::types::ExpressGatewayContainer) -> Self {
198        self.inner = self.inner.primary_container(input);
199        self
200    }
201    /// <p>The primary container configuration for the Express service. This defines the main application container that will receive traffic from the Application Load Balancer.</p>
202    /// <p>The primary container must specify at minimum a container image. You can also configure the container port (defaults to 80), logging configuration, environment variables, secrets, and startup commands. The container image can be from Amazon ECR, Docker Hub, or any other container registry accessible to your execution role.</p>
203    pub fn set_primary_container(mut self, input: ::std::option::Option<crate::types::ExpressGatewayContainer>) -> Self {
204        self.inner = self.inner.set_primary_container(input);
205        self
206    }
207    /// <p>The primary container configuration for the Express service. This defines the main application container that will receive traffic from the Application Load Balancer.</p>
208    /// <p>The primary container must specify at minimum a container image. You can also configure the container port (defaults to 80), logging configuration, environment variables, secrets, and startup commands. The container image can be from Amazon ECR, Docker Hub, or any other container registry accessible to your execution role.</p>
209    pub fn get_primary_container(&self) -> &::std::option::Option<crate::types::ExpressGatewayContainer> {
210        self.inner.get_primary_container()
211    }
212    /// <p>The Amazon Resource Name (ARN) of the IAM role that containers in this task can assume. This role allows your application code to access other Amazon Web Services services securely.</p>
213    /// <p>The task role is different from the execution role. While the execution role is used by the Amazon ECS agent to set up the task, the task role is used by your application code running inside the container to make Amazon Web Services API calls. If your application doesn't need to access Amazon Web Services services, you can omit this parameter.</p>
214    pub fn task_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215        self.inner = self.inner.task_role_arn(input.into());
216        self
217    }
218    /// <p>The Amazon Resource Name (ARN) of the IAM role that containers in this task can assume. This role allows your application code to access other Amazon Web Services services securely.</p>
219    /// <p>The task role is different from the execution role. While the execution role is used by the Amazon ECS agent to set up the task, the task role is used by your application code running inside the container to make Amazon Web Services API calls. If your application doesn't need to access Amazon Web Services services, you can omit this parameter.</p>
220    pub fn set_task_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.inner = self.inner.set_task_role_arn(input);
222        self
223    }
224    /// <p>The Amazon Resource Name (ARN) of the IAM role that containers in this task can assume. This role allows your application code to access other Amazon Web Services services securely.</p>
225    /// <p>The task role is different from the execution role. While the execution role is used by the Amazon ECS agent to set up the task, the task role is used by your application code running inside the container to make Amazon Web Services API calls. If your application doesn't need to access Amazon Web Services services, you can omit this parameter.</p>
226    pub fn get_task_role_arn(&self) -> &::std::option::Option<::std::string::String> {
227        self.inner.get_task_role_arn()
228    }
229    /// <p>The network configuration for the Express service tasks. This specifies the VPC subnets and security groups for the tasks.</p>
230    /// <p>For Express services, you can specify custom security groups and subnets. If not provided, Amazon ECS will use the default VPC configuration and create appropriate security groups automatically. The network configuration determines how your service integrates with your VPC and what network access it has.</p>
231    pub fn network_configuration(mut self, input: crate::types::ExpressGatewayServiceNetworkConfiguration) -> Self {
232        self.inner = self.inner.network_configuration(input);
233        self
234    }
235    /// <p>The network configuration for the Express service tasks. This specifies the VPC subnets and security groups for the tasks.</p>
236    /// <p>For Express services, you can specify custom security groups and subnets. If not provided, Amazon ECS will use the default VPC configuration and create appropriate security groups automatically. The network configuration determines how your service integrates with your VPC and what network access it has.</p>
237    pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::ExpressGatewayServiceNetworkConfiguration>) -> Self {
238        self.inner = self.inner.set_network_configuration(input);
239        self
240    }
241    /// <p>The network configuration for the Express service tasks. This specifies the VPC subnets and security groups for the tasks.</p>
242    /// <p>For Express services, you can specify custom security groups and subnets. If not provided, Amazon ECS will use the default VPC configuration and create appropriate security groups automatically. The network configuration determines how your service integrates with your VPC and what network access it has.</p>
243    pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::ExpressGatewayServiceNetworkConfiguration> {
244        self.inner.get_network_configuration()
245    }
246    /// <p>The number of CPU units used by the task. This parameter determines the CPU allocation for each task in the Express service. The default value for an Express service is 256 (.25 vCPU).</p>
247    pub fn cpu(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
248        self.inner = self.inner.cpu(input.into());
249        self
250    }
251    /// <p>The number of CPU units used by the task. This parameter determines the CPU allocation for each task in the Express service. The default value for an Express service is 256 (.25 vCPU).</p>
252    pub fn set_cpu(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
253        self.inner = self.inner.set_cpu(input);
254        self
255    }
256    /// <p>The number of CPU units used by the task. This parameter determines the CPU allocation for each task in the Express service. The default value for an Express service is 256 (.25 vCPU).</p>
257    pub fn get_cpu(&self) -> &::std::option::Option<::std::string::String> {
258        self.inner.get_cpu()
259    }
260    /// <p>The amount of memory (in MiB) used by the task. This parameter determines the memory allocation for each task in the Express service. The default value for an express service is 512 MiB.</p>
261    pub fn memory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
262        self.inner = self.inner.memory(input.into());
263        self
264    }
265    /// <p>The amount of memory (in MiB) used by the task. This parameter determines the memory allocation for each task in the Express service. The default value for an express service is 512 MiB.</p>
266    pub fn set_memory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
267        self.inner = self.inner.set_memory(input);
268        self
269    }
270    /// <p>The amount of memory (in MiB) used by the task. This parameter determines the memory allocation for each task in the Express service. The default value for an express service is 512 MiB.</p>
271    pub fn get_memory(&self) -> &::std::option::Option<::std::string::String> {
272        self.inner.get_memory()
273    }
274    /// <p>The auto-scaling configuration for the Express service. This defines how the service automatically adjusts the number of running tasks based on demand.</p>
275    /// <p>You can specify the minimum and maximum number of tasks, the scaling metric (CPU utilization, memory utilization, or request count per target), and the target value for the metric. If not specified, the default target value for an Express service is 60.</p>
276    pub fn scaling_target(mut self, input: crate::types::ExpressGatewayScalingTarget) -> Self {
277        self.inner = self.inner.scaling_target(input);
278        self
279    }
280    /// <p>The auto-scaling configuration for the Express service. This defines how the service automatically adjusts the number of running tasks based on demand.</p>
281    /// <p>You can specify the minimum and maximum number of tasks, the scaling metric (CPU utilization, memory utilization, or request count per target), and the target value for the metric. If not specified, the default target value for an Express service is 60.</p>
282    pub fn set_scaling_target(mut self, input: ::std::option::Option<crate::types::ExpressGatewayScalingTarget>) -> Self {
283        self.inner = self.inner.set_scaling_target(input);
284        self
285    }
286    /// <p>The auto-scaling configuration for the Express service. This defines how the service automatically adjusts the number of running tasks based on demand.</p>
287    /// <p>You can specify the minimum and maximum number of tasks, the scaling metric (CPU utilization, memory utilization, or request count per target), and the target value for the metric. If not specified, the default target value for an Express service is 60.</p>
288    pub fn get_scaling_target(&self) -> &::std::option::Option<crate::types::ExpressGatewayScalingTarget> {
289        self.inner.get_scaling_target()
290    }
291    ///
292    /// Appends an item to `tags`.
293    ///
294    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
295    ///
296    /// <p>The metadata that you apply to the Express service to help categorize and organize it. Each tag consists of a key and an optional value. You can apply up to 50 tags to a service.</p>
297    pub fn tags(mut self, input: crate::types::Tag) -> Self {
298        self.inner = self.inner.tags(input);
299        self
300    }
301    /// <p>The metadata that you apply to the Express service to help categorize and organize it. Each tag consists of a key and an optional value. You can apply up to 50 tags to a service.</p>
302    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
303        self.inner = self.inner.set_tags(input);
304        self
305    }
306    /// <p>The metadata that you apply to the Express service to help categorize and organize it. Each tag consists of a key and an optional value. You can apply up to 50 tags to a service.</p>
307    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
308        self.inner.get_tags()
309    }
310}