cfn-model 0.4.11 → 0.4.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94ac518b4d9f7fd70ee3f8cb6d10eee99d85520502a5c1734b7097d98b13b1f0
4
- data.tar.gz: aeb9fcd0827ecd6438f98800e662a633e486e1e3d36e524db6660c8fa428b260
3
+ metadata.gz: a1706430755f12f30280c2a2baebb5566d50898ede81ec20e503ef91642e08b6
4
+ data.tar.gz: 30075abf14b456b2ebed049d9af2b68cfee7be938f8bcf9b8936170e651f8eeb
5
5
  SHA512:
6
- metadata.gz: be59189b2aa3351c39ad427b09f3e334d19f6116d11630eb19759dd21dd529c03910806976a3f43eb127e40eabbe72f2ad95853ab9aea70e99b806a9f5570736
7
- data.tar.gz: 394c967495cb63c8c36b0be9880c0f498f37b20f8c4835849e27d383f2d71159a3072bea56bec937c4868d42e623eb1a9714d582b0f513fcb84901f524e42b9d
6
+ metadata.gz: a7223fce1ad56a488c37cfc27c0b35a2b5f0df76c4d3dc7b55ca2d46139b8f2f479e5ae981549ac91844d710cabf2519a73fbc1507426e0ee254976cf0a328d6
7
+ data.tar.gz: a1e9d39a1f17aa3f0ed0238cb8abc098a2880f3873ff3270ff9f2e6dc6c8dbdc017c96e3c0e6ca30531de5be8adf7a3494cd97b843476a8300ebda657fea977a
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'model_element'
4
+
5
+ class AWS::KMS::Key < ModelElement
6
+ attr_accessor :key_policy
7
+
8
+ def initialize(cfn_model)
9
+ super
10
+ @key_policy = nil
11
+ @resource_type = 'AWS::KMS::Key'
12
+ end
13
+ end
@@ -23,6 +23,10 @@ module AWS
23
23
 
24
24
  end
25
25
 
26
+ module KMS
27
+
28
+ end
29
+
26
30
  module S3
27
31
 
28
32
  end
@@ -109,4 +113,4 @@ END
109
113
  end
110
114
  instance_vars_str
111
115
  end
112
- end
116
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cfn-model/model/kms_key'
4
+ require 'cfn-model/model/policy'
5
+ require_relative 'policy_document_parser'
6
+
7
+ class KmsKeyParser
8
+ def parse(cfn_model:, resource:)
9
+ kms_key = resource
10
+
11
+ new_policy = Policy.new
12
+ new_policy.policy_document = PolicyDocumentParser.new.parse(kms_key.keyPolicy)
13
+ kms_key.key_policy = new_policy
14
+
15
+ kms_key
16
+ end
17
+ end
@@ -17,6 +17,7 @@ class ParserRegistry
17
17
  'AWS::IAM::Role' => IamRoleParser,
18
18
  'AWS::IAM::Policy' => WithPolicyDocumentParser,
19
19
  'AWS::IAM::ManagedPolicy' => WithPolicyDocumentParser,
20
+ 'AWS::KMS::Key' => KmsKeyParser,
20
21
  'AWS::S3::BucketPolicy' => WithPolicyDocumentParser,
21
22
  'AWS::SNS::TopicPolicy' => WithPolicyDocumentParser,
22
23
  'AWS::SQS::QueuePolicy' => WithPolicyDocumentParser
@@ -33,4 +34,4 @@ class ParserRegistry
33
34
  # def add_parser(resource_name, parser)
34
35
  # @registry[resource_name] = parser
35
36
  # end
36
- end
37
+ end
@@ -0,0 +1,18 @@
1
+ ---
2
+ type: map
3
+ mapping:
4
+ Type:
5
+ type: str
6
+ required: yes
7
+ pattern: /AWS::KMS::Key/
8
+ Properties:
9
+ type: map
10
+ required: yes
11
+ mapping:
12
+ KeyPolicy:
13
+ type: any
14
+ required: yes
15
+ =:
16
+ type: any
17
+ =:
18
+ type: any
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kascic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-06 00:00:00.000000000 Z
11
+ date: 2020-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -70,6 +70,7 @@ files:
70
70
  - lib/cfn-model/model/iam_policy.rb
71
71
  - lib/cfn-model/model/iam_role.rb
72
72
  - lib/cfn-model/model/iam_user.rb
73
+ - lib/cfn-model/model/kms_key.rb
73
74
  - lib/cfn-model/model/lambda_principal.rb
74
75
  - lib/cfn-model/model/load_balancer.rb
75
76
  - lib/cfn-model/model/model_element.rb
@@ -91,6 +92,7 @@ files:
91
92
  - lib/cfn-model/parser/iam_group_parser.rb
92
93
  - lib/cfn-model/parser/iam_role_parser.rb
93
94
  - lib/cfn-model/parser/iam_user_parser.rb
95
+ - lib/cfn-model/parser/kms_key_parser.rb
94
96
  - lib/cfn-model/parser/load_balancer_parser.rb
95
97
  - lib/cfn-model/parser/load_balancer_v2_parser.rb
96
98
  - lib/cfn-model/parser/parameter_substitution.rb
@@ -117,6 +119,7 @@ files:
117
119
  - lib/cfn-model/schema/AWS_IAM_Role.yml
118
120
  - lib/cfn-model/schema/AWS_IAM_User.yml
119
121
  - lib/cfn-model/schema/AWS_IAM_UserToGroupAddition.yml
122
+ - lib/cfn-model/schema/AWS_KMS_Key.yml
120
123
  - lib/cfn-model/schema/AWS_Lambda_Permission.yml
121
124
  - lib/cfn-model/schema/AWS_S3_BucketPolicy.yml
122
125
  - lib/cfn-model/schema/AWS_SNS_TopicPolicy.yml