aws_sdk_ssm/operation/create_association/_create_association_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateAssociationInput {
6 /// <p>The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.</p>
7 /// <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>
8 /// <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>
9 /// <p><code>arn:<i>partition</i>:ssm:<i>region</i>:<i>account-id</i>:document/<i>document-name</i> </code></p>
10 /// <p>For example:</p>
11 /// <p><code>arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document</code></p>
12 /// <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>
13 pub name: ::std::option::Option<::std::string::String>,
14 /// <p>The document version you want to associate with the targets. Can be a specific version or the default version.</p><important>
15 /// <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>
16 /// </important>
17 pub document_version: ::std::option::Option<::std::string::String>,
18 /// <p>The managed node ID.</p><note>
19 /// <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>
20 /// </note>
21 pub instance_id: ::std::option::Option<::std::string::String>,
22 /// <p>The parameters for the runtime configuration of the document.</p>
23 pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
24 /// <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>
25 pub targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
26 /// <p>A cron expression when the association will be applied to the targets.</p>
27 pub schedule_expression: ::std::option::Option<::std::string::String>,
28 /// <p>An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.</p>
29 pub output_location: ::std::option::Option<crate::types::InstanceAssociationOutputLocation>,
30 /// <p>Specify a descriptive name for the association.</p>
31 pub association_name: ::std::option::Option<::std::string::String>,
32 /// <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>
33 pub automation_target_parameter_name: ::std::option::Option<::std::string::String>,
34 /// <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>
35 /// <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>
36 pub max_errors: ::std::option::Option<::std::string::String>,
37 /// <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>
38 /// <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>
39 pub max_concurrency: ::std::option::Option<::std::string::String>,
40 /// <p>The severity level to assign to the association.</p>
41 pub compliance_severity: ::std::option::Option<crate::types::AssociationComplianceSeverity>,
42 /// <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>
43 /// <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>
44 /// <p>By default, all associations use <code>AUTO</code> mode.</p>
45 pub sync_compliance: ::std::option::Option<crate::types::AssociationSyncCompliance>,
46 /// <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>
47 /// <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>
48 /// <p>This parameter isn't supported for rate expressions.</p>
49 pub apply_only_at_cron_interval: ::std::option::Option<bool>,
50 /// <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>
51 pub calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
52 /// <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>
53 /// <p>The <code>IncludeChildOrganizationUnits</code> parameter is not supported by State Manager.</p>
54 /// </note>
55 pub target_locations: ::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>>,
56 /// <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>
57 /// <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>
58 /// </note>
59 pub schedule_offset: ::std::option::Option<i32>,
60 /// <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>
61 /// <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
62 /// <ul>
63 /// <li>
64 /// <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>
65 /// <li>
66 /// <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>
67 /// </ul>
68 pub duration: ::std::option::Option<i32>,
69 /// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
70 pub target_maps:
71 ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
72 /// <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>
73 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
74 /// <p>The details for the CloudWatch alarm you want to apply to an automation or command.</p>
75 pub alarm_configuration: ::std::option::Option<crate::types::AlarmConfiguration>,
76}
77impl CreateAssociationInput {
78 /// <p>The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.</p>
79 /// <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>
80 /// <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>
81 /// <p><code>arn:<i>partition</i>:ssm:<i>region</i>:<i>account-id</i>:document/<i>document-name</i> </code></p>
82 /// <p>For example:</p>
83 /// <p><code>arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document</code></p>
84 /// <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>
85 pub fn name(&self) -> ::std::option::Option<&str> {
86 self.name.as_deref()
87 }
88 /// <p>The document version you want to associate with the targets. Can be a specific version or the default version.</p><important>
89 /// <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>
90 /// </important>
91 pub fn document_version(&self) -> ::std::option::Option<&str> {
92 self.document_version.as_deref()
93 }
94 /// <p>The managed node ID.</p><note>
95 /// <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>
96 /// </note>
97 pub fn instance_id(&self) -> ::std::option::Option<&str> {
98 self.instance_id.as_deref()
99 }
100 /// <p>The parameters for the runtime configuration of the document.</p>
101 pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
102 self.parameters.as_ref()
103 }
104 /// <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>
105 ///
106 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.targets.is_none()`.
107 pub fn targets(&self) -> &[crate::types::Target] {
108 self.targets.as_deref().unwrap_or_default()
109 }
110 /// <p>A cron expression when the association will be applied to the targets.</p>
111 pub fn schedule_expression(&self) -> ::std::option::Option<&str> {
112 self.schedule_expression.as_deref()
113 }
114 /// <p>An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.</p>
115 pub fn output_location(&self) -> ::std::option::Option<&crate::types::InstanceAssociationOutputLocation> {
116 self.output_location.as_ref()
117 }
118 /// <p>Specify a descriptive name for the association.</p>
119 pub fn association_name(&self) -> ::std::option::Option<&str> {
120 self.association_name.as_deref()
121 }
122 /// <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>
123 pub fn automation_target_parameter_name(&self) -> ::std::option::Option<&str> {
124 self.automation_target_parameter_name.as_deref()
125 }
126 /// <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>
127 /// <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>
128 pub fn max_errors(&self) -> ::std::option::Option<&str> {
129 self.max_errors.as_deref()
130 }
131 /// <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>
132 /// <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>
133 pub fn max_concurrency(&self) -> ::std::option::Option<&str> {
134 self.max_concurrency.as_deref()
135 }
136 /// <p>The severity level to assign to the association.</p>
137 pub fn compliance_severity(&self) -> ::std::option::Option<&crate::types::AssociationComplianceSeverity> {
138 self.compliance_severity.as_ref()
139 }
140 /// <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>
141 /// <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>
142 /// <p>By default, all associations use <code>AUTO</code> mode.</p>
143 pub fn sync_compliance(&self) -> ::std::option::Option<&crate::types::AssociationSyncCompliance> {
144 self.sync_compliance.as_ref()
145 }
146 /// <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>
147 /// <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>
148 /// <p>This parameter isn't supported for rate expressions.</p>
149 pub fn apply_only_at_cron_interval(&self) -> ::std::option::Option<bool> {
150 self.apply_only_at_cron_interval
151 }
152 /// <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>
153 ///
154 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.calendar_names.is_none()`.
155 pub fn calendar_names(&self) -> &[::std::string::String] {
156 self.calendar_names.as_deref().unwrap_or_default()
157 }
158 /// <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>
159 /// <p>The <code>IncludeChildOrganizationUnits</code> parameter is not supported by State Manager.</p>
160 /// </note>
161 ///
162 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_locations.is_none()`.
163 pub fn target_locations(&self) -> &[crate::types::TargetLocation] {
164 self.target_locations.as_deref().unwrap_or_default()
165 }
166 /// <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>
167 /// <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>
168 /// </note>
169 pub fn schedule_offset(&self) -> ::std::option::Option<i32> {
170 self.schedule_offset
171 }
172 /// <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>
173 /// <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
174 /// <ul>
175 /// <li>
176 /// <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>
177 /// <li>
178 /// <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>
179 /// </ul>
180 pub fn duration(&self) -> ::std::option::Option<i32> {
181 self.duration
182 }
183 /// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
184 ///
185 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_maps.is_none()`.
186 pub fn target_maps(&self) -> &[::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>] {
187 self.target_maps.as_deref().unwrap_or_default()
188 }
189 /// <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>
190 ///
191 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
192 pub fn tags(&self) -> &[crate::types::Tag] {
193 self.tags.as_deref().unwrap_or_default()
194 }
195 /// <p>The details for the CloudWatch alarm you want to apply to an automation or command.</p>
196 pub fn alarm_configuration(&self) -> ::std::option::Option<&crate::types::AlarmConfiguration> {
197 self.alarm_configuration.as_ref()
198 }
199}
200impl ::std::fmt::Debug for CreateAssociationInput {
201 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
202 let mut formatter = f.debug_struct("CreateAssociationInput");
203 formatter.field("name", &self.name);
204 formatter.field("document_version", &self.document_version);
205 formatter.field("instance_id", &self.instance_id);
206 formatter.field("parameters", &"*** Sensitive Data Redacted ***");
207 formatter.field("targets", &self.targets);
208 formatter.field("schedule_expression", &self.schedule_expression);
209 formatter.field("output_location", &self.output_location);
210 formatter.field("association_name", &self.association_name);
211 formatter.field("automation_target_parameter_name", &self.automation_target_parameter_name);
212 formatter.field("max_errors", &self.max_errors);
213 formatter.field("max_concurrency", &self.max_concurrency);
214 formatter.field("compliance_severity", &self.compliance_severity);
215 formatter.field("sync_compliance", &self.sync_compliance);
216 formatter.field("apply_only_at_cron_interval", &self.apply_only_at_cron_interval);
217 formatter.field("calendar_names", &self.calendar_names);
218 formatter.field("target_locations", &self.target_locations);
219 formatter.field("schedule_offset", &self.schedule_offset);
220 formatter.field("duration", &self.duration);
221 formatter.field("target_maps", &self.target_maps);
222 formatter.field("tags", &self.tags);
223 formatter.field("alarm_configuration", &self.alarm_configuration);
224 formatter.finish()
225 }
226}
227impl CreateAssociationInput {
228 /// Creates a new builder-style object to manufacture [`CreateAssociationInput`](crate::operation::create_association::CreateAssociationInput).
229 pub fn builder() -> crate::operation::create_association::builders::CreateAssociationInputBuilder {
230 crate::operation::create_association::builders::CreateAssociationInputBuilder::default()
231 }
232}
233
234/// A builder for [`CreateAssociationInput`](crate::operation::create_association::CreateAssociationInput).
235#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
236#[non_exhaustive]
237pub struct CreateAssociationInputBuilder {
238 pub(crate) name: ::std::option::Option<::std::string::String>,
239 pub(crate) document_version: ::std::option::Option<::std::string::String>,
240 pub(crate) instance_id: ::std::option::Option<::std::string::String>,
241 pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
242 pub(crate) targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
243 pub(crate) schedule_expression: ::std::option::Option<::std::string::String>,
244 pub(crate) output_location: ::std::option::Option<crate::types::InstanceAssociationOutputLocation>,
245 pub(crate) association_name: ::std::option::Option<::std::string::String>,
246 pub(crate) automation_target_parameter_name: ::std::option::Option<::std::string::String>,
247 pub(crate) max_errors: ::std::option::Option<::std::string::String>,
248 pub(crate) max_concurrency: ::std::option::Option<::std::string::String>,
249 pub(crate) compliance_severity: ::std::option::Option<crate::types::AssociationComplianceSeverity>,
250 pub(crate) sync_compliance: ::std::option::Option<crate::types::AssociationSyncCompliance>,
251 pub(crate) apply_only_at_cron_interval: ::std::option::Option<bool>,
252 pub(crate) calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
253 pub(crate) target_locations: ::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>>,
254 pub(crate) schedule_offset: ::std::option::Option<i32>,
255 pub(crate) duration: ::std::option::Option<i32>,
256 pub(crate) target_maps:
257 ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
258 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
259 pub(crate) alarm_configuration: ::std::option::Option<crate::types::AlarmConfiguration>,
260}
261impl CreateAssociationInputBuilder {
262 /// <p>The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.</p>
263 /// <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>
264 /// <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>
265 /// <p><code>arn:<i>partition</i>:ssm:<i>region</i>:<i>account-id</i>:document/<i>document-name</i> </code></p>
266 /// <p>For example:</p>
267 /// <p><code>arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document</code></p>
268 /// <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>
269 /// This field is required.
270 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271 self.name = ::std::option::Option::Some(input.into());
272 self
273 }
274 /// <p>The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.</p>
275 /// <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>
276 /// <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>
277 /// <p><code>arn:<i>partition</i>:ssm:<i>region</i>:<i>account-id</i>:document/<i>document-name</i> </code></p>
278 /// <p>For example:</p>
279 /// <p><code>arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document</code></p>
280 /// <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>
281 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
282 self.name = input;
283 self
284 }
285 /// <p>The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.</p>
286 /// <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>
287 /// <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>
288 /// <p><code>arn:<i>partition</i>:ssm:<i>region</i>:<i>account-id</i>:document/<i>document-name</i> </code></p>
289 /// <p>For example:</p>
290 /// <p><code>arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document</code></p>
291 /// <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>
292 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
293 &self.name
294 }
295 /// <p>The document version you want to associate with the targets. Can be a specific version or the default version.</p><important>
296 /// <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>
297 /// </important>
298 pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
299 self.document_version = ::std::option::Option::Some(input.into());
300 self
301 }
302 /// <p>The document version you want to associate with the targets. Can be a specific version or the default version.</p><important>
303 /// <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>
304 /// </important>
305 pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
306 self.document_version = input;
307 self
308 }
309 /// <p>The document version you want to associate with the targets. Can be a specific version or the default version.</p><important>
310 /// <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>
311 /// </important>
312 pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
313 &self.document_version
314 }
315 /// <p>The managed node ID.</p><note>
316 /// <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>
317 /// </note>
318 pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
319 self.instance_id = ::std::option::Option::Some(input.into());
320 self
321 }
322 /// <p>The managed node ID.</p><note>
323 /// <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>
324 /// </note>
325 pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
326 self.instance_id = input;
327 self
328 }
329 /// <p>The managed node ID.</p><note>
330 /// <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>
331 /// </note>
332 pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
333 &self.instance_id
334 }
335 /// Adds a key-value pair to `parameters`.
336 ///
337 /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
338 ///
339 /// <p>The parameters for the runtime configuration of the document.</p>
340 pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
341 let mut hash_map = self.parameters.unwrap_or_default();
342 hash_map.insert(k.into(), v);
343 self.parameters = ::std::option::Option::Some(hash_map);
344 self
345 }
346 /// <p>The parameters for the runtime configuration of the document.</p>
347 pub fn set_parameters(
348 mut self,
349 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
350 ) -> Self {
351 self.parameters = input;
352 self
353 }
354 /// <p>The parameters for the runtime configuration of the document.</p>
355 pub fn get_parameters(
356 &self,
357 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
358 &self.parameters
359 }
360 /// Appends an item to `targets`.
361 ///
362 /// To override the contents of this collection use [`set_targets`](Self::set_targets).
363 ///
364 /// <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>
365 pub fn targets(mut self, input: crate::types::Target) -> Self {
366 let mut v = self.targets.unwrap_or_default();
367 v.push(input);
368 self.targets = ::std::option::Option::Some(v);
369 self
370 }
371 /// <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>
372 pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
373 self.targets = input;
374 self
375 }
376 /// <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>
377 pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
378 &self.targets
379 }
380 /// <p>A cron expression when the association will be applied to the targets.</p>
381 pub fn schedule_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
382 self.schedule_expression = ::std::option::Option::Some(input.into());
383 self
384 }
385 /// <p>A cron expression when the association will be applied to the targets.</p>
386 pub fn set_schedule_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
387 self.schedule_expression = input;
388 self
389 }
390 /// <p>A cron expression when the association will be applied to the targets.</p>
391 pub fn get_schedule_expression(&self) -> &::std::option::Option<::std::string::String> {
392 &self.schedule_expression
393 }
394 /// <p>An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.</p>
395 pub fn output_location(mut self, input: crate::types::InstanceAssociationOutputLocation) -> Self {
396 self.output_location = ::std::option::Option::Some(input);
397 self
398 }
399 /// <p>An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.</p>
400 pub fn set_output_location(mut self, input: ::std::option::Option<crate::types::InstanceAssociationOutputLocation>) -> Self {
401 self.output_location = input;
402 self
403 }
404 /// <p>An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.</p>
405 pub fn get_output_location(&self) -> &::std::option::Option<crate::types::InstanceAssociationOutputLocation> {
406 &self.output_location
407 }
408 /// <p>Specify a descriptive name for the association.</p>
409 pub fn association_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
410 self.association_name = ::std::option::Option::Some(input.into());
411 self
412 }
413 /// <p>Specify a descriptive name for the association.</p>
414 pub fn set_association_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
415 self.association_name = input;
416 self
417 }
418 /// <p>Specify a descriptive name for the association.</p>
419 pub fn get_association_name(&self) -> &::std::option::Option<::std::string::String> {
420 &self.association_name
421 }
422 /// <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>
423 pub fn automation_target_parameter_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
424 self.automation_target_parameter_name = ::std::option::Option::Some(input.into());
425 self
426 }
427 /// <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>
428 pub fn set_automation_target_parameter_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
429 self.automation_target_parameter_name = input;
430 self
431 }
432 /// <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>
433 pub fn get_automation_target_parameter_name(&self) -> &::std::option::Option<::std::string::String> {
434 &self.automation_target_parameter_name
435 }
436 /// <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>
437 /// <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>
438 pub fn max_errors(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
439 self.max_errors = ::std::option::Option::Some(input.into());
440 self
441 }
442 /// <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>
443 /// <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>
444 pub fn set_max_errors(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
445 self.max_errors = input;
446 self
447 }
448 /// <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>
449 /// <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>
450 pub fn get_max_errors(&self) -> &::std::option::Option<::std::string::String> {
451 &self.max_errors
452 }
453 /// <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>
454 /// <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>
455 pub fn max_concurrency(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
456 self.max_concurrency = ::std::option::Option::Some(input.into());
457 self
458 }
459 /// <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>
460 /// <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>
461 pub fn set_max_concurrency(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
462 self.max_concurrency = input;
463 self
464 }
465 /// <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>
466 /// <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>
467 pub fn get_max_concurrency(&self) -> &::std::option::Option<::std::string::String> {
468 &self.max_concurrency
469 }
470 /// <p>The severity level to assign to the association.</p>
471 pub fn compliance_severity(mut self, input: crate::types::AssociationComplianceSeverity) -> Self {
472 self.compliance_severity = ::std::option::Option::Some(input);
473 self
474 }
475 /// <p>The severity level to assign to the association.</p>
476 pub fn set_compliance_severity(mut self, input: ::std::option::Option<crate::types::AssociationComplianceSeverity>) -> Self {
477 self.compliance_severity = input;
478 self
479 }
480 /// <p>The severity level to assign to the association.</p>
481 pub fn get_compliance_severity(&self) -> &::std::option::Option<crate::types::AssociationComplianceSeverity> {
482 &self.compliance_severity
483 }
484 /// <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>
485 /// <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>
486 /// <p>By default, all associations use <code>AUTO</code> mode.</p>
487 pub fn sync_compliance(mut self, input: crate::types::AssociationSyncCompliance) -> Self {
488 self.sync_compliance = ::std::option::Option::Some(input);
489 self
490 }
491 /// <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>
492 /// <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>
493 /// <p>By default, all associations use <code>AUTO</code> mode.</p>
494 pub fn set_sync_compliance(mut self, input: ::std::option::Option<crate::types::AssociationSyncCompliance>) -> Self {
495 self.sync_compliance = input;
496 self
497 }
498 /// <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>
499 /// <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>
500 /// <p>By default, all associations use <code>AUTO</code> mode.</p>
501 pub fn get_sync_compliance(&self) -> &::std::option::Option<crate::types::AssociationSyncCompliance> {
502 &self.sync_compliance
503 }
504 /// <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>
505 /// <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>
506 /// <p>This parameter isn't supported for rate expressions.</p>
507 pub fn apply_only_at_cron_interval(mut self, input: bool) -> Self {
508 self.apply_only_at_cron_interval = ::std::option::Option::Some(input);
509 self
510 }
511 /// <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>
512 /// <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>
513 /// <p>This parameter isn't supported for rate expressions.</p>
514 pub fn set_apply_only_at_cron_interval(mut self, input: ::std::option::Option<bool>) -> Self {
515 self.apply_only_at_cron_interval = input;
516 self
517 }
518 /// <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>
519 /// <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>
520 /// <p>This parameter isn't supported for rate expressions.</p>
521 pub fn get_apply_only_at_cron_interval(&self) -> &::std::option::Option<bool> {
522 &self.apply_only_at_cron_interval
523 }
524 /// Appends an item to `calendar_names`.
525 ///
526 /// To override the contents of this collection use [`set_calendar_names`](Self::set_calendar_names).
527 ///
528 /// <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>
529 pub fn calendar_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
530 let mut v = self.calendar_names.unwrap_or_default();
531 v.push(input.into());
532 self.calendar_names = ::std::option::Option::Some(v);
533 self
534 }
535 /// <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>
536 pub fn set_calendar_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
537 self.calendar_names = input;
538 self
539 }
540 /// <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>
541 pub fn get_calendar_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
542 &self.calendar_names
543 }
544 /// Appends an item to `target_locations`.
545 ///
546 /// To override the contents of this collection use [`set_target_locations`](Self::set_target_locations).
547 ///
548 /// <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>
549 /// <p>The <code>IncludeChildOrganizationUnits</code> parameter is not supported by State Manager.</p>
550 /// </note>
551 pub fn target_locations(mut self, input: crate::types::TargetLocation) -> Self {
552 let mut v = self.target_locations.unwrap_or_default();
553 v.push(input);
554 self.target_locations = ::std::option::Option::Some(v);
555 self
556 }
557 /// <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>
558 /// <p>The <code>IncludeChildOrganizationUnits</code> parameter is not supported by State Manager.</p>
559 /// </note>
560 pub fn set_target_locations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>>) -> Self {
561 self.target_locations = input;
562 self
563 }
564 /// <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>
565 /// <p>The <code>IncludeChildOrganizationUnits</code> parameter is not supported by State Manager.</p>
566 /// </note>
567 pub fn get_target_locations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TargetLocation>> {
568 &self.target_locations
569 }
570 /// <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>
571 /// <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>
572 /// </note>
573 pub fn schedule_offset(mut self, input: i32) -> Self {
574 self.schedule_offset = ::std::option::Option::Some(input);
575 self
576 }
577 /// <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>
578 /// <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>
579 /// </note>
580 pub fn set_schedule_offset(mut self, input: ::std::option::Option<i32>) -> Self {
581 self.schedule_offset = input;
582 self
583 }
584 /// <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>
585 /// <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>
586 /// </note>
587 pub fn get_schedule_offset(&self) -> &::std::option::Option<i32> {
588 &self.schedule_offset
589 }
590 /// <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>
591 /// <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
592 /// <ul>
593 /// <li>
594 /// <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>
595 /// <li>
596 /// <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>
597 /// </ul>
598 pub fn duration(mut self, input: i32) -> Self {
599 self.duration = ::std::option::Option::Some(input);
600 self
601 }
602 /// <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>
603 /// <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
604 /// <ul>
605 /// <li>
606 /// <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>
607 /// <li>
608 /// <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>
609 /// </ul>
610 pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
611 self.duration = input;
612 self
613 }
614 /// <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>
615 /// <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
616 /// <ul>
617 /// <li>
618 /// <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>
619 /// <li>
620 /// <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>
621 /// </ul>
622 pub fn get_duration(&self) -> &::std::option::Option<i32> {
623 &self.duration
624 }
625 /// Appends an item to `target_maps`.
626 ///
627 /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps).
628 ///
629 /// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
630 pub fn target_maps(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>) -> Self {
631 let mut v = self.target_maps.unwrap_or_default();
632 v.push(input);
633 self.target_maps = ::std::option::Option::Some(v);
634 self
635 }
636 /// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
637 pub fn set_target_maps(
638 mut self,
639 input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
640 ) -> Self {
641 self.target_maps = input;
642 self
643 }
644 /// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
645 pub fn get_target_maps(
646 &self,
647 ) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>> {
648 &self.target_maps
649 }
650 /// Appends an item to `tags`.
651 ///
652 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
653 ///
654 /// <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>
655 pub fn tags(mut self, input: crate::types::Tag) -> Self {
656 let mut v = self.tags.unwrap_or_default();
657 v.push(input);
658 self.tags = ::std::option::Option::Some(v);
659 self
660 }
661 /// <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>
662 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
663 self.tags = input;
664 self
665 }
666 /// <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>
667 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
668 &self.tags
669 }
670 /// <p>The details for the CloudWatch alarm you want to apply to an automation or command.</p>
671 pub fn alarm_configuration(mut self, input: crate::types::AlarmConfiguration) -> Self {
672 self.alarm_configuration = ::std::option::Option::Some(input);
673 self
674 }
675 /// <p>The details for the CloudWatch alarm you want to apply to an automation or command.</p>
676 pub fn set_alarm_configuration(mut self, input: ::std::option::Option<crate::types::AlarmConfiguration>) -> Self {
677 self.alarm_configuration = input;
678 self
679 }
680 /// <p>The details for the CloudWatch alarm you want to apply to an automation or command.</p>
681 pub fn get_alarm_configuration(&self) -> &::std::option::Option<crate::types::AlarmConfiguration> {
682 &self.alarm_configuration
683 }
684 /// Consumes the builder and constructs a [`CreateAssociationInput`](crate::operation::create_association::CreateAssociationInput).
685 pub fn build(
686 self,
687 ) -> ::std::result::Result<crate::operation::create_association::CreateAssociationInput, ::aws_smithy_types::error::operation::BuildError> {
688 ::std::result::Result::Ok(crate::operation::create_association::CreateAssociationInput {
689 name: self.name,
690 document_version: self.document_version,
691 instance_id: self.instance_id,
692 parameters: self.parameters,
693 targets: self.targets,
694 schedule_expression: self.schedule_expression,
695 output_location: self.output_location,
696 association_name: self.association_name,
697 automation_target_parameter_name: self.automation_target_parameter_name,
698 max_errors: self.max_errors,
699 max_concurrency: self.max_concurrency,
700 compliance_severity: self.compliance_severity,
701 sync_compliance: self.sync_compliance,
702 apply_only_at_cron_interval: self.apply_only_at_cron_interval,
703 calendar_names: self.calendar_names,
704 target_locations: self.target_locations,
705 schedule_offset: self.schedule_offset,
706 duration: self.duration,
707 target_maps: self.target_maps,
708 tags: self.tags,
709 alarm_configuration: self.alarm_configuration,
710 })
711 }
712}
713impl ::std::fmt::Debug for CreateAssociationInputBuilder {
714 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
715 let mut formatter = f.debug_struct("CreateAssociationInputBuilder");
716 formatter.field("name", &self.name);
717 formatter.field("document_version", &self.document_version);
718 formatter.field("instance_id", &self.instance_id);
719 formatter.field("parameters", &"*** Sensitive Data Redacted ***");
720 formatter.field("targets", &self.targets);
721 formatter.field("schedule_expression", &self.schedule_expression);
722 formatter.field("output_location", &self.output_location);
723 formatter.field("association_name", &self.association_name);
724 formatter.field("automation_target_parameter_name", &self.automation_target_parameter_name);
725 formatter.field("max_errors", &self.max_errors);
726 formatter.field("max_concurrency", &self.max_concurrency);
727 formatter.field("compliance_severity", &self.compliance_severity);
728 formatter.field("sync_compliance", &self.sync_compliance);
729 formatter.field("apply_only_at_cron_interval", &self.apply_only_at_cron_interval);
730 formatter.field("calendar_names", &self.calendar_names);
731 formatter.field("target_locations", &self.target_locations);
732 formatter.field("schedule_offset", &self.schedule_offset);
733 formatter.field("duration", &self.duration);
734 formatter.field("target_maps", &self.target_maps);
735 formatter.field("tags", &self.tags);
736 formatter.field("alarm_configuration", &self.alarm_configuration);
737 formatter.finish()
738 }
739}