aws_sdk_ssm/operation/create_association/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_association::_create_association_output::CreateAssociationOutputBuilder;
3
4pub use crate::operation::create_association::_create_association_input::CreateAssociationInputBuilder;
5
6impl crate::operation::create_association::builders::CreateAssociationInputBuilder {
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_association::CreateAssociationOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_association::CreateAssociationError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_association();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateAssociation`.
24///
25/// <p>A State Manager association defines the state that you want to maintain on your managed nodes. For example, an association can specify that anti-virus software must be installed and running on your managed nodes, or that certain ports must be closed. For static targets, the association specifies a schedule for when the configuration is reapplied. For dynamic targets, such as an Amazon Web Services resource group or an Amazon Web Services autoscaling group, State Manager, a tool in Amazon Web Services Systems Manager applies the configuration when new managed nodes are added to the group. The association also specifies actions to take when applying the configuration. For example, an association for anti-virus software might run once a day. If the software isn't installed, then State Manager installs it. If the software is installed, but the service isn't running, then the association might instruct State Manager to start the service.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateAssociationFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_association::builders::CreateAssociationInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_association::CreateAssociationOutput,
35 crate::operation::create_association::CreateAssociationError,
36 > for CreateAssociationFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::create_association::CreateAssociationOutput,
44 crate::operation::create_association::CreateAssociationError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateAssociationFluentBuilder {
51 /// Creates a new `CreateAssociationFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the CreateAssociation as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_association::builders::CreateAssociationInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::create_association::CreateAssociationOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_association::CreateAssociationError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::create_association::CreateAssociation::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_association::CreateAssociation::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::create_association::CreateAssociationOutput,
97 crate::operation::create_association::CreateAssociationError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.</p>
112 /// <p>You can specify Amazon Web Services-predefined documents, documents you created, or a document that is shared with you from another Amazon Web Services account.</p>
113 /// <p>For Systems Manager documents (SSM documents) that are shared with you from other Amazon Web Services accounts, you must specify the complete SSM document ARN, in the following format:</p>
114 /// <p><code>arn:<i>partition</i>:ssm:<i>region</i>:<i>account-id</i>:document/<i>document-name</i> </code></p>
115 /// <p>For example:</p>
116 /// <p><code>arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document</code></p>
117 /// <p>For Amazon Web Services-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, <code>AWS-ApplyPatchBaseline</code> or <code>My-Document</code>.</p>
118 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.inner = self.inner.name(input.into());
120 self
121 }
122 /// <p>The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.</p>
123 /// <p>You can specify Amazon Web Services-predefined documents, documents you created, or a document that is shared with you from another Amazon Web Services account.</p>
124 /// <p>For Systems Manager documents (SSM documents) that are shared with you from other Amazon Web Services accounts, you must specify the complete SSM document ARN, in the following format:</p>
125 /// <p><code>arn:<i>partition</i>:ssm:<i>region</i>:<i>account-id</i>:document/<i>document-name</i> </code></p>
126 /// <p>For example:</p>
127 /// <p><code>arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document</code></p>
128 /// <p>For Amazon Web Services-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, <code>AWS-ApplyPatchBaseline</code> or <code>My-Document</code>.</p>
129 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130 self.inner = self.inner.set_name(input);
131 self
132 }
133 /// <p>The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.</p>
134 /// <p>You can specify Amazon Web Services-predefined documents, documents you created, or a document that is shared with you from another Amazon Web Services account.</p>
135 /// <p>For Systems Manager documents (SSM documents) that are shared with you from other Amazon Web Services accounts, you must specify the complete SSM document ARN, in the following format:</p>
136 /// <p><code>arn:<i>partition</i>:ssm:<i>region</i>:<i>account-id</i>:document/<i>document-name</i> </code></p>
137 /// <p>For example:</p>
138 /// <p><code>arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document</code></p>
139 /// <p>For Amazon Web Services-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, <code>AWS-ApplyPatchBaseline</code> or <code>My-Document</code>.</p>
140 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
141 self.inner.get_name()
142 }
143 /// <p>The document version you want to associate with the targets. Can be a specific version or the default version.</p><important>
144 /// <p>State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the <code>default</code> version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to <code>default</code>.</p>
145 /// </important>
146 pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.inner = self.inner.document_version(input.into());
148 self
149 }
150 /// <p>The document version you want to associate with the targets. Can be a specific version or the default version.</p><important>
151 /// <p>State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the <code>default</code> version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to <code>default</code>.</p>
152 /// </important>
153 pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.inner = self.inner.set_document_version(input);
155 self
156 }
157 /// <p>The document version you want to associate with the targets. Can be a specific version or the default version.</p><important>
158 /// <p>State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the <code>default</code> version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to <code>default</code>.</p>
159 /// </important>
160 pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
161 self.inner.get_document_version()
162 }
163 /// <p>The managed node ID.</p><note>
164 /// <p><code>InstanceId</code> has been deprecated. To specify a managed node ID for an association, use the <code>Targets</code> parameter. Requests that include the parameter <code>InstanceID</code> with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter <code>InstanceId</code>, you can't use the parameters <code>AssociationName</code>, <code>DocumentVersion</code>, <code>MaxErrors</code>, <code>MaxConcurrency</code>, <code>OutputLocation</code>, or <code>ScheduleExpression</code>. To use these parameters, you must use the <code>Targets</code> parameter.</p>
165 /// </note>
166 pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.inner = self.inner.instance_id(input.into());
168 self
169 }
170 /// <p>The managed node ID.</p><note>
171 /// <p><code>InstanceId</code> has been deprecated. To specify a managed node ID for an association, use the <code>Targets</code> parameter. Requests that include the parameter <code>InstanceID</code> with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter <code>InstanceId</code>, you can't use the parameters <code>AssociationName</code>, <code>DocumentVersion</code>, <code>MaxErrors</code>, <code>MaxConcurrency</code>, <code>OutputLocation</code>, or <code>ScheduleExpression</code>. To use these parameters, you must use the <code>Targets</code> parameter.</p>
172 /// </note>
173 pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.inner = self.inner.set_instance_id(input);
175 self
176 }
177 /// <p>The managed node ID.</p><note>
178 /// <p><code>InstanceId</code> has been deprecated. To specify a managed node ID for an association, use the <code>Targets</code> parameter. Requests that include the parameter <code>InstanceID</code> with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter <code>InstanceId</code>, you can't use the parameters <code>AssociationName</code>, <code>DocumentVersion</code>, <code>MaxErrors</code>, <code>MaxConcurrency</code>, <code>OutputLocation</code>, or <code>ScheduleExpression</code>. To use these parameters, you must use the <code>Targets</code> parameter.</p>
179 /// </note>
180 pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
181 self.inner.get_instance_id()
182 }
183 ///
184 /// Adds a key-value pair to `Parameters`.
185 ///
186 /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
187 ///
188 /// <p>The parameters for the runtime configuration of the document.</p>
189 pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
190 self.inner = self.inner.parameters(k.into(), v);
191 self
192 }
193 /// <p>The parameters for the runtime configuration of the document.</p>
194 pub fn set_parameters(
195 mut self,
196 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
197 ) -> Self {
198 self.inner = self.inner.set_parameters(input);
199 self
200 }
201 /// <p>The parameters for the runtime configuration of the document.</p>
202 pub fn get_parameters(
203 &self,
204 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
205 self.inner.get_parameters()
206 }
207 ///
208 /// Appends an item to `Targets`.
209 ///
210 /// To override the contents of this collection use [`set_targets`](Self::set_targets).
211 ///
212 /// <p>The targets for the association. You can target managed nodes by using tags, Amazon Web Services resource groups, all managed nodes in an Amazon Web Services account, or individual managed node IDs. You can target all managed nodes in an Amazon Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</code>. For more information about choosing targets for an association, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-state-manager-targets-and-rate-controls.html">Understanding targets and rate controls in State Manager associations</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
213 pub fn targets(mut self, input: crate::types::Target) -> Self {
214 self.inner = self.inner.targets(input);
215 self
216 }
217 /// <p>The targets for the association. You can target managed nodes by using tags, Amazon Web Services resource groups, all managed nodes in an Amazon Web Services account, or individual managed node IDs. You can target all managed nodes in an Amazon Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</code>. For more information about choosing targets for an association, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-state-manager-targets-and-rate-controls.html">Understanding targets and rate controls in State Manager associations</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
218 pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
219 self.inner = self.inner.set_targets(input);
220 self
221 }
222 /// <p>The targets for the association. You can target managed nodes by using tags, Amazon Web Services resource groups, all managed nodes in an Amazon Web Services account, or individual managed node IDs. You can target all managed nodes in an Amazon Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</code>. For more information about choosing targets for an association, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-state-manager-targets-and-rate-controls.html">Understanding targets and rate controls in State Manager associations</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
223 pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
224 self.inner.get_targets()
225 }
226 /// <p>A cron expression when the association will be applied to the targets.</p>
227 pub fn schedule_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228 self.inner = self.inner.schedule_expression(input.into());
229 self
230 }
231 /// <p>A cron expression when the association will be applied to the targets.</p>
232 pub fn set_schedule_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
233 self.inner = self.inner.set_schedule_expression(input);
234 self
235 }
236 /// <p>A cron expression when the association will be applied to the targets.</p>
237 pub fn get_schedule_expression(&self) -> &::std::option::Option<::std::string::String> {
238 self.inner.get_schedule_expression()
239 }
240 /// <p>An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.</p>
241 pub fn output_location(mut self, input: crate::types::InstanceAssociationOutputLocation) -> Self {
242 self.inner = self.inner.output_location(input);
243 self
244 }
245 /// <p>An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.</p>
246 pub fn set_output_location(mut self, input: ::std::option::Option<crate::types::InstanceAssociationOutputLocation>) -> Self {
247 self.inner = self.inner.set_output_location(input);
248 self
249 }
250 /// <p>An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.</p>
251 pub fn get_output_location(&self) -> &::std::option::Option<crate::types::InstanceAssociationOutputLocation> {
252 self.inner.get_output_location()
253 }
254 /// <p>Specify a descriptive name for the association.</p>
255 pub fn association_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
256 self.inner = self.inner.association_name(input.into());
257 self
258 }
259 /// <p>Specify a descriptive name for the association.</p>
260 pub fn set_association_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
261 self.inner = self.inner.set_association_name(input);
262 self
263 }
264 /// <p>Specify a descriptive name for the association.</p>
265 pub fn get_association_name(&self) -> &::std::option::Option<::std::string::String> {
266 self.inner.get_association_name()
267 }
268 /// <p>Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a tool in Amazon Web Services Systems Manager.</p>
269 pub fn automation_target_parameter_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
270 self.inner = self.inner.automation_target_parameter_name(input.into());
271 self
272 }
273 /// <p>Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a tool in Amazon Web Services Systems Manager.</p>
274 pub fn set_automation_target_parameter_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275 self.inner = self.inner.set_automation_target_parameter_name(input);
276 self
277 }
278 /// <p>Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a tool in Amazon Web Services Systems Manager.</p>
279 pub fn get_automation_target_parameter_name(&self) -> &::std::option::Option<::std::string::String> {
280 self.inner.get_automation_target_parameter_name()
281 }
282 /// <p>The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set <code>MaxError</code> to 10%, then the system stops sending the request when the sixth error is received.</p>
283 /// <p>Executions that are already running an association when <code>MaxErrors</code> is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set <code>MaxConcurrency</code> to 1 so that executions proceed one at a time.</p>
284 pub fn max_errors(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285 self.inner = self.inner.max_errors(input.into());
286 self
287 }
288 /// <p>The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set <code>MaxError</code> to 10%, then the system stops sending the request when the sixth error is received.</p>
289 /// <p>Executions that are already running an association when <code>MaxErrors</code> is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set <code>MaxConcurrency</code> to 1 so that executions proceed one at a time.</p>
290 pub fn set_max_errors(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291 self.inner = self.inner.set_max_errors(input);
292 self
293 }
294 /// <p>The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set <code>MaxError</code> to 10%, then the system stops sending the request when the sixth error is received.</p>
295 /// <p>Executions that are already running an association when <code>MaxErrors</code> is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set <code>MaxConcurrency</code> to 1 so that executions proceed one at a time.</p>
296 pub fn get_max_errors(&self) -> &::std::option::Option<::std::string::String> {
297 self.inner.get_max_errors()
298 }
299 /// <p>The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.</p>
300 /// <p>If a new managed node starts and attempts to run an association while Systems Manager is running <code>MaxConcurrency</code> associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for <code>MaxConcurrency</code>.</p>
301 pub fn max_concurrency(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
302 self.inner = self.inner.max_concurrency(input.into());
303 self
304 }
305 /// <p>The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.</p>
306 /// <p>If a new managed node starts and attempts to run an association while Systems Manager is running <code>MaxConcurrency</code> associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for <code>MaxConcurrency</code>.</p>
307 pub fn set_max_concurrency(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
308 self.inner = self.inner.set_max_concurrency(input);
309 self
310 }
311 /// <p>The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.</p>
312 /// <p>If a new managed node starts and attempts to run an association while Systems Manager is running <code>MaxConcurrency</code> associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for <code>MaxConcurrency</code>.</p>
313 pub fn get_max_concurrency(&self) -> &::std::option::Option<::std::string::String> {
314 self.inner.get_max_concurrency()
315 }
316 /// <p>The severity level to assign to the association.</p>
317 pub fn compliance_severity(mut self, input: crate::types::AssociationComplianceSeverity) -> Self {
318 self.inner = self.inner.compliance_severity(input);
319 self
320 }
321 /// <p>The severity level to assign to the association.</p>
322 pub fn set_compliance_severity(mut self, input: ::std::option::Option<crate::types::AssociationComplianceSeverity>) -> Self {
323 self.inner = self.inner.set_compliance_severity(input);
324 self
325 }
326 /// <p>The severity level to assign to the association.</p>
327 pub fn get_compliance_severity(&self) -> &::std::option::Option<crate::types::AssociationComplianceSeverity> {
328 self.inner.get_compliance_severity()
329 }
330 /// <p>The mode for generating association compliance. You can specify <code>AUTO</code> or <code>MANUAL</code>. In <code>AUTO</code> mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is <code>COMPLIANT</code>. If the association execution doesn't run successfully, the association is <code>NON-COMPLIANT</code>.</p>
331 /// <p>In <code>MANUAL</code> mode, you must specify the <code>AssociationId</code> as a parameter for the <code>PutComplianceItems</code> API operation. In this case, compliance data isn't managed by State Manager. It is managed by your direct call to the <code>PutComplianceItems</code> API operation.</p>
332 /// <p>By default, all associations use <code>AUTO</code> mode.</p>
333 pub fn sync_compliance(mut self, input: crate::types::AssociationSyncCompliance) -> Self {
334 self.inner = self.inner.sync_compliance(input);
335 self
336 }
337 /// <p>The mode for generating association compliance. You can specify <code>AUTO</code> or <code>MANUAL</code>. In <code>AUTO</code> mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is <code>COMPLIANT</code>. If the association execution doesn't run successfully, the association is <code>NON-COMPLIANT</code>.</p>
338 /// <p>In <code>MANUAL</code> mode, you must specify the <code>AssociationId</code> as a parameter for the <code>PutComplianceItems</code> API operation. In this case, compliance data isn't managed by State Manager. It is managed by your direct call to the <code>PutComplianceItems</code> API operation.</p>
339 /// <p>By default, all associations use <code>AUTO</code> mode.</p>
340 pub fn set_sync_compliance(mut self, input: ::std::option::Option<crate::types::AssociationSyncCompliance>) -> Self {
341 self.inner = self.inner.set_sync_compliance(input);
342 self
343 }
344 /// <p>The mode for generating association compliance. You can specify <code>AUTO</code> or <code>MANUAL</code>. In <code>AUTO</code> mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is <code>COMPLIANT</code>. If the association execution doesn't run successfully, the association is <code>NON-COMPLIANT</code>.</p>
345 /// <p>In <code>MANUAL</code> mode, you must specify the <code>AssociationId</code> as a parameter for the <code>PutComplianceItems</code> API operation. In this case, compliance data isn't managed by State Manager. It is managed by your direct call to the <code>PutComplianceItems</code> API operation.</p>
346 /// <p>By default, all associations use <code>AUTO</code> mode.</p>
347 pub fn get_sync_compliance(&self) -> &::std::option::Option<crate::types::AssociationSyncCompliance> {
348 self.inner.get_sync_compliance()
349 }
350 /// <p>By default, when you create a new association, the system runs it immediately after it is created and then according to the schedule you specified and when target changes are detected. Specify <code>true</code> for <code>ApplyOnlyAtCronInterval</code>if you want the association to run only according to the schedule you specified.</p>
351 /// <p>For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/state-manager-about.html#state-manager-about-scheduling">Understanding when associations are applied to resources</a> and <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/state-manager-about.html#runbook-target-updates">>About target updates with Automation runbooks</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
352 /// <p>This parameter isn't supported for rate expressions.</p>
353 pub fn apply_only_at_cron_interval(mut self, input: bool) -> Self {
354 self.inner = self.inner.apply_only_at_cron_interval(input);
355 self
356 }
357 /// <p>By default, when you create a new association, the system runs it immediately after it is created and then according to the schedule you specified and when target changes are detected. Specify <code>true</code> for <code>ApplyOnlyAtCronInterval</code>if you want the association to run only according to the schedule you specified.</p>
358 /// <p>For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/state-manager-about.html#state-manager-about-scheduling">Understanding when associations are applied to resources</a> and <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/state-manager-about.html#runbook-target-updates">>About target updates with Automation runbooks</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
359 /// <p>This parameter isn't supported for rate expressions.</p>
360 pub fn set_apply_only_at_cron_interval(mut self, input: ::std::option::Option<bool>) -> Self {
361 self.inner = self.inner.set_apply_only_at_cron_interval(input);
362 self
363 }
364 /// <p>By default, when you create a new association, the system runs it immediately after it is created and then according to the schedule you specified and when target changes are detected. Specify <code>true</code> for <code>ApplyOnlyAtCronInterval</code>if you want the association to run only according to the schedule you specified.</p>
365 /// <p>For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/state-manager-about.html#state-manager-about-scheduling">Understanding when associations are applied to resources</a> and <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/state-manager-about.html#runbook-target-updates">>About target updates with Automation runbooks</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
366 /// <p>This parameter isn't supported for rate expressions.</p>
367 pub fn get_apply_only_at_cron_interval(&self) -> &::std::option::Option<bool> {
368 self.inner.get_apply_only_at_cron_interval()
369 }
370 ///
371 /// Appends an item to `CalendarNames`.
372 ///
373 /// To override the contents of this collection use [`set_calendar_names`](Self::set_calendar_names).
374 ///
375 /// <p>The names of Amazon Resource Names (ARNs) of the Change Calendar type documents you want to gate your associations under. The associations only run when that change calendar is open. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar">Amazon Web Services Systems Manager Change Calendar</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
376 pub fn calendar_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
377 self.inner = self.inner.calendar_names(input.into());
378 self
379 }
380 /// <p>The names of Amazon Resource Names (ARNs) of the Change Calendar type documents you want to gate your associations under. The associations only run when that change calendar is open. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar">Amazon Web Services Systems Manager Change Calendar</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
381 pub fn set_calendar_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
382 self.inner = self.inner.set_calendar_names(input);
383 self
384 }
385 /// <p>The names of Amazon Resource Names (ARNs) of the Change Calendar type documents you want to gate your associations under. The associations only run when that change calendar is open. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar">Amazon Web Services Systems Manager Change Calendar</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
386 pub fn get_calendar_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
387 self.inner.get_calendar_names()
388 }
389 ///
390 /// Appends an item to `TargetLocations`.
391 ///
392 /// To override the contents of this collection use [`set_target_locations`](Self::set_target_locations).
393 ///
394 /// <p>A location is a combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association. Use this action to create an association in multiple Regions and multiple accounts.</p><note>
395 /// <p>The <code>IncludeChildOrganizationUnits</code> parameter is not supported by State Manager.</p>
396 /// </note>
397 pub fn target_locations(mut self, input: crate::types::TargetLocation) -> Self {
398 self.inner = self.inner.target_locations(input);
399 self
400 }
401 /// <p>A location is a combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association. Use this action to create an association in multiple Regions and multiple accounts.</p><note>
402 /// <p>The <code>IncludeChildOrganizationUnits</code> parameter is not supported by State Manager.</p>
403 /// </note>
404 pub fn set_target_locations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>>) -> Self {
405 self.inner = self.inner.set_target_locations(input);
406 self
407 }
408 /// <p>A location is a combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association. Use this action to create an association in multiple Regions and multiple accounts.</p><note>
409 /// <p>The <code>IncludeChildOrganizationUnits</code> parameter is not supported by State Manager.</p>
410 /// </note>
411 pub fn get_target_locations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>> {
412 self.inner.get_target_locations()
413 }
414 /// <p>Number of days to wait after the scheduled day to run an association. For example, if you specified a cron schedule of <code>cron(0 0 ? * THU#2 *)</code>, you could specify an offset of 3 to run the association each Sunday after the second Thursday of the month. For more information about cron schedules for associations, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html">Reference: Cron and rate expressions for Systems Manager</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><note>
415 /// <p>To use offsets, you must specify the <code>ApplyOnlyAtCronInterval</code> parameter. This option tells the system not to run an association immediately after you create it.</p>
416 /// </note>
417 pub fn schedule_offset(mut self, input: i32) -> Self {
418 self.inner = self.inner.schedule_offset(input);
419 self
420 }
421 /// <p>Number of days to wait after the scheduled day to run an association. For example, if you specified a cron schedule of <code>cron(0 0 ? * THU#2 *)</code>, you could specify an offset of 3 to run the association each Sunday after the second Thursday of the month. For more information about cron schedules for associations, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html">Reference: Cron and rate expressions for Systems Manager</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><note>
422 /// <p>To use offsets, you must specify the <code>ApplyOnlyAtCronInterval</code> parameter. This option tells the system not to run an association immediately after you create it.</p>
423 /// </note>
424 pub fn set_schedule_offset(mut self, input: ::std::option::Option<i32>) -> Self {
425 self.inner = self.inner.set_schedule_offset(input);
426 self
427 }
428 /// <p>Number of days to wait after the scheduled day to run an association. For example, if you specified a cron schedule of <code>cron(0 0 ? * THU#2 *)</code>, you could specify an offset of 3 to run the association each Sunday after the second Thursday of the month. For more information about cron schedules for associations, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html">Reference: Cron and rate expressions for Systems Manager</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><note>
429 /// <p>To use offsets, you must specify the <code>ApplyOnlyAtCronInterval</code> parameter. This option tells the system not to run an association immediately after you create it.</p>
430 /// </note>
431 pub fn get_schedule_offset(&self) -> &::std::option::Option<i32> {
432 self.inner.get_schedule_offset()
433 }
434 /// <p>The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.</p>
435 /// <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
436 /// <ul>
437 /// <li>
438 /// <p>The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.</p></li>
439 /// <li>
440 /// <p>The command specifies the <code> <a href="https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-ApplyOnlyAtCronInterval">ApplyOnlyAtCronInterval</a> </code> parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.</p></li>
441 /// </ul>
442 pub fn duration(mut self, input: i32) -> Self {
443 self.inner = self.inner.duration(input);
444 self
445 }
446 /// <p>The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.</p>
447 /// <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
448 /// <ul>
449 /// <li>
450 /// <p>The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.</p></li>
451 /// <li>
452 /// <p>The command specifies the <code> <a href="https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-ApplyOnlyAtCronInterval">ApplyOnlyAtCronInterval</a> </code> parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.</p></li>
453 /// </ul>
454 pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
455 self.inner = self.inner.set_duration(input);
456 self
457 }
458 /// <p>The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.</p>
459 /// <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
460 /// <ul>
461 /// <li>
462 /// <p>The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.</p></li>
463 /// <li>
464 /// <p>The command specifies the <code> <a href="https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-ApplyOnlyAtCronInterval">ApplyOnlyAtCronInterval</a> </code> parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.</p></li>
465 /// </ul>
466 pub fn get_duration(&self) -> &::std::option::Option<i32> {
467 self.inner.get_duration()
468 }
469 ///
470 /// Appends an item to `TargetMaps`.
471 ///
472 /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps).
473 ///
474 /// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
475 pub fn target_maps(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>) -> Self {
476 self.inner = self.inner.target_maps(input);
477 self
478 }
479 /// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
480 pub fn set_target_maps(
481 mut self,
482 input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
483 ) -> Self {
484 self.inner = self.inner.set_target_maps(input);
485 self
486 }
487 /// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
488 pub fn get_target_maps(
489 &self,
490 ) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>> {
491 self.inner.get_target_maps()
492 }
493 ///
494 /// Appends an item to `Tags`.
495 ///
496 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
497 ///
498 /// <p>Adds or overwrites one or more tags for a State Manager association. <i>Tags</i> are metadata that you can assign to your Amazon Web Services resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.</p>
499 pub fn tags(mut self, input: crate::types::Tag) -> Self {
500 self.inner = self.inner.tags(input);
501 self
502 }
503 /// <p>Adds or overwrites one or more tags for a State Manager association. <i>Tags</i> are metadata that you can assign to your Amazon Web Services resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.</p>
504 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
505 self.inner = self.inner.set_tags(input);
506 self
507 }
508 /// <p>Adds or overwrites one or more tags for a State Manager association. <i>Tags</i> are metadata that you can assign to your Amazon Web Services resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.</p>
509 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
510 self.inner.get_tags()
511 }
512 /// <p>The details for the CloudWatch alarm you want to apply to an automation or command.</p>
513 pub fn alarm_configuration(mut self, input: crate::types::AlarmConfiguration) -> Self {
514 self.inner = self.inner.alarm_configuration(input);
515 self
516 }
517 /// <p>The details for the CloudWatch alarm you want to apply to an automation or command.</p>
518 pub fn set_alarm_configuration(mut self, input: ::std::option::Option<crate::types::AlarmConfiguration>) -> Self {
519 self.inner = self.inner.set_alarm_configuration(input);
520 self
521 }
522 /// <p>The details for the CloudWatch alarm you want to apply to an automation or command.</p>
523 pub fn get_alarm_configuration(&self) -> &::std::option::Option<crate::types::AlarmConfiguration> {
524 self.inner.get_alarm_configuration()
525 }
526}