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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
//! Types for the `KMS` service.
/// The [`AWS::KMS::Alias`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html) resource type.
#[derive(Debug, Default)]
pub struct Alias {
properties: AliasProperties
}
/// Properties for the `Alias` resource.
#[derive(Debug, Default)]
pub struct AliasProperties {
/// Property [`AliasName`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html#cfn-kms-alias-aliasname).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub alias_name: ::Value<String>,
/// Property [`TargetKeyId`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html#cfn-kms-alias-targetkeyid).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub target_key_id: ::Value<String>,
}
impl ::serde::Serialize for AliasProperties {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
let mut map = ::serde::Serializer::serialize_map(s, None)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "AliasName", &self.alias_name)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "TargetKeyId", &self.target_key_id)?;
::serde::ser::SerializeMap::end(map)
}
}
impl<'de> ::serde::Deserialize<'de> for AliasProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<AliasProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = AliasProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type AliasProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut alias_name: Option<::Value<String>> = None;
let mut target_key_id: Option<::Value<String>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"AliasName" => {
alias_name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"TargetKeyId" => {
target_key_id = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(AliasProperties {
alias_name: alias_name.ok_or(::serde::de::Error::missing_field("AliasName"))?,
target_key_id: target_key_id.ok_or(::serde::de::Error::missing_field("TargetKeyId"))?,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for Alias {
type Properties = AliasProperties;
const TYPE: &'static str = "AWS::KMS::Alias";
fn properties(&self) -> &AliasProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut AliasProperties {
&mut self.properties
}
}
impl ::private::Sealed for Alias {}
impl From<AliasProperties> for Alias {
fn from(properties: AliasProperties) -> Alias {
Alias { properties }
}
}
/// The [`AWS::KMS::Key`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html) resource type.
#[derive(Debug, Default)]
pub struct Key {
properties: KeyProperties
}
/// Properties for the `Key` resource.
#[derive(Debug, Default)]
pub struct KeyProperties {
/// Property [`Description`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-description).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub description: Option<::Value<String>>,
/// Property [`EnableKeyRotation`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-enablekeyrotation).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub enable_key_rotation: Option<::Value<bool>>,
/// Property [`Enabled`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-enabled).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub enabled: Option<::Value<bool>>,
/// Property [`KeyPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keypolicy).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub key_policy: ::Value<::json::Value>,
/// Property [`KeySpec`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keyspec).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub key_spec: Option<::Value<String>>,
/// Property [`KeyUsage`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keyusage).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub key_usage: Option<::Value<String>>,
/// Property [`MultiRegion`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-multiregion).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub multi_region: Option<::Value<bool>>,
/// Property [`PendingWindowInDays`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-pendingwindowindays).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub pending_window_in_days: Option<::Value<u32>>,
/// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-tags).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub tags: Option<::ValueList<::Tag>>,
}
impl ::serde::Serialize for KeyProperties {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
let mut map = ::serde::Serializer::serialize_map(s, None)?;
if let Some(ref description) = self.description {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Description", description)?;
}
if let Some(ref enable_key_rotation) = self.enable_key_rotation {
::serde::ser::SerializeMap::serialize_entry(&mut map, "EnableKeyRotation", enable_key_rotation)?;
}
if let Some(ref enabled) = self.enabled {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Enabled", enabled)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "KeyPolicy", &self.key_policy)?;
if let Some(ref key_spec) = self.key_spec {
::serde::ser::SerializeMap::serialize_entry(&mut map, "KeySpec", key_spec)?;
}
if let Some(ref key_usage) = self.key_usage {
::serde::ser::SerializeMap::serialize_entry(&mut map, "KeyUsage", key_usage)?;
}
if let Some(ref multi_region) = self.multi_region {
::serde::ser::SerializeMap::serialize_entry(&mut map, "MultiRegion", multi_region)?;
}
if let Some(ref pending_window_in_days) = self.pending_window_in_days {
::serde::ser::SerializeMap::serialize_entry(&mut map, "PendingWindowInDays", pending_window_in_days)?;
}
if let Some(ref tags) = self.tags {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl<'de> ::serde::Deserialize<'de> for KeyProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<KeyProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = KeyProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type KeyProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut description: Option<::Value<String>> = None;
let mut enable_key_rotation: Option<::Value<bool>> = None;
let mut enabled: Option<::Value<bool>> = None;
let mut key_policy: Option<::Value<::json::Value>> = None;
let mut key_spec: Option<::Value<String>> = None;
let mut key_usage: Option<::Value<String>> = None;
let mut multi_region: Option<::Value<bool>> = None;
let mut pending_window_in_days: Option<::Value<u32>> = None;
let mut tags: Option<::ValueList<::Tag>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"Description" => {
description = ::serde::de::MapAccess::next_value(&mut map)?;
}
"EnableKeyRotation" => {
enable_key_rotation = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Enabled" => {
enabled = ::serde::de::MapAccess::next_value(&mut map)?;
}
"KeyPolicy" => {
key_policy = ::serde::de::MapAccess::next_value(&mut map)?;
}
"KeySpec" => {
key_spec = ::serde::de::MapAccess::next_value(&mut map)?;
}
"KeyUsage" => {
key_usage = ::serde::de::MapAccess::next_value(&mut map)?;
}
"MultiRegion" => {
multi_region = ::serde::de::MapAccess::next_value(&mut map)?;
}
"PendingWindowInDays" => {
pending_window_in_days = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Tags" => {
tags = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(KeyProperties {
description: description,
enable_key_rotation: enable_key_rotation,
enabled: enabled,
key_policy: key_policy.ok_or(::serde::de::Error::missing_field("KeyPolicy"))?,
key_spec: key_spec,
key_usage: key_usage,
multi_region: multi_region,
pending_window_in_days: pending_window_in_days,
tags: tags,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for Key {
type Properties = KeyProperties;
const TYPE: &'static str = "AWS::KMS::Key";
fn properties(&self) -> &KeyProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut KeyProperties {
&mut self.properties
}
}
impl ::private::Sealed for Key {}
impl From<KeyProperties> for Key {
fn from(properties: KeyProperties) -> Key {
Key { properties }
}
}
/// The [`AWS::KMS::ReplicaKey`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html) resource type.
#[derive(Debug, Default)]
pub struct ReplicaKey {
properties: ReplicaKeyProperties
}
/// Properties for the `ReplicaKey` resource.
#[derive(Debug, Default)]
pub struct ReplicaKeyProperties {
/// Property [`Description`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-description).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub description: Option<::Value<String>>,
/// Property [`Enabled`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-enabled).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub enabled: Option<::Value<bool>>,
/// Property [`KeyPolicy`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-keypolicy).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub key_policy: ::Value<::json::Value>,
/// Property [`PendingWindowInDays`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-pendingwindowindays).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub pending_window_in_days: Option<::Value<u32>>,
/// Property [`PrimaryKeyArn`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-primarykeyarn).
///
/// Update type: _Immutable_.
/// AWS CloudFormation replaces the resource when you change this property.
pub primary_key_arn: ::Value<String>,
/// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-tags).
///
/// Update type: _Mutable_.
/// AWS CloudFormation doesn't replace the resource when you change this property.
pub tags: Option<::ValueList<::Tag>>,
}
impl ::serde::Serialize for ReplicaKeyProperties {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
let mut map = ::serde::Serializer::serialize_map(s, None)?;
if let Some(ref description) = self.description {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Description", description)?;
}
if let Some(ref enabled) = self.enabled {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Enabled", enabled)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "KeyPolicy", &self.key_policy)?;
if let Some(ref pending_window_in_days) = self.pending_window_in_days {
::serde::ser::SerializeMap::serialize_entry(&mut map, "PendingWindowInDays", pending_window_in_days)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "PrimaryKeyArn", &self.primary_key_arn)?;
if let Some(ref tags) = self.tags {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl<'de> ::serde::Deserialize<'de> for ReplicaKeyProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<ReplicaKeyProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = ReplicaKeyProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type ReplicaKeyProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut description: Option<::Value<String>> = None;
let mut enabled: Option<::Value<bool>> = None;
let mut key_policy: Option<::Value<::json::Value>> = None;
let mut pending_window_in_days: Option<::Value<u32>> = None;
let mut primary_key_arn: Option<::Value<String>> = None;
let mut tags: Option<::ValueList<::Tag>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"Description" => {
description = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Enabled" => {
enabled = ::serde::de::MapAccess::next_value(&mut map)?;
}
"KeyPolicy" => {
key_policy = ::serde::de::MapAccess::next_value(&mut map)?;
}
"PendingWindowInDays" => {
pending_window_in_days = ::serde::de::MapAccess::next_value(&mut map)?;
}
"PrimaryKeyArn" => {
primary_key_arn = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Tags" => {
tags = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(ReplicaKeyProperties {
description: description,
enabled: enabled,
key_policy: key_policy.ok_or(::serde::de::Error::missing_field("KeyPolicy"))?,
pending_window_in_days: pending_window_in_days,
primary_key_arn: primary_key_arn.ok_or(::serde::de::Error::missing_field("PrimaryKeyArn"))?,
tags: tags,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for ReplicaKey {
type Properties = ReplicaKeyProperties;
const TYPE: &'static str = "AWS::KMS::ReplicaKey";
fn properties(&self) -> &ReplicaKeyProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut ReplicaKeyProperties {
&mut self.properties
}
}
impl ::private::Sealed for ReplicaKey {}
impl From<ReplicaKeyProperties> for ReplicaKey {
fn from(properties: ReplicaKeyProperties) -> ReplicaKey {
ReplicaKey { properties }
}
}