aws_sdk_lightsail/operation/create_container_service/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_container_service::_create_container_service_output::CreateContainerServiceOutputBuilder;
3
4pub use crate::operation::create_container_service::_create_container_service_input::CreateContainerServiceInputBuilder;
5
6impl crate::operation::create_container_service::builders::CreateContainerServiceInputBuilder {
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_container_service::CreateContainerServiceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_container_service::CreateContainerServiceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_container_service();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateContainerService`.
24///
25/// <p>Creates an Amazon Lightsail container service.</p>
26/// <p>A Lightsail container service is a compute resource to which you can deploy containers. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-container-services">Container services in Amazon Lightsail</a> in the <i>Lightsail Dev Guide</i>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateContainerServiceFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_container_service::builders::CreateContainerServiceInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_container_service::CreateContainerServiceOutput,
36        crate::operation::create_container_service::CreateContainerServiceError,
37    > for CreateContainerServiceFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_container_service::CreateContainerServiceOutput,
45            crate::operation::create_container_service::CreateContainerServiceError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateContainerServiceFluentBuilder {
52    /// Creates a new `CreateContainerServiceFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateContainerService as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_container_service::builders::CreateContainerServiceInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_container_service::CreateContainerServiceOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_container_service::CreateContainerServiceError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_container_service::CreateContainerService::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_container_service::CreateContainerService::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_container_service::CreateContainerServiceOutput,
98        crate::operation::create_container_service::CreateContainerServiceError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The name for the container service.</p>
113    /// <p>The name that you specify for your container service will make up part of its default domain. The default domain of a container service is typically <code>https://<servicename>
114    /// .
115    /// <randomguid>
116    /// .
117    /// <awsregion>
118    /// .cs.amazonlightsail.com
119    /// </awsregion>
120    /// </randomguid>
121    /// </servicename></code>. If the name of your container service is <code>container-service-1</code>, and it's located in the US East (Ohio) Amazon Web Services Region (<code>us-east-2</code>), then the domain for your container service will be like the following example: <code>https://container-service-1.ur4EXAMPLE2uq.us-east-2.cs.amazonlightsail.com</code></p>
122    /// <p>The following are the requirements for container service names:</p>
123    /// <ul>
124    /// <li>
125    /// <p>Must be unique within each Amazon Web Services Region in your Lightsail account.</p></li>
126    /// <li>
127    /// <p>Must contain 1 to 63 characters.</p></li>
128    /// <li>
129    /// <p>Must contain only alphanumeric characters and hyphens.</p></li>
130    /// <li>
131    /// <p>A hyphen (-) can separate words but cannot be at the start or end of the name.</p></li>
132    /// </ul>
133    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.service_name(input.into());
135        self
136    }
137    /// <p>The name for the container service.</p>
138    /// <p>The name that you specify for your container service will make up part of its default domain. The default domain of a container service is typically <code>https://<servicename>
139    /// .
140    /// <randomguid>
141    /// .
142    /// <awsregion>
143    /// .cs.amazonlightsail.com
144    /// </awsregion>
145    /// </randomguid>
146    /// </servicename></code>. If the name of your container service is <code>container-service-1</code>, and it's located in the US East (Ohio) Amazon Web Services Region (<code>us-east-2</code>), then the domain for your container service will be like the following example: <code>https://container-service-1.ur4EXAMPLE2uq.us-east-2.cs.amazonlightsail.com</code></p>
147    /// <p>The following are the requirements for container service names:</p>
148    /// <ul>
149    /// <li>
150    /// <p>Must be unique within each Amazon Web Services Region in your Lightsail account.</p></li>
151    /// <li>
152    /// <p>Must contain 1 to 63 characters.</p></li>
153    /// <li>
154    /// <p>Must contain only alphanumeric characters and hyphens.</p></li>
155    /// <li>
156    /// <p>A hyphen (-) can separate words but cannot be at the start or end of the name.</p></li>
157    /// </ul>
158    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_service_name(input);
160        self
161    }
162    /// <p>The name for the container service.</p>
163    /// <p>The name that you specify for your container service will make up part of its default domain. The default domain of a container service is typically <code>https://<servicename>
164    /// .
165    /// <randomguid>
166    /// .
167    /// <awsregion>
168    /// .cs.amazonlightsail.com
169    /// </awsregion>
170    /// </randomguid>
171    /// </servicename></code>. If the name of your container service is <code>container-service-1</code>, and it's located in the US East (Ohio) Amazon Web Services Region (<code>us-east-2</code>), then the domain for your container service will be like the following example: <code>https://container-service-1.ur4EXAMPLE2uq.us-east-2.cs.amazonlightsail.com</code></p>
172    /// <p>The following are the requirements for container service names:</p>
173    /// <ul>
174    /// <li>
175    /// <p>Must be unique within each Amazon Web Services Region in your Lightsail account.</p></li>
176    /// <li>
177    /// <p>Must contain 1 to 63 characters.</p></li>
178    /// <li>
179    /// <p>Must contain only alphanumeric characters and hyphens.</p></li>
180    /// <li>
181    /// <p>A hyphen (-) can separate words but cannot be at the start or end of the name.</p></li>
182    /// </ul>
183    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
184        self.inner.get_service_name()
185    }
186    /// <p>The power specification for the container service.</p>
187    /// <p>The power specifies the amount of memory, vCPUs, and base monthly cost of each node of the container service. The <code>power</code> and <code>scale</code> of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the <code>power</code> with the <code>scale</code> (the number of nodes) of the service.</p>
188    /// <p>Use the <code>GetContainerServicePowers</code> action to get a list of power options that you can specify using this parameter, and their base monthly cost.</p>
189    pub fn power(mut self, input: crate::types::ContainerServicePowerName) -> Self {
190        self.inner = self.inner.power(input);
191        self
192    }
193    /// <p>The power specification for the container service.</p>
194    /// <p>The power specifies the amount of memory, vCPUs, and base monthly cost of each node of the container service. The <code>power</code> and <code>scale</code> of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the <code>power</code> with the <code>scale</code> (the number of nodes) of the service.</p>
195    /// <p>Use the <code>GetContainerServicePowers</code> action to get a list of power options that you can specify using this parameter, and their base monthly cost.</p>
196    pub fn set_power(mut self, input: ::std::option::Option<crate::types::ContainerServicePowerName>) -> Self {
197        self.inner = self.inner.set_power(input);
198        self
199    }
200    /// <p>The power specification for the container service.</p>
201    /// <p>The power specifies the amount of memory, vCPUs, and base monthly cost of each node of the container service. The <code>power</code> and <code>scale</code> of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the <code>power</code> with the <code>scale</code> (the number of nodes) of the service.</p>
202    /// <p>Use the <code>GetContainerServicePowers</code> action to get a list of power options that you can specify using this parameter, and their base monthly cost.</p>
203    pub fn get_power(&self) -> &::std::option::Option<crate::types::ContainerServicePowerName> {
204        self.inner.get_power()
205    }
206    /// <p>The scale specification for the container service.</p>
207    /// <p>The scale specifies the allocated compute nodes of the container service. The <code>power</code> and <code>scale</code> of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the <code>power</code> with the <code>scale</code> (the number of nodes) of the service.</p>
208    pub fn scale(mut self, input: i32) -> Self {
209        self.inner = self.inner.scale(input);
210        self
211    }
212    /// <p>The scale specification for the container service.</p>
213    /// <p>The scale specifies the allocated compute nodes of the container service. The <code>power</code> and <code>scale</code> of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the <code>power</code> with the <code>scale</code> (the number of nodes) of the service.</p>
214    pub fn set_scale(mut self, input: ::std::option::Option<i32>) -> Self {
215        self.inner = self.inner.set_scale(input);
216        self
217    }
218    /// <p>The scale specification for the container service.</p>
219    /// <p>The scale specifies the allocated compute nodes of the container service. The <code>power</code> and <code>scale</code> of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the <code>power</code> with the <code>scale</code> (the number of nodes) of the service.</p>
220    pub fn get_scale(&self) -> &::std::option::Option<i32> {
221        self.inner.get_scale()
222    }
223    ///
224    /// Appends an item to `tags`.
225    ///
226    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
227    ///
228    /// <p>The tag keys and optional values to add to the container service during create.</p>
229    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
230    /// <p>For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
231    pub fn tags(mut self, input: crate::types::Tag) -> Self {
232        self.inner = self.inner.tags(input);
233        self
234    }
235    /// <p>The tag keys and optional values to add to the container service during create.</p>
236    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
237    /// <p>For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
238    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
239        self.inner = self.inner.set_tags(input);
240        self
241    }
242    /// <p>The tag keys and optional values to add to the container service during create.</p>
243    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
244    /// <p>For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
245    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
246        self.inner.get_tags()
247    }
248    ///
249    /// Adds a key-value pair to `publicDomainNames`.
250    ///
251    /// To override the contents of this collection use [`set_public_domain_names`](Self::set_public_domain_names).
252    ///
253    /// <p>The public domain names to use with the container service, such as <code>example.com</code> and <code>www.example.com</code>.</p>
254    /// <p>You can specify up to four public domain names for a container service. The domain names that you specify are used when you create a deployment with a container configured as the public endpoint of your container service.</p>
255    /// <p>If you don't specify public domain names, then you can use the default domain of the container service.</p><important>
256    /// <p>You must create and validate an SSL/TLS certificate before you can use public domain names with your container service. Use the <code>CreateCertificate</code> action to create a certificate for the public domain names you want to use with your container service.</p>
257    /// </important>
258    /// <p>You can specify public domain names using a string to array map as shown in the example later on this page.</p>
259    pub fn public_domain_names(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
260        self.inner = self.inner.public_domain_names(k.into(), v);
261        self
262    }
263    /// <p>The public domain names to use with the container service, such as <code>example.com</code> and <code>www.example.com</code>.</p>
264    /// <p>You can specify up to four public domain names for a container service. The domain names that you specify are used when you create a deployment with a container configured as the public endpoint of your container service.</p>
265    /// <p>If you don't specify public domain names, then you can use the default domain of the container service.</p><important>
266    /// <p>You must create and validate an SSL/TLS certificate before you can use public domain names with your container service. Use the <code>CreateCertificate</code> action to create a certificate for the public domain names you want to use with your container service.</p>
267    /// </important>
268    /// <p>You can specify public domain names using a string to array map as shown in the example later on this page.</p>
269    pub fn set_public_domain_names(
270        mut self,
271        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
272    ) -> Self {
273        self.inner = self.inner.set_public_domain_names(input);
274        self
275    }
276    /// <p>The public domain names to use with the container service, such as <code>example.com</code> and <code>www.example.com</code>.</p>
277    /// <p>You can specify up to four public domain names for a container service. The domain names that you specify are used when you create a deployment with a container configured as the public endpoint of your container service.</p>
278    /// <p>If you don't specify public domain names, then you can use the default domain of the container service.</p><important>
279    /// <p>You must create and validate an SSL/TLS certificate before you can use public domain names with your container service. Use the <code>CreateCertificate</code> action to create a certificate for the public domain names you want to use with your container service.</p>
280    /// </important>
281    /// <p>You can specify public domain names using a string to array map as shown in the example later on this page.</p>
282    pub fn get_public_domain_names(
283        &self,
284    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
285        self.inner.get_public_domain_names()
286    }
287    /// <p>An object that describes a deployment for the container service.</p>
288    /// <p>A deployment specifies the containers that will be launched on the container service and their settings, such as the ports to open, the environment variables to apply, and the launch command to run. It also specifies the container that will serve as the public endpoint of the deployment and its settings, such as the HTTP or HTTPS port to use, and the health check configuration.</p>
289    pub fn deployment(mut self, input: crate::types::ContainerServiceDeploymentRequest) -> Self {
290        self.inner = self.inner.deployment(input);
291        self
292    }
293    /// <p>An object that describes a deployment for the container service.</p>
294    /// <p>A deployment specifies the containers that will be launched on the container service and their settings, such as the ports to open, the environment variables to apply, and the launch command to run. It also specifies the container that will serve as the public endpoint of the deployment and its settings, such as the HTTP or HTTPS port to use, and the health check configuration.</p>
295    pub fn set_deployment(mut self, input: ::std::option::Option<crate::types::ContainerServiceDeploymentRequest>) -> Self {
296        self.inner = self.inner.set_deployment(input);
297        self
298    }
299    /// <p>An object that describes a deployment for the container service.</p>
300    /// <p>A deployment specifies the containers that will be launched on the container service and their settings, such as the ports to open, the environment variables to apply, and the launch command to run. It also specifies the container that will serve as the public endpoint of the deployment and its settings, such as the HTTP or HTTPS port to use, and the health check configuration.</p>
301    pub fn get_deployment(&self) -> &::std::option::Option<crate::types::ContainerServiceDeploymentRequest> {
302        self.inner.get_deployment()
303    }
304    /// <p>An object to describe the configuration for the container service to access private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories.</p>
305    /// <p>For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-container-service-ecr-private-repo-access">Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
306    pub fn private_registry_access(mut self, input: crate::types::PrivateRegistryAccessRequest) -> Self {
307        self.inner = self.inner.private_registry_access(input);
308        self
309    }
310    /// <p>An object to describe the configuration for the container service to access private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories.</p>
311    /// <p>For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-container-service-ecr-private-repo-access">Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
312    pub fn set_private_registry_access(mut self, input: ::std::option::Option<crate::types::PrivateRegistryAccessRequest>) -> Self {
313        self.inner = self.inner.set_private_registry_access(input);
314        self
315    }
316    /// <p>An object to describe the configuration for the container service to access private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories.</p>
317    /// <p>For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-container-service-ecr-private-repo-access">Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
318    pub fn get_private_registry_access(&self) -> &::std::option::Option<crate::types::PrivateRegistryAccessRequest> {
319        self.inner.get_private_registry_access()
320    }
321}