1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains the drift information for a resource that has been checked for drift. This includes actual and expected property values for resources in which CloudFormation has detected drift. Only resource properties explicitly defined in the stack template are checked for drift. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting Unregulated Configuration Changes to Stacks and Resources</a>.</p>
/// <p>Resources that don't currently support drift detection can't be checked. For a list of resources that support drift detection, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html">Resources that Support Drift Detection</a>.</p>
/// <p>Use <code>DetectStackResourceDrift</code> to detect drift on individual resources, or <code>DetectStackDrift</code> to detect drift on all resources in a given stack that support drift detection.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StackResourceDrift {
    /// <p>The ID of the stack.</p>
    pub stack_id: ::std::option::Option<::std::string::String>,
    /// <p>The logical name of the resource specified in the template.</p>
    pub logical_resource_id: ::std::option::Option<::std::string::String>,
    /// <p>The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.</p>
    pub physical_resource_id: ::std::option::Option<::std::string::String>,
    /// <p>Context information that enables CloudFormation to uniquely identify a resource. CloudFormation uses context key-value pairs in cases where a resource's logical and physical IDs aren't enough to uniquely identify that resource. Each context key-value pair specifies a unique resource that contains the targeted resource.</p>
    pub physical_resource_id_context: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalResourceIdContextKeyValuePair>>,
    /// <p>The type of the resource.</p>
    pub resource_type: ::std::option::Option<::std::string::String>,
    /// <p>A JSON structure containing the expected property values of the stack resource, as defined in the stack template and any values specified as template parameters.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub expected_properties: ::std::option::Option<::std::string::String>,
    /// <p>A JSON structure containing the actual property values of the stack resource.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub actual_properties: ::std::option::Option<::std::string::String>,
    /// <p>A collection of the resource properties whose actual values differ from their expected values. These will be present only for resources whose <code>StackResourceDriftStatus</code> is <code>MODIFIED</code>.</p>
    pub property_differences: ::std::option::Option<::std::vec::Vec<crate::types::PropertyDifference>>,
    /// <p>Status of the resource's actual configuration compared to its expected configuration.</p>
    /// <ul>
    /// <li>
    /// <p><code>DELETED</code>: The resource differs from its expected template configuration because the resource has been deleted.</p></li>
    /// <li>
    /// <p><code>MODIFIED</code>: One or more resource properties differ from their expected values (as defined in the stack template and any values specified as template parameters).</p></li>
    /// <li>
    /// <p><code>IN_SYNC</code>: The resource's actual configuration matches its expected template configuration.</p></li>
    /// <li>
    /// <p><code>NOT_CHECKED</code>: CloudFormation does not currently return this value.</p></li>
    /// </ul>
    pub stack_resource_drift_status: ::std::option::Option<crate::types::StackResourceDriftStatus>,
    /// <p>Time at which CloudFormation performed drift detection on the stack resource.</p>
    pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.</p>
    pub module_info: ::std::option::Option<crate::types::ModuleInfo>,
}
impl StackResourceDrift {
    /// <p>The ID of the stack.</p>
    pub fn stack_id(&self) -> ::std::option::Option<&str> {
        self.stack_id.as_deref()
    }
    /// <p>The logical name of the resource specified in the template.</p>
    pub fn logical_resource_id(&self) -> ::std::option::Option<&str> {
        self.logical_resource_id.as_deref()
    }
    /// <p>The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.</p>
    pub fn physical_resource_id(&self) -> ::std::option::Option<&str> {
        self.physical_resource_id.as_deref()
    }
    /// <p>Context information that enables CloudFormation to uniquely identify a resource. CloudFormation uses context key-value pairs in cases where a resource's logical and physical IDs aren't enough to uniquely identify that resource. Each context key-value pair specifies a unique resource that contains the targeted resource.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.physical_resource_id_context.is_none()`.
    pub fn physical_resource_id_context(&self) -> &[crate::types::PhysicalResourceIdContextKeyValuePair] {
        self.physical_resource_id_context.as_deref().unwrap_or_default()
    }
    /// <p>The type of the resource.</p>
    pub fn resource_type(&self) -> ::std::option::Option<&str> {
        self.resource_type.as_deref()
    }
    /// <p>A JSON structure containing the expected property values of the stack resource, as defined in the stack template and any values specified as template parameters.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub fn expected_properties(&self) -> ::std::option::Option<&str> {
        self.expected_properties.as_deref()
    }
    /// <p>A JSON structure containing the actual property values of the stack resource.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub fn actual_properties(&self) -> ::std::option::Option<&str> {
        self.actual_properties.as_deref()
    }
    /// <p>A collection of the resource properties whose actual values differ from their expected values. These will be present only for resources whose <code>StackResourceDriftStatus</code> is <code>MODIFIED</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.property_differences.is_none()`.
    pub fn property_differences(&self) -> &[crate::types::PropertyDifference] {
        self.property_differences.as_deref().unwrap_or_default()
    }
    /// <p>Status of the resource's actual configuration compared to its expected configuration.</p>
    /// <ul>
    /// <li>
    /// <p><code>DELETED</code>: The resource differs from its expected template configuration because the resource has been deleted.</p></li>
    /// <li>
    /// <p><code>MODIFIED</code>: One or more resource properties differ from their expected values (as defined in the stack template and any values specified as template parameters).</p></li>
    /// <li>
    /// <p><code>IN_SYNC</code>: The resource's actual configuration matches its expected template configuration.</p></li>
    /// <li>
    /// <p><code>NOT_CHECKED</code>: CloudFormation does not currently return this value.</p></li>
    /// </ul>
    pub fn stack_resource_drift_status(&self) -> ::std::option::Option<&crate::types::StackResourceDriftStatus> {
        self.stack_resource_drift_status.as_ref()
    }
    /// <p>Time at which CloudFormation performed drift detection on the stack resource.</p>
    pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.timestamp.as_ref()
    }
    /// <p>Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.</p>
    pub fn module_info(&self) -> ::std::option::Option<&crate::types::ModuleInfo> {
        self.module_info.as_ref()
    }
}
impl StackResourceDrift {
    /// Creates a new builder-style object to manufacture [`StackResourceDrift`](crate::types::StackResourceDrift).
    pub fn builder() -> crate::types::builders::StackResourceDriftBuilder {
        crate::types::builders::StackResourceDriftBuilder::default()
    }
}

/// A builder for [`StackResourceDrift`](crate::types::StackResourceDrift).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct StackResourceDriftBuilder {
    pub(crate) stack_id: ::std::option::Option<::std::string::String>,
    pub(crate) logical_resource_id: ::std::option::Option<::std::string::String>,
    pub(crate) physical_resource_id: ::std::option::Option<::std::string::String>,
    pub(crate) physical_resource_id_context: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalResourceIdContextKeyValuePair>>,
    pub(crate) resource_type: ::std::option::Option<::std::string::String>,
    pub(crate) expected_properties: ::std::option::Option<::std::string::String>,
    pub(crate) actual_properties: ::std::option::Option<::std::string::String>,
    pub(crate) property_differences: ::std::option::Option<::std::vec::Vec<crate::types::PropertyDifference>>,
    pub(crate) stack_resource_drift_status: ::std::option::Option<crate::types::StackResourceDriftStatus>,
    pub(crate) timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) module_info: ::std::option::Option<crate::types::ModuleInfo>,
}
impl StackResourceDriftBuilder {
    /// <p>The ID of the stack.</p>
    /// This field is required.
    pub fn stack_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stack_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the stack.</p>
    pub fn set_stack_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stack_id = input;
        self
    }
    /// <p>The ID of the stack.</p>
    pub fn get_stack_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.stack_id
    }
    /// <p>The logical name of the resource specified in the template.</p>
    /// This field is required.
    pub fn logical_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.logical_resource_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The logical name of the resource specified in the template.</p>
    pub fn set_logical_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.logical_resource_id = input;
        self
    }
    /// <p>The logical name of the resource specified in the template.</p>
    pub fn get_logical_resource_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.logical_resource_id
    }
    /// <p>The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.</p>
    pub fn physical_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.physical_resource_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.</p>
    pub fn set_physical_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.physical_resource_id = input;
        self
    }
    /// <p>The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.</p>
    pub fn get_physical_resource_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.physical_resource_id
    }
    /// Appends an item to `physical_resource_id_context`.
    ///
    /// To override the contents of this collection use [`set_physical_resource_id_context`](Self::set_physical_resource_id_context).
    ///
    /// <p>Context information that enables CloudFormation to uniquely identify a resource. CloudFormation uses context key-value pairs in cases where a resource's logical and physical IDs aren't enough to uniquely identify that resource. Each context key-value pair specifies a unique resource that contains the targeted resource.</p>
    pub fn physical_resource_id_context(mut self, input: crate::types::PhysicalResourceIdContextKeyValuePair) -> Self {
        let mut v = self.physical_resource_id_context.unwrap_or_default();
        v.push(input);
        self.physical_resource_id_context = ::std::option::Option::Some(v);
        self
    }
    /// <p>Context information that enables CloudFormation to uniquely identify a resource. CloudFormation uses context key-value pairs in cases where a resource's logical and physical IDs aren't enough to uniquely identify that resource. Each context key-value pair specifies a unique resource that contains the targeted resource.</p>
    pub fn set_physical_resource_id_context(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalResourceIdContextKeyValuePair>>,
    ) -> Self {
        self.physical_resource_id_context = input;
        self
    }
    /// <p>Context information that enables CloudFormation to uniquely identify a resource. CloudFormation uses context key-value pairs in cases where a resource's logical and physical IDs aren't enough to uniquely identify that resource. Each context key-value pair specifies a unique resource that contains the targeted resource.</p>
    pub fn get_physical_resource_id_context(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PhysicalResourceIdContextKeyValuePair>> {
        &self.physical_resource_id_context
    }
    /// <p>The type of the resource.</p>
    /// This field is required.
    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of the resource.</p>
    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_type = input;
        self
    }
    /// <p>The type of the resource.</p>
    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_type
    }
    /// <p>A JSON structure containing the expected property values of the stack resource, as defined in the stack template and any values specified as template parameters.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub fn expected_properties(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.expected_properties = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A JSON structure containing the expected property values of the stack resource, as defined in the stack template and any values specified as template parameters.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub fn set_expected_properties(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.expected_properties = input;
        self
    }
    /// <p>A JSON structure containing the expected property values of the stack resource, as defined in the stack template and any values specified as template parameters.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub fn get_expected_properties(&self) -> &::std::option::Option<::std::string::String> {
        &self.expected_properties
    }
    /// <p>A JSON structure containing the actual property values of the stack resource.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub fn actual_properties(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.actual_properties = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A JSON structure containing the actual property values of the stack resource.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub fn set_actual_properties(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.actual_properties = input;
        self
    }
    /// <p>A JSON structure containing the actual property values of the stack resource.</p>
    /// <p>For resources whose <code>StackResourceDriftStatus</code> is <code>DELETED</code>, this structure will not be present.</p>
    pub fn get_actual_properties(&self) -> &::std::option::Option<::std::string::String> {
        &self.actual_properties
    }
    /// Appends an item to `property_differences`.
    ///
    /// To override the contents of this collection use [`set_property_differences`](Self::set_property_differences).
    ///
    /// <p>A collection of the resource properties whose actual values differ from their expected values. These will be present only for resources whose <code>StackResourceDriftStatus</code> is <code>MODIFIED</code>.</p>
    pub fn property_differences(mut self, input: crate::types::PropertyDifference) -> Self {
        let mut v = self.property_differences.unwrap_or_default();
        v.push(input);
        self.property_differences = ::std::option::Option::Some(v);
        self
    }
    /// <p>A collection of the resource properties whose actual values differ from their expected values. These will be present only for resources whose <code>StackResourceDriftStatus</code> is <code>MODIFIED</code>.</p>
    pub fn set_property_differences(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PropertyDifference>>) -> Self {
        self.property_differences = input;
        self
    }
    /// <p>A collection of the resource properties whose actual values differ from their expected values. These will be present only for resources whose <code>StackResourceDriftStatus</code> is <code>MODIFIED</code>.</p>
    pub fn get_property_differences(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PropertyDifference>> {
        &self.property_differences
    }
    /// <p>Status of the resource's actual configuration compared to its expected configuration.</p>
    /// <ul>
    /// <li>
    /// <p><code>DELETED</code>: The resource differs from its expected template configuration because the resource has been deleted.</p></li>
    /// <li>
    /// <p><code>MODIFIED</code>: One or more resource properties differ from their expected values (as defined in the stack template and any values specified as template parameters).</p></li>
    /// <li>
    /// <p><code>IN_SYNC</code>: The resource's actual configuration matches its expected template configuration.</p></li>
    /// <li>
    /// <p><code>NOT_CHECKED</code>: CloudFormation does not currently return this value.</p></li>
    /// </ul>
    /// This field is required.
    pub fn stack_resource_drift_status(mut self, input: crate::types::StackResourceDriftStatus) -> Self {
        self.stack_resource_drift_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Status of the resource's actual configuration compared to its expected configuration.</p>
    /// <ul>
    /// <li>
    /// <p><code>DELETED</code>: The resource differs from its expected template configuration because the resource has been deleted.</p></li>
    /// <li>
    /// <p><code>MODIFIED</code>: One or more resource properties differ from their expected values (as defined in the stack template and any values specified as template parameters).</p></li>
    /// <li>
    /// <p><code>IN_SYNC</code>: The resource's actual configuration matches its expected template configuration.</p></li>
    /// <li>
    /// <p><code>NOT_CHECKED</code>: CloudFormation does not currently return this value.</p></li>
    /// </ul>
    pub fn set_stack_resource_drift_status(mut self, input: ::std::option::Option<crate::types::StackResourceDriftStatus>) -> Self {
        self.stack_resource_drift_status = input;
        self
    }
    /// <p>Status of the resource's actual configuration compared to its expected configuration.</p>
    /// <ul>
    /// <li>
    /// <p><code>DELETED</code>: The resource differs from its expected template configuration because the resource has been deleted.</p></li>
    /// <li>
    /// <p><code>MODIFIED</code>: One or more resource properties differ from their expected values (as defined in the stack template and any values specified as template parameters).</p></li>
    /// <li>
    /// <p><code>IN_SYNC</code>: The resource's actual configuration matches its expected template configuration.</p></li>
    /// <li>
    /// <p><code>NOT_CHECKED</code>: CloudFormation does not currently return this value.</p></li>
    /// </ul>
    pub fn get_stack_resource_drift_status(&self) -> &::std::option::Option<crate::types::StackResourceDriftStatus> {
        &self.stack_resource_drift_status
    }
    /// <p>Time at which CloudFormation performed drift detection on the stack resource.</p>
    /// This field is required.
    pub fn timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>Time at which CloudFormation performed drift detection on the stack resource.</p>
    pub fn set_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.timestamp = input;
        self
    }
    /// <p>Time at which CloudFormation performed drift detection on the stack resource.</p>
    pub fn get_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.timestamp
    }
    /// <p>Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.</p>
    pub fn module_info(mut self, input: crate::types::ModuleInfo) -> Self {
        self.module_info = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.</p>
    pub fn set_module_info(mut self, input: ::std::option::Option<crate::types::ModuleInfo>) -> Self {
        self.module_info = input;
        self
    }
    /// <p>Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.</p>
    pub fn get_module_info(&self) -> &::std::option::Option<crate::types::ModuleInfo> {
        &self.module_info
    }
    /// Consumes the builder and constructs a [`StackResourceDrift`](crate::types::StackResourceDrift).
    pub fn build(self) -> crate::types::StackResourceDrift {
        crate::types::StackResourceDrift {
            stack_id: self.stack_id,
            logical_resource_id: self.logical_resource_id,
            physical_resource_id: self.physical_resource_id,
            physical_resource_id_context: self.physical_resource_id_context,
            resource_type: self.resource_type,
            expected_properties: self.expected_properties,
            actual_properties: self.actual_properties,
            property_differences: self.property_differences,
            stack_resource_drift_status: self.stack_resource_drift_status,
            timestamp: self.timestamp,
            module_info: self.module_info,
        }
    }
}