aws_sdk_cloudformation/operation/create_stack_instances/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_stack_instances::_create_stack_instances_output::CreateStackInstancesOutputBuilder;
3
4pub use crate::operation::create_stack_instances::_create_stack_instances_input::CreateStackInstancesInputBuilder;
5
6impl crate::operation::create_stack_instances::builders::CreateStackInstancesInputBuilder {
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_stack_instances::CreateStackInstancesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_stack_instances::CreateStackInstancesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_stack_instances();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateStackInstances`.
24///
25/// <p>Creates stack instances for the specified accounts, within the specified Amazon Web Services Regions. A stack instance refers to a stack in a specific account and Region. You must specify at least one value for either <code>Accounts</code> or <code>DeploymentTargets</code>, and you must specify at least one value for <code>Regions</code>.</p><note>
26/// <p>The maximum number of organizational unit (OUs) supported by a <code>CreateStackInstances</code> operation is 50.</p>
27/// <p>If you need more than 50, consider the following options:</p>
28/// <ul>
29/// <li>
30/// <p><i>Batch processing:</i> If you don't want to expose your OU hierarchy, split up the operations into multiple calls with less than 50 OUs each.</p></li>
31/// <li>
32/// <p><i>Parent OU strategy:</i> If you don't mind exposing the OU hierarchy, target a parent OU that contains all desired child OUs.</p></li>
33/// </ul>
34/// </note>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct CreateStackInstancesFluentBuilder {
37 handle: ::std::sync::Arc<crate::client::Handle>,
38 inner: crate::operation::create_stack_instances::builders::CreateStackInstancesInputBuilder,
39 config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42 crate::client::customize::internal::CustomizableSend<
43 crate::operation::create_stack_instances::CreateStackInstancesOutput,
44 crate::operation::create_stack_instances::CreateStackInstancesError,
45 > for CreateStackInstancesFluentBuilder
46{
47 fn send(
48 self,
49 config_override: crate::config::Builder,
50 ) -> crate::client::customize::internal::BoxFuture<
51 crate::client::customize::internal::SendResult<
52 crate::operation::create_stack_instances::CreateStackInstancesOutput,
53 crate::operation::create_stack_instances::CreateStackInstancesError,
54 >,
55 > {
56 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57 }
58}
59impl CreateStackInstancesFluentBuilder {
60 /// Creates a new `CreateStackInstancesFluentBuilder`.
61 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62 Self {
63 handle,
64 inner: ::std::default::Default::default(),
65 config_override: ::std::option::Option::None,
66 }
67 }
68 /// Access the CreateStackInstances as a reference.
69 pub fn as_input(&self) -> &crate::operation::create_stack_instances::builders::CreateStackInstancesInputBuilder {
70 &self.inner
71 }
72 /// Sends the request and returns the response.
73 ///
74 /// If an error occurs, an `SdkError` will be returned with additional details that
75 /// can be matched against.
76 ///
77 /// By default, any retryable failures will be retried twice. Retry behavior
78 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79 /// set when configuring the client.
80 pub async fn send(
81 self,
82 ) -> ::std::result::Result<
83 crate::operation::create_stack_instances::CreateStackInstancesOutput,
84 ::aws_smithy_runtime_api::client::result::SdkError<
85 crate::operation::create_stack_instances::CreateStackInstancesError,
86 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87 >,
88 > {
89 let input = self
90 .inner
91 .build()
92 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93 let runtime_plugins = crate::operation::create_stack_instances::CreateStackInstances::operation_runtime_plugins(
94 self.handle.runtime_plugins.clone(),
95 &self.handle.conf,
96 self.config_override,
97 );
98 crate::operation::create_stack_instances::CreateStackInstances::orchestrate(&runtime_plugins, input).await
99 }
100
101 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102 pub fn customize(
103 self,
104 ) -> crate::client::customize::CustomizableOperation<
105 crate::operation::create_stack_instances::CreateStackInstancesOutput,
106 crate::operation::create_stack_instances::CreateStackInstancesError,
107 Self,
108 > {
109 crate::client::customize::CustomizableOperation::new(self)
110 }
111 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112 self.set_config_override(::std::option::Option::Some(config_override.into()));
113 self
114 }
115
116 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117 self.config_override = config_override;
118 self
119 }
120 /// <p>The name or unique ID of the StackSet that you want to create stack instances from.</p>
121 pub fn stack_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.stack_set_name(input.into());
123 self
124 }
125 /// <p>The name or unique ID of the StackSet that you want to create stack instances from.</p>
126 pub fn set_stack_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.inner = self.inner.set_stack_set_name(input);
128 self
129 }
130 /// <p>The name or unique ID of the StackSet that you want to create stack instances from.</p>
131 pub fn get_stack_set_name(&self) -> &::std::option::Option<::std::string::String> {
132 self.inner.get_stack_set_name()
133 }
134 ///
135 /// Appends an item to `Accounts`.
136 ///
137 /// To override the contents of this collection use [`set_accounts`](Self::set_accounts).
138 ///
139 /// <p>\[Self-managed permissions\] The account IDs of one or more Amazon Web Services accounts that you want to create stack instances in the specified Region(s) for.</p>
140 /// <p>You can specify <code>Accounts</code> or <code>DeploymentTargets</code>, but not both.</p>
141 pub fn accounts(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.inner = self.inner.accounts(input.into());
143 self
144 }
145 /// <p>\[Self-managed permissions\] The account IDs of one or more Amazon Web Services accounts that you want to create stack instances in the specified Region(s) for.</p>
146 /// <p>You can specify <code>Accounts</code> or <code>DeploymentTargets</code>, but not both.</p>
147 pub fn set_accounts(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
148 self.inner = self.inner.set_accounts(input);
149 self
150 }
151 /// <p>\[Self-managed permissions\] The account IDs of one or more Amazon Web Services accounts that you want to create stack instances in the specified Region(s) for.</p>
152 /// <p>You can specify <code>Accounts</code> or <code>DeploymentTargets</code>, but not both.</p>
153 pub fn get_accounts(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
154 self.inner.get_accounts()
155 }
156 /// <p>\[Service-managed permissions\] The Organizations accounts in which to create stack instances in the specified Amazon Web Services Regions.</p>
157 /// <p>You can specify <code>Accounts</code> or <code>DeploymentTargets</code>, but not both.</p>
158 pub fn deployment_targets(mut self, input: crate::types::DeploymentTargets) -> Self {
159 self.inner = self.inner.deployment_targets(input);
160 self
161 }
162 /// <p>\[Service-managed permissions\] The Organizations accounts in which to create stack instances in the specified Amazon Web Services Regions.</p>
163 /// <p>You can specify <code>Accounts</code> or <code>DeploymentTargets</code>, but not both.</p>
164 pub fn set_deployment_targets(mut self, input: ::std::option::Option<crate::types::DeploymentTargets>) -> Self {
165 self.inner = self.inner.set_deployment_targets(input);
166 self
167 }
168 /// <p>\[Service-managed permissions\] The Organizations accounts in which to create stack instances in the specified Amazon Web Services Regions.</p>
169 /// <p>You can specify <code>Accounts</code> or <code>DeploymentTargets</code>, but not both.</p>
170 pub fn get_deployment_targets(&self) -> &::std::option::Option<crate::types::DeploymentTargets> {
171 self.inner.get_deployment_targets()
172 }
173 ///
174 /// Appends an item to `Regions`.
175 ///
176 /// To override the contents of this collection use [`set_regions`](Self::set_regions).
177 ///
178 /// <p>The names of one or more Amazon Web Services Regions where you want to create stack instances using the specified Amazon Web Services accounts.</p>
179 pub fn regions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180 self.inner = self.inner.regions(input.into());
181 self
182 }
183 /// <p>The names of one or more Amazon Web Services Regions where you want to create stack instances using the specified Amazon Web Services accounts.</p>
184 pub fn set_regions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
185 self.inner = self.inner.set_regions(input);
186 self
187 }
188 /// <p>The names of one or more Amazon Web Services Regions where you want to create stack instances using the specified Amazon Web Services accounts.</p>
189 pub fn get_regions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
190 self.inner.get_regions()
191 }
192 ///
193 /// Appends an item to `ParameterOverrides`.
194 ///
195 /// To override the contents of this collection use [`set_parameter_overrides`](Self::set_parameter_overrides).
196 ///
197 /// <p>A list of StackSet parameters whose values you want to override in the selected stack instances.</p>
198 /// <p>Any overridden parameter values will be applied to all stack instances in the specified accounts and Amazon Web Services Regions. When specifying parameters and their values, be aware of how CloudFormation sets parameter values during stack instance operations:</p>
199 /// <ul>
200 /// <li>
201 /// <p>To override the current value for a parameter, include the parameter and specify its value.</p></li>
202 /// <li>
203 /// <p>To leave an overridden parameter set to its present value, include the parameter and specify <code>UsePreviousValue</code> as <code>true</code>. (You can't specify both a value and set <code>UsePreviousValue</code> to <code>true</code>.)</p></li>
204 /// <li>
205 /// <p>To set an overridden parameter back to the value specified in the StackSet, specify a parameter list but don't include the parameter in the list.</p></li>
206 /// <li>
207 /// <p>To leave all parameters set to their present values, don't specify this property at all.</p></li>
208 /// </ul>
209 /// <p>During StackSet updates, any parameter values overridden for a stack instance aren't updated, but retain their overridden value.</p>
210 /// <p>You can only override the parameter <i>values</i> that are specified in the StackSet; to add or delete a parameter itself, use <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html">UpdateStackSet</a> to update the StackSet template.</p>
211 pub fn parameter_overrides(mut self, input: crate::types::Parameter) -> Self {
212 self.inner = self.inner.parameter_overrides(input);
213 self
214 }
215 /// <p>A list of StackSet parameters whose values you want to override in the selected stack instances.</p>
216 /// <p>Any overridden parameter values will be applied to all stack instances in the specified accounts and Amazon Web Services Regions. When specifying parameters and their values, be aware of how CloudFormation sets parameter values during stack instance operations:</p>
217 /// <ul>
218 /// <li>
219 /// <p>To override the current value for a parameter, include the parameter and specify its value.</p></li>
220 /// <li>
221 /// <p>To leave an overridden parameter set to its present value, include the parameter and specify <code>UsePreviousValue</code> as <code>true</code>. (You can't specify both a value and set <code>UsePreviousValue</code> to <code>true</code>.)</p></li>
222 /// <li>
223 /// <p>To set an overridden parameter back to the value specified in the StackSet, specify a parameter list but don't include the parameter in the list.</p></li>
224 /// <li>
225 /// <p>To leave all parameters set to their present values, don't specify this property at all.</p></li>
226 /// </ul>
227 /// <p>During StackSet updates, any parameter values overridden for a stack instance aren't updated, but retain their overridden value.</p>
228 /// <p>You can only override the parameter <i>values</i> that are specified in the StackSet; to add or delete a parameter itself, use <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html">UpdateStackSet</a> to update the StackSet template.</p>
229 pub fn set_parameter_overrides(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Parameter>>) -> Self {
230 self.inner = self.inner.set_parameter_overrides(input);
231 self
232 }
233 /// <p>A list of StackSet parameters whose values you want to override in the selected stack instances.</p>
234 /// <p>Any overridden parameter values will be applied to all stack instances in the specified accounts and Amazon Web Services Regions. When specifying parameters and their values, be aware of how CloudFormation sets parameter values during stack instance operations:</p>
235 /// <ul>
236 /// <li>
237 /// <p>To override the current value for a parameter, include the parameter and specify its value.</p></li>
238 /// <li>
239 /// <p>To leave an overridden parameter set to its present value, include the parameter and specify <code>UsePreviousValue</code> as <code>true</code>. (You can't specify both a value and set <code>UsePreviousValue</code> to <code>true</code>.)</p></li>
240 /// <li>
241 /// <p>To set an overridden parameter back to the value specified in the StackSet, specify a parameter list but don't include the parameter in the list.</p></li>
242 /// <li>
243 /// <p>To leave all parameters set to their present values, don't specify this property at all.</p></li>
244 /// </ul>
245 /// <p>During StackSet updates, any parameter values overridden for a stack instance aren't updated, but retain their overridden value.</p>
246 /// <p>You can only override the parameter <i>values</i> that are specified in the StackSet; to add or delete a parameter itself, use <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html">UpdateStackSet</a> to update the StackSet template.</p>
247 pub fn get_parameter_overrides(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Parameter>> {
248 self.inner.get_parameter_overrides()
249 }
250 /// <p>Preferences for how CloudFormation performs this StackSet operation.</p>
251 pub fn operation_preferences(mut self, input: crate::types::StackSetOperationPreferences) -> Self {
252 self.inner = self.inner.operation_preferences(input);
253 self
254 }
255 /// <p>Preferences for how CloudFormation performs this StackSet operation.</p>
256 pub fn set_operation_preferences(mut self, input: ::std::option::Option<crate::types::StackSetOperationPreferences>) -> Self {
257 self.inner = self.inner.set_operation_preferences(input);
258 self
259 }
260 /// <p>Preferences for how CloudFormation performs this StackSet operation.</p>
261 pub fn get_operation_preferences(&self) -> &::std::option::Option<crate::types::StackSetOperationPreferences> {
262 self.inner.get_operation_preferences()
263 }
264 /// <p>The unique identifier for this StackSet operation.</p>
265 /// <p>The operation ID also functions as an idempotency token, to ensure that CloudFormation performs the StackSet operation only once, even if you retry the request multiple times. You might retry StackSet operation requests to ensure that CloudFormation successfully received them.</p>
266 /// <p>If you don't specify an operation ID, the SDK generates one automatically.</p>
267 /// <p>Repeating this StackSet operation with a new operation ID retries all stack instances whose status is <code>OUTDATED</code>.</p>
268 pub fn operation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269 self.inner = self.inner.operation_id(input.into());
270 self
271 }
272 /// <p>The unique identifier for this StackSet operation.</p>
273 /// <p>The operation ID also functions as an idempotency token, to ensure that CloudFormation performs the StackSet operation only once, even if you retry the request multiple times. You might retry StackSet operation requests to ensure that CloudFormation successfully received them.</p>
274 /// <p>If you don't specify an operation ID, the SDK generates one automatically.</p>
275 /// <p>Repeating this StackSet operation with a new operation ID retries all stack instances whose status is <code>OUTDATED</code>.</p>
276 pub fn set_operation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
277 self.inner = self.inner.set_operation_id(input);
278 self
279 }
280 /// <p>The unique identifier for this StackSet operation.</p>
281 /// <p>The operation ID also functions as an idempotency token, to ensure that CloudFormation performs the StackSet operation only once, even if you retry the request multiple times. You might retry StackSet operation requests to ensure that CloudFormation successfully received them.</p>
282 /// <p>If you don't specify an operation ID, the SDK generates one automatically.</p>
283 /// <p>Repeating this StackSet operation with a new operation ID retries all stack instances whose status is <code>OUTDATED</code>.</p>
284 pub fn get_operation_id(&self) -> &::std::option::Option<::std::string::String> {
285 self.inner.get_operation_id()
286 }
287 /// <p>\[Service-managed permissions\] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.</p>
288 /// <p>By default, <code>SELF</code> is specified. Use <code>SELF</code> for StackSets with self-managed permissions.</p>
289 /// <ul>
290 /// <li>
291 /// <p>If you are signed in to the management account, specify <code>SELF</code>.</p></li>
292 /// <li>
293 /// <p>If you are signed in to a delegated administrator account, specify <code>DELEGATED_ADMIN</code>.</p>
294 /// <p>Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html">Register a delegated administrator</a> in the <i>CloudFormation User Guide</i>.</p></li>
295 /// </ul>
296 pub fn call_as(mut self, input: crate::types::CallAs) -> Self {
297 self.inner = self.inner.call_as(input);
298 self
299 }
300 /// <p>\[Service-managed permissions\] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.</p>
301 /// <p>By default, <code>SELF</code> is specified. Use <code>SELF</code> for StackSets with self-managed permissions.</p>
302 /// <ul>
303 /// <li>
304 /// <p>If you are signed in to the management account, specify <code>SELF</code>.</p></li>
305 /// <li>
306 /// <p>If you are signed in to a delegated administrator account, specify <code>DELEGATED_ADMIN</code>.</p>
307 /// <p>Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html">Register a delegated administrator</a> in the <i>CloudFormation User Guide</i>.</p></li>
308 /// </ul>
309 pub fn set_call_as(mut self, input: ::std::option::Option<crate::types::CallAs>) -> Self {
310 self.inner = self.inner.set_call_as(input);
311 self
312 }
313 /// <p>\[Service-managed permissions\] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.</p>
314 /// <p>By default, <code>SELF</code> is specified. Use <code>SELF</code> for StackSets with self-managed permissions.</p>
315 /// <ul>
316 /// <li>
317 /// <p>If you are signed in to the management account, specify <code>SELF</code>.</p></li>
318 /// <li>
319 /// <p>If you are signed in to a delegated administrator account, specify <code>DELEGATED_ADMIN</code>.</p>
320 /// <p>Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html">Register a delegated administrator</a> in the <i>CloudFormation User Guide</i>.</p></li>
321 /// </ul>
322 pub fn get_call_as(&self) -> &::std::option::Option<crate::types::CallAs> {
323 self.inner.get_call_as()
324 }
325}