aws_sdk_apprunner/operation/create_auto_scaling_configuration/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_auto_scaling_configuration::_create_auto_scaling_configuration_output::CreateAutoScalingConfigurationOutputBuilder;
3
4pub use crate::operation::create_auto_scaling_configuration::_create_auto_scaling_configuration_input::CreateAutoScalingConfigurationInputBuilder;
5
6impl crate::operation::create_auto_scaling_configuration::builders::CreateAutoScalingConfigurationInputBuilder {
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_auto_scaling_configuration::CreateAutoScalingConfigurationOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfigurationError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_auto_scaling_configuration();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateAutoScalingConfiguration`.
24///
25/// <p>Create an App Runner automatic scaling configuration resource. App Runner requires this resource when you create or update App Runner services and you require non-default auto scaling settings. You can share an auto scaling configuration across multiple services.</p>
26/// <p>Create multiple revisions of a configuration by calling this action multiple times using the same <code>AutoScalingConfigurationName</code>. The call returns incremental <code>AutoScalingConfigurationRevision</code> values. When you create a service and configure an auto scaling configuration resource, the service uses the latest active revision of the auto scaling configuration by default. You can optionally configure the service to use a specific revision.</p>
27/// <p>Configure a higher <code>MinSize</code> to increase the spread of your App Runner service over more Availability Zones in the Amazon Web Services Region. The tradeoff is a higher minimal cost.</p>
28/// <p>Configure a lower <code>MaxSize</code> to control your cost. The tradeoff is lower responsiveness during peak demand.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateAutoScalingConfigurationFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_auto_scaling_configuration::builders::CreateAutoScalingConfigurationInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfigurationOutput,
38 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfigurationError,
39 > for CreateAutoScalingConfigurationFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfigurationOutput,
47 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfigurationError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl CreateAutoScalingConfigurationFluentBuilder {
54 /// Creates a new `CreateAutoScalingConfigurationFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the CreateAutoScalingConfiguration as a reference.
63 pub fn as_input(&self) -> &crate::operation::create_auto_scaling_configuration::builders::CreateAutoScalingConfigurationInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfigurationOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfigurationError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfiguration::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfiguration::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfigurationOutput,
100 crate::operation::create_auto_scaling_configuration::CreateAutoScalingConfigurationError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>A name for the auto scaling configuration. When you use it for the first time in an Amazon Web Services Region, App Runner creates revision number <code>1</code> of this name. When you use the same name in subsequent calls, App Runner creates incremental revisions of the configuration.</p><note>
115 /// <p>Prior to the release of <a href="https://docs.aws.amazon.com/apprunner/latest/relnotes/release-2023-09-22-auto-scale-config.html">Auto scale configuration enhancements</a>, the name <code>DefaultConfiguration</code> was reserved.</p>
116 /// <p>This restriction is no longer in place. You can now manage <code>DefaultConfiguration</code> the same way you manage your custom auto scaling configurations. This means you can do the following with the <code>DefaultConfiguration</code> that App Runner provides:</p>
117 /// <ul>
118 /// <li>
119 /// <p>Create new revisions of the <code>DefaultConfiguration</code>.</p></li>
120 /// <li>
121 /// <p>Delete the revisions of the <code>DefaultConfiguration</code>.</p></li>
122 /// <li>
123 /// <p>Delete the auto scaling configuration for which the App Runner <code>DefaultConfiguration</code> was created.</p></li>
124 /// <li>
125 /// <p>If you delete the auto scaling configuration you can create another custom auto scaling configuration with the same <code>DefaultConfiguration</code> name. The original <code>DefaultConfiguration</code> resource provided by App Runner remains in your account unless you make changes to it.</p></li>
126 /// </ul>
127 /// </note>
128 pub fn auto_scaling_configuration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129 self.inner = self.inner.auto_scaling_configuration_name(input.into());
130 self
131 }
132 /// <p>A name for the auto scaling configuration. When you use it for the first time in an Amazon Web Services Region, App Runner creates revision number <code>1</code> of this name. When you use the same name in subsequent calls, App Runner creates incremental revisions of the configuration.</p><note>
133 /// <p>Prior to the release of <a href="https://docs.aws.amazon.com/apprunner/latest/relnotes/release-2023-09-22-auto-scale-config.html">Auto scale configuration enhancements</a>, the name <code>DefaultConfiguration</code> was reserved.</p>
134 /// <p>This restriction is no longer in place. You can now manage <code>DefaultConfiguration</code> the same way you manage your custom auto scaling configurations. This means you can do the following with the <code>DefaultConfiguration</code> that App Runner provides:</p>
135 /// <ul>
136 /// <li>
137 /// <p>Create new revisions of the <code>DefaultConfiguration</code>.</p></li>
138 /// <li>
139 /// <p>Delete the revisions of the <code>DefaultConfiguration</code>.</p></li>
140 /// <li>
141 /// <p>Delete the auto scaling configuration for which the App Runner <code>DefaultConfiguration</code> was created.</p></li>
142 /// <li>
143 /// <p>If you delete the auto scaling configuration you can create another custom auto scaling configuration with the same <code>DefaultConfiguration</code> name. The original <code>DefaultConfiguration</code> resource provided by App Runner remains in your account unless you make changes to it.</p></li>
144 /// </ul>
145 /// </note>
146 pub fn set_auto_scaling_configuration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.inner = self.inner.set_auto_scaling_configuration_name(input);
148 self
149 }
150 /// <p>A name for the auto scaling configuration. When you use it for the first time in an Amazon Web Services Region, App Runner creates revision number <code>1</code> of this name. When you use the same name in subsequent calls, App Runner creates incremental revisions of the configuration.</p><note>
151 /// <p>Prior to the release of <a href="https://docs.aws.amazon.com/apprunner/latest/relnotes/release-2023-09-22-auto-scale-config.html">Auto scale configuration enhancements</a>, the name <code>DefaultConfiguration</code> was reserved.</p>
152 /// <p>This restriction is no longer in place. You can now manage <code>DefaultConfiguration</code> the same way you manage your custom auto scaling configurations. This means you can do the following with the <code>DefaultConfiguration</code> that App Runner provides:</p>
153 /// <ul>
154 /// <li>
155 /// <p>Create new revisions of the <code>DefaultConfiguration</code>.</p></li>
156 /// <li>
157 /// <p>Delete the revisions of the <code>DefaultConfiguration</code>.</p></li>
158 /// <li>
159 /// <p>Delete the auto scaling configuration for which the App Runner <code>DefaultConfiguration</code> was created.</p></li>
160 /// <li>
161 /// <p>If you delete the auto scaling configuration you can create another custom auto scaling configuration with the same <code>DefaultConfiguration</code> name. The original <code>DefaultConfiguration</code> resource provided by App Runner remains in your account unless you make changes to it.</p></li>
162 /// </ul>
163 /// </note>
164 pub fn get_auto_scaling_configuration_name(&self) -> &::std::option::Option<::std::string::String> {
165 self.inner.get_auto_scaling_configuration_name()
166 }
167 /// <p>The maximum number of concurrent requests that you want an instance to process. If the number of concurrent requests exceeds this limit, App Runner scales up your service.</p>
168 /// <p>Default: <code>100</code></p>
169 pub fn max_concurrency(mut self, input: i32) -> Self {
170 self.inner = self.inner.max_concurrency(input);
171 self
172 }
173 /// <p>The maximum number of concurrent requests that you want an instance to process. If the number of concurrent requests exceeds this limit, App Runner scales up your service.</p>
174 /// <p>Default: <code>100</code></p>
175 pub fn set_max_concurrency(mut self, input: ::std::option::Option<i32>) -> Self {
176 self.inner = self.inner.set_max_concurrency(input);
177 self
178 }
179 /// <p>The maximum number of concurrent requests that you want an instance to process. If the number of concurrent requests exceeds this limit, App Runner scales up your service.</p>
180 /// <p>Default: <code>100</code></p>
181 pub fn get_max_concurrency(&self) -> &::std::option::Option<i32> {
182 self.inner.get_max_concurrency()
183 }
184 /// <p>The minimum number of instances that App Runner provisions for your service. The service always has at least <code>MinSize</code> provisioned instances. Some of them actively serve traffic. The rest of them (provisioned and inactive instances) are a cost-effective compute capacity reserve and are ready to be quickly activated. You pay for memory usage of all the provisioned instances. You pay for CPU usage of only the active subset.</p>
185 /// <p>App Runner temporarily doubles the number of provisioned instances during deployments, to maintain the same capacity for both old and new code.</p>
186 /// <p>Default: <code>1</code></p>
187 pub fn min_size(mut self, input: i32) -> Self {
188 self.inner = self.inner.min_size(input);
189 self
190 }
191 /// <p>The minimum number of instances that App Runner provisions for your service. The service always has at least <code>MinSize</code> provisioned instances. Some of them actively serve traffic. The rest of them (provisioned and inactive instances) are a cost-effective compute capacity reserve and are ready to be quickly activated. You pay for memory usage of all the provisioned instances. You pay for CPU usage of only the active subset.</p>
192 /// <p>App Runner temporarily doubles the number of provisioned instances during deployments, to maintain the same capacity for both old and new code.</p>
193 /// <p>Default: <code>1</code></p>
194 pub fn set_min_size(mut self, input: ::std::option::Option<i32>) -> Self {
195 self.inner = self.inner.set_min_size(input);
196 self
197 }
198 /// <p>The minimum number of instances that App Runner provisions for your service. The service always has at least <code>MinSize</code> provisioned instances. Some of them actively serve traffic. The rest of them (provisioned and inactive instances) are a cost-effective compute capacity reserve and are ready to be quickly activated. You pay for memory usage of all the provisioned instances. You pay for CPU usage of only the active subset.</p>
199 /// <p>App Runner temporarily doubles the number of provisioned instances during deployments, to maintain the same capacity for both old and new code.</p>
200 /// <p>Default: <code>1</code></p>
201 pub fn get_min_size(&self) -> &::std::option::Option<i32> {
202 self.inner.get_min_size()
203 }
204 /// <p>The maximum number of instances that your service scales up to. At most <code>MaxSize</code> instances actively serve traffic for your service.</p>
205 /// <p>Default: <code>25</code></p>
206 pub fn max_size(mut self, input: i32) -> Self {
207 self.inner = self.inner.max_size(input);
208 self
209 }
210 /// <p>The maximum number of instances that your service scales up to. At most <code>MaxSize</code> instances actively serve traffic for your service.</p>
211 /// <p>Default: <code>25</code></p>
212 pub fn set_max_size(mut self, input: ::std::option::Option<i32>) -> Self {
213 self.inner = self.inner.set_max_size(input);
214 self
215 }
216 /// <p>The maximum number of instances that your service scales up to. At most <code>MaxSize</code> instances actively serve traffic for your service.</p>
217 /// <p>Default: <code>25</code></p>
218 pub fn get_max_size(&self) -> &::std::option::Option<i32> {
219 self.inner.get_max_size()
220 }
221 ///
222 /// Appends an item to `Tags`.
223 ///
224 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
225 ///
226 /// <p>A list of metadata items that you can associate with your auto scaling configuration resource. A tag is a key-value pair.</p>
227 pub fn tags(mut self, input: crate::types::Tag) -> Self {
228 self.inner = self.inner.tags(input);
229 self
230 }
231 /// <p>A list of metadata items that you can associate with your auto scaling configuration resource. A tag is a key-value pair.</p>
232 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
233 self.inner = self.inner.set_tags(input);
234 self
235 }
236 /// <p>A list of metadata items that you can associate with your auto scaling configuration resource. A tag is a key-value pair.</p>
237 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
238 self.inner.get_tags()
239 }
240}