aws_sdk_lightsail/operation/create_load_balancer/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_load_balancer::_create_load_balancer_output::CreateLoadBalancerOutputBuilder;
3
4pub use crate::operation::create_load_balancer::_create_load_balancer_input::CreateLoadBalancerInputBuilder;
5
6impl crate::operation::create_load_balancer::builders::CreateLoadBalancerInputBuilder {
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_load_balancer::CreateLoadBalancerOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_load_balancer::CreateLoadBalancerError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_load_balancer();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateLoadBalancer`.
24///
25/// <p>Creates a Lightsail load balancer. To learn more about deciding whether to load balance your application, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-lightsail-instances-for-load-balancing">Configure your Lightsail instances for load balancing</a>. You can create up to 10 load balancers per AWS Region in your account.</p>
26/// <p>When you create a load balancer, you can specify a unique name and port settings. To change additional load balancer settings, use the <code>UpdateLoadBalancerAttribute</code> operation.</p>
27/// <p>The <code>create load balancer</code> operation supports tag-based access control via request tags. For more information, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-controlling-access-using-tags">Amazon Lightsail Developer Guide</a>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateLoadBalancerFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::create_load_balancer::builders::CreateLoadBalancerInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::create_load_balancer::CreateLoadBalancerOutput,
37 crate::operation::create_load_balancer::CreateLoadBalancerError,
38 > for CreateLoadBalancerFluentBuilder
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_load_balancer::CreateLoadBalancerOutput,
46 crate::operation::create_load_balancer::CreateLoadBalancerError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl CreateLoadBalancerFluentBuilder {
53 /// Creates a new `CreateLoadBalancerFluentBuilder`.
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 CreateLoadBalancer as a reference.
62 pub fn as_input(&self) -> &crate::operation::create_load_balancer::builders::CreateLoadBalancerInputBuilder {
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_load_balancer::CreateLoadBalancerOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::create_load_balancer::CreateLoadBalancerError,
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_load_balancer::CreateLoadBalancer::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::create_load_balancer::CreateLoadBalancer::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_load_balancer::CreateLoadBalancerOutput,
99 crate::operation::create_load_balancer::CreateLoadBalancerError,
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 name of your load balancer.</p>
114 pub fn load_balancer_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.load_balancer_name(input.into());
116 self
117 }
118 /// <p>The name of your load balancer.</p>
119 pub fn set_load_balancer_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_load_balancer_name(input);
121 self
122 }
123 /// <p>The name of your load balancer.</p>
124 pub fn get_load_balancer_name(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_load_balancer_name()
126 }
127 /// <p>The instance port where you're creating your load balancer.</p>
128 pub fn instance_port(mut self, input: i32) -> Self {
129 self.inner = self.inner.instance_port(input);
130 self
131 }
132 /// <p>The instance port where you're creating your load balancer.</p>
133 pub fn set_instance_port(mut self, input: ::std::option::Option<i32>) -> Self {
134 self.inner = self.inner.set_instance_port(input);
135 self
136 }
137 /// <p>The instance port where you're creating your load balancer.</p>
138 pub fn get_instance_port(&self) -> &::std::option::Option<i32> {
139 self.inner.get_instance_port()
140 }
141 /// <p>The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (<code>"/"</code>).</p>
142 /// <p>You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.</p>
143 pub fn health_check_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.health_check_path(input.into());
145 self
146 }
147 /// <p>The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (<code>"/"</code>).</p>
148 /// <p>You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.</p>
149 pub fn set_health_check_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.inner = self.inner.set_health_check_path(input);
151 self
152 }
153 /// <p>The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (<code>"/"</code>).</p>
154 /// <p>You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.</p>
155 pub fn get_health_check_path(&self) -> &::std::option::Option<::std::string::String> {
156 self.inner.get_health_check_path()
157 }
158 /// <p>The name of the SSL/TLS certificate.</p>
159 /// <p>If you specify <code>certificateName</code>, then <code>certificateDomainName</code> is required (and vice-versa).</p>
160 pub fn certificate_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.certificate_name(input.into());
162 self
163 }
164 /// <p>The name of the SSL/TLS certificate.</p>
165 /// <p>If you specify <code>certificateName</code>, then <code>certificateDomainName</code> is required (and vice-versa).</p>
166 pub fn set_certificate_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.inner = self.inner.set_certificate_name(input);
168 self
169 }
170 /// <p>The name of the SSL/TLS certificate.</p>
171 /// <p>If you specify <code>certificateName</code>, then <code>certificateDomainName</code> is required (and vice-versa).</p>
172 pub fn get_certificate_name(&self) -> &::std::option::Option<::std::string::String> {
173 self.inner.get_certificate_name()
174 }
175 /// <p>The domain name with which your certificate is associated (<code>example.com</code>).</p>
176 /// <p>If you specify <code>certificateDomainName</code>, then <code>certificateName</code> is required (and vice-versa).</p>
177 pub fn certificate_domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178 self.inner = self.inner.certificate_domain_name(input.into());
179 self
180 }
181 /// <p>The domain name with which your certificate is associated (<code>example.com</code>).</p>
182 /// <p>If you specify <code>certificateDomainName</code>, then <code>certificateName</code> is required (and vice-versa).</p>
183 pub fn set_certificate_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184 self.inner = self.inner.set_certificate_domain_name(input);
185 self
186 }
187 /// <p>The domain name with which your certificate is associated (<code>example.com</code>).</p>
188 /// <p>If you specify <code>certificateDomainName</code>, then <code>certificateName</code> is required (and vice-versa).</p>
189 pub fn get_certificate_domain_name(&self) -> &::std::option::Option<::std::string::String> {
190 self.inner.get_certificate_domain_name()
191 }
192 ///
193 /// Appends an item to `certificateAlternativeNames`.
194 ///
195 /// To override the contents of this collection use [`set_certificate_alternative_names`](Self::set_certificate_alternative_names).
196 ///
197 /// <p>The optional alternative domains and subdomains to use with your SSL/TLS certificate (<code>www.example.com</code>, <code>example.com</code>, <code>m.example.com</code>, <code>blog.example.com</code>).</p>
198 pub fn certificate_alternative_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199 self.inner = self.inner.certificate_alternative_names(input.into());
200 self
201 }
202 /// <p>The optional alternative domains and subdomains to use with your SSL/TLS certificate (<code>www.example.com</code>, <code>example.com</code>, <code>m.example.com</code>, <code>blog.example.com</code>).</p>
203 pub fn set_certificate_alternative_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
204 self.inner = self.inner.set_certificate_alternative_names(input);
205 self
206 }
207 /// <p>The optional alternative domains and subdomains to use with your SSL/TLS certificate (<code>www.example.com</code>, <code>example.com</code>, <code>m.example.com</code>, <code>blog.example.com</code>).</p>
208 pub fn get_certificate_alternative_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
209 self.inner.get_certificate_alternative_names()
210 }
211 ///
212 /// Appends an item to `tags`.
213 ///
214 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
215 ///
216 /// <p>The tag keys and optional values to add to the resource during create.</p>
217 /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
218 pub fn tags(mut self, input: crate::types::Tag) -> Self {
219 self.inner = self.inner.tags(input);
220 self
221 }
222 /// <p>The tag keys and optional values to add to the resource during create.</p>
223 /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
224 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
225 self.inner = self.inner.set_tags(input);
226 self
227 }
228 /// <p>The tag keys and optional values to add to the resource during create.</p>
229 /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
230 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
231 self.inner.get_tags()
232 }
233 /// <p>The IP address type for the load balancer.</p>
234 /// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
235 /// <p>The default value is <code>dualstack</code>.</p>
236 pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
237 self.inner = self.inner.ip_address_type(input);
238 self
239 }
240 /// <p>The IP address type for the load balancer.</p>
241 /// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
242 /// <p>The default value is <code>dualstack</code>.</p>
243 pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
244 self.inner = self.inner.set_ip_address_type(input);
245 self
246 }
247 /// <p>The IP address type for the load balancer.</p>
248 /// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
249 /// <p>The default value is <code>dualstack</code>.</p>
250 pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
251 self.inner.get_ip_address_type()
252 }
253 /// <p>The name of the TLS policy to apply to the load balancer.</p>
254 /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetLoadBalancerTlsPolicies.html">GetLoadBalancerTlsPolicies</a> action to get a list of TLS policy names that you can specify.</p>
255 /// <p>For more information about load balancer TLS policies, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-load-balancer-tls-security-policy">Configuring TLS security policies on your Amazon Lightsail load balancers</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
256 pub fn tls_policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
257 self.inner = self.inner.tls_policy_name(input.into());
258 self
259 }
260 /// <p>The name of the TLS policy to apply to the load balancer.</p>
261 /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetLoadBalancerTlsPolicies.html">GetLoadBalancerTlsPolicies</a> action to get a list of TLS policy names that you can specify.</p>
262 /// <p>For more information about load balancer TLS policies, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-load-balancer-tls-security-policy">Configuring TLS security policies on your Amazon Lightsail load balancers</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
263 pub fn set_tls_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264 self.inner = self.inner.set_tls_policy_name(input);
265 self
266 }
267 /// <p>The name of the TLS policy to apply to the load balancer.</p>
268 /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetLoadBalancerTlsPolicies.html">GetLoadBalancerTlsPolicies</a> action to get a list of TLS policy names that you can specify.</p>
269 /// <p>For more information about load balancer TLS policies, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-load-balancer-tls-security-policy">Configuring TLS security policies on your Amazon Lightsail load balancers</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
270 pub fn get_tls_policy_name(&self) -> &::std::option::Option<::std::string::String> {
271 self.inner.get_tls_policy_name()
272 }
273}