aws_sdk_arczonalshift/operation/create_practice_run_configuration/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_practice_run_configuration::_create_practice_run_configuration_output::CreatePracticeRunConfigurationOutputBuilder;
3
4pub use crate::operation::create_practice_run_configuration::_create_practice_run_configuration_input::CreatePracticeRunConfigurationInputBuilder;
5
6impl crate::operation::create_practice_run_configuration::builders::CreatePracticeRunConfigurationInputBuilder {
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_practice_run_configuration::CreatePracticeRunConfigurationOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_practice_run_configuration::CreatePracticeRunConfigurationError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_practice_run_configuration();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreatePracticeRunConfiguration`.
24///
25/// <p>A practice run configuration for zonal autoshift is required when you enable zonal autoshift. A practice run configuration includes specifications for blocked dates and blocked time windows, and for Amazon CloudWatch alarms that you create to use with practice runs. The alarms that you specify are an <i>outcome alarm</i>, to monitor application health during practice runs and, optionally, a <i>blocking alarm</i>, to block practice runs from starting.</p>
26/// <p>When a resource has a practice run configuration, ARC starts zonal shifts for the resource weekly, to shift traffic for practice runs. Practice runs help you to ensure that shifting away traffic from an Availability Zone during an autoshift is safe for your application.</p>
27/// <p>For more information, see <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-autoshift.considerations.html"> Considerations when you configure zonal autoshift</a> in the Amazon Application Recovery Controller Developer Guide.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreatePracticeRunConfigurationFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::create_practice_run_configuration::builders::CreatePracticeRunConfigurationInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::create_practice_run_configuration::CreatePracticeRunConfigurationOutput,
37 crate::operation::create_practice_run_configuration::CreatePracticeRunConfigurationError,
38 > for CreatePracticeRunConfigurationFluentBuilder
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_practice_run_configuration::CreatePracticeRunConfigurationOutput,
46 crate::operation::create_practice_run_configuration::CreatePracticeRunConfigurationError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl CreatePracticeRunConfigurationFluentBuilder {
53 /// Creates a new `CreatePracticeRunConfigurationFluentBuilder`.
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 CreatePracticeRunConfiguration as a reference.
62 pub fn as_input(&self) -> &crate::operation::create_practice_run_configuration::builders::CreatePracticeRunConfigurationInputBuilder {
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_practice_run_configuration::CreatePracticeRunConfigurationOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::create_practice_run_configuration::CreatePracticeRunConfigurationError,
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_practice_run_configuration::CreatePracticeRunConfiguration::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::create_practice_run_configuration::CreatePracticeRunConfiguration::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_practice_run_configuration::CreatePracticeRunConfigurationOutput,
99 crate::operation::create_practice_run_configuration::CreatePracticeRunConfigurationError,
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 identifier of the resource that Amazon Web Services shifts traffic for with a practice run zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource.</p>
114 /// <p>Amazon Application Recovery Controller currently supports enabling the following resources for zonal shift and zonal autoshift:</p>
115 /// <ul>
116 /// <li>
117 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.ec2-auto-scaling-groups.html">Amazon EC2 Auto Scaling groups</a></p></li>
118 /// <li>
119 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.eks.html">Amazon Elastic Kubernetes Service</a></p></li>
120 /// <li>
121 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.app-load-balancers.html">Application Load Balancer</a></p></li>
122 /// <li>
123 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.network-load-balancers.html">Network Load Balancer</a></p></li>
124 /// </ul>
125 pub fn resource_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126 self.inner = self.inner.resource_identifier(input.into());
127 self
128 }
129 /// <p>The identifier of the resource that Amazon Web Services shifts traffic for with a practice run zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource.</p>
130 /// <p>Amazon Application Recovery Controller currently supports enabling the following resources for zonal shift and zonal autoshift:</p>
131 /// <ul>
132 /// <li>
133 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.ec2-auto-scaling-groups.html">Amazon EC2 Auto Scaling groups</a></p></li>
134 /// <li>
135 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.eks.html">Amazon Elastic Kubernetes Service</a></p></li>
136 /// <li>
137 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.app-load-balancers.html">Application Load Balancer</a></p></li>
138 /// <li>
139 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.network-load-balancers.html">Network Load Balancer</a></p></li>
140 /// </ul>
141 pub fn set_resource_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.inner = self.inner.set_resource_identifier(input);
143 self
144 }
145 /// <p>The identifier of the resource that Amazon Web Services shifts traffic for with a practice run zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource.</p>
146 /// <p>Amazon Application Recovery Controller currently supports enabling the following resources for zonal shift and zonal autoshift:</p>
147 /// <ul>
148 /// <li>
149 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.ec2-auto-scaling-groups.html">Amazon EC2 Auto Scaling groups</a></p></li>
150 /// <li>
151 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.eks.html">Amazon Elastic Kubernetes Service</a></p></li>
152 /// <li>
153 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.app-load-balancers.html">Application Load Balancer</a></p></li>
154 /// <li>
155 /// <p><a href="https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.resource-types.network-load-balancers.html">Network Load Balancer</a></p></li>
156 /// </ul>
157 pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::string::String> {
158 self.inner.get_resource_identifier()
159 }
160 ///
161 /// Appends an item to `blockedWindows`.
162 ///
163 /// To override the contents of this collection use [`set_blocked_windows`](Self::set_blocked_windows).
164 ///
165 /// <p>Optionally, you can block ARC from starting practice runs for specific windows of days and times.</p>
166 /// <p>The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces.</p>
167 /// <p>For example, say you run business report summaries three days a week. For this scenario, you could set the following recurring days and times as blocked windows, for example: <code>Mon:00:00-Mon:10:00 Wed-20:30-Wed:21:30 Fri-20:30-Fri:21:30</code>.</p><important>
168 /// <p>The <code>blockedWindows</code> have to start and end on the same day. Windows that span multiple days aren't supported.</p>
169 /// </important>
170 pub fn blocked_windows(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171 self.inner = self.inner.blocked_windows(input.into());
172 self
173 }
174 /// <p>Optionally, you can block ARC from starting practice runs for specific windows of days and times.</p>
175 /// <p>The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces.</p>
176 /// <p>For example, say you run business report summaries three days a week. For this scenario, you could set the following recurring days and times as blocked windows, for example: <code>Mon:00:00-Mon:10:00 Wed-20:30-Wed:21:30 Fri-20:30-Fri:21:30</code>.</p><important>
177 /// <p>The <code>blockedWindows</code> have to start and end on the same day. Windows that span multiple days aren't supported.</p>
178 /// </important>
179 pub fn set_blocked_windows(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
180 self.inner = self.inner.set_blocked_windows(input);
181 self
182 }
183 /// <p>Optionally, you can block ARC from starting practice runs for specific windows of days and times.</p>
184 /// <p>The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces.</p>
185 /// <p>For example, say you run business report summaries three days a week. For this scenario, you could set the following recurring days and times as blocked windows, for example: <code>Mon:00:00-Mon:10:00 Wed-20:30-Wed:21:30 Fri-20:30-Fri:21:30</code>.</p><important>
186 /// <p>The <code>blockedWindows</code> have to start and end on the same day. Windows that span multiple days aren't supported.</p>
187 /// </important>
188 pub fn get_blocked_windows(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
189 self.inner.get_blocked_windows()
190 }
191 ///
192 /// Appends an item to `blockedDates`.
193 ///
194 /// To override the contents of this collection use [`set_blocked_dates`](Self::set_blocked_dates).
195 ///
196 /// <p>Optionally, you can block ARC from starting practice runs for a resource on specific calendar dates.</p>
197 /// <p>The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces.</p>
198 /// <p>For example, if you have an application update scheduled to launch on May 1, 2024, and you don't want practice runs to shift traffic away at that time, you could set a blocked date for <code>2024-05-01</code>.</p>
199 pub fn blocked_dates(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200 self.inner = self.inner.blocked_dates(input.into());
201 self
202 }
203 /// <p>Optionally, you can block ARC from starting practice runs for a resource on specific calendar dates.</p>
204 /// <p>The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces.</p>
205 /// <p>For example, if you have an application update scheduled to launch on May 1, 2024, and you don't want practice runs to shift traffic away at that time, you could set a blocked date for <code>2024-05-01</code>.</p>
206 pub fn set_blocked_dates(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
207 self.inner = self.inner.set_blocked_dates(input);
208 self
209 }
210 /// <p>Optionally, you can block ARC from starting practice runs for a resource on specific calendar dates.</p>
211 /// <p>The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces.</p>
212 /// <p>For example, if you have an application update scheduled to launch on May 1, 2024, and you don't want practice runs to shift traffic away at that time, you could set a blocked date for <code>2024-05-01</code>.</p>
213 pub fn get_blocked_dates(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
214 self.inner.get_blocked_dates()
215 }
216 ///
217 /// Appends an item to `blockingAlarms`.
218 ///
219 /// To override the contents of this collection use [`set_blocking_alarms`](Self::set_blocking_alarms).
220 ///
221 /// <p><i>Blocking alarms</i> for practice runs are optional alarms that you can specify that block practice runs when one or more of the alarms is in an <code>ALARM</code> state.</p>
222 pub fn blocking_alarms(mut self, input: crate::types::ControlCondition) -> Self {
223 self.inner = self.inner.blocking_alarms(input);
224 self
225 }
226 /// <p><i>Blocking alarms</i> for practice runs are optional alarms that you can specify that block practice runs when one or more of the alarms is in an <code>ALARM</code> state.</p>
227 pub fn set_blocking_alarms(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ControlCondition>>) -> Self {
228 self.inner = self.inner.set_blocking_alarms(input);
229 self
230 }
231 /// <p><i>Blocking alarms</i> for practice runs are optional alarms that you can specify that block practice runs when one or more of the alarms is in an <code>ALARM</code> state.</p>
232 pub fn get_blocking_alarms(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ControlCondition>> {
233 self.inner.get_blocking_alarms()
234 }
235 ///
236 /// Appends an item to `allowedWindows`.
237 ///
238 /// To override the contents of this collection use [`set_allowed_windows`](Self::set_allowed_windows).
239 ///
240 /// <p>Optionally, you can allow ARC to start practice runs for specific windows of days and times.</p>
241 /// <p>The format for allowed windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple allowed windows with spaces.</p>
242 /// <p>For example, say you want to allow practice runs only on Wednesdays and Fridays from noon to 5 p.m. For this scenario, you could set the following recurring days and times as allowed windows, for example: <code>Wed-12:00-Wed:17:00 Fri-12:00-Fri:17:00</code>.</p><important>
243 /// <p>The <code>allowedWindows</code> have to start and end on the same day. Windows that span multiple days aren't supported.</p>
244 /// </important>
245 pub fn allowed_windows(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
246 self.inner = self.inner.allowed_windows(input.into());
247 self
248 }
249 /// <p>Optionally, you can allow ARC to start practice runs for specific windows of days and times.</p>
250 /// <p>The format for allowed windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple allowed windows with spaces.</p>
251 /// <p>For example, say you want to allow practice runs only on Wednesdays and Fridays from noon to 5 p.m. For this scenario, you could set the following recurring days and times as allowed windows, for example: <code>Wed-12:00-Wed:17:00 Fri-12:00-Fri:17:00</code>.</p><important>
252 /// <p>The <code>allowedWindows</code> have to start and end on the same day. Windows that span multiple days aren't supported.</p>
253 /// </important>
254 pub fn set_allowed_windows(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
255 self.inner = self.inner.set_allowed_windows(input);
256 self
257 }
258 /// <p>Optionally, you can allow ARC to start practice runs for specific windows of days and times.</p>
259 /// <p>The format for allowed windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple allowed windows with spaces.</p>
260 /// <p>For example, say you want to allow practice runs only on Wednesdays and Fridays from noon to 5 p.m. For this scenario, you could set the following recurring days and times as allowed windows, for example: <code>Wed-12:00-Wed:17:00 Fri-12:00-Fri:17:00</code>.</p><important>
261 /// <p>The <code>allowedWindows</code> have to start and end on the same day. Windows that span multiple days aren't supported.</p>
262 /// </important>
263 pub fn get_allowed_windows(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
264 self.inner.get_allowed_windows()
265 }
266 ///
267 /// Appends an item to `outcomeAlarms`.
268 ///
269 /// To override the contents of this collection use [`set_outcome_alarms`](Self::set_outcome_alarms).
270 ///
271 /// <p><i>Outcome alarms</i> for practice runs are alarms that you specify that end a practice run when one or more of the alarms is in an <code>ALARM</code> state.</p>
272 /// <p>Configure one or more of these alarms to monitor the health of your application when traffic is shifted away from an Availability Zone during each practice run. You should configure these alarms to go into an <code>ALARM</code> state if you want to stop a zonal shift, to let traffic for the resource return to the original Availability Zone.</p>
273 pub fn outcome_alarms(mut self, input: crate::types::ControlCondition) -> Self {
274 self.inner = self.inner.outcome_alarms(input);
275 self
276 }
277 /// <p><i>Outcome alarms</i> for practice runs are alarms that you specify that end a practice run when one or more of the alarms is in an <code>ALARM</code> state.</p>
278 /// <p>Configure one or more of these alarms to monitor the health of your application when traffic is shifted away from an Availability Zone during each practice run. You should configure these alarms to go into an <code>ALARM</code> state if you want to stop a zonal shift, to let traffic for the resource return to the original Availability Zone.</p>
279 pub fn set_outcome_alarms(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ControlCondition>>) -> Self {
280 self.inner = self.inner.set_outcome_alarms(input);
281 self
282 }
283 /// <p><i>Outcome alarms</i> for practice runs are alarms that you specify that end a practice run when one or more of the alarms is in an <code>ALARM</code> state.</p>
284 /// <p>Configure one or more of these alarms to monitor the health of your application when traffic is shifted away from an Availability Zone during each practice run. You should configure these alarms to go into an <code>ALARM</code> state if you want to stop a zonal shift, to let traffic for the resource return to the original Availability Zone.</p>
285 pub fn get_outcome_alarms(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ControlCondition>> {
286 self.inner.get_outcome_alarms()
287 }
288}