convection 0.2.11 → 0.2.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
  SHA1:
3
- metadata.gz: c29b3f1c8f83815c88cb2beb09393a0f141e05d6
4
- data.tar.gz: 5d6829531589da8a752e8a4c1d6854d004c76398
3
+ metadata.gz: 1076761e16a97104ae559f9b56201d1cbb76287a
4
+ data.tar.gz: 6f85f6950fb4e34863fcee35f6b8ffc1e2779fec
5
5
  SHA512:
6
- metadata.gz: c39a9a01dab72d7b2d8130870bdf7ecffd3c4128c6045f90847c1f859ac93b59a2080d05239b49920f8746a2337c63d1020809db974177052ef1d95908ae0e2d
7
- data.tar.gz: de3a2ef59b98e0a3249a77bf1e9998f8c73b318bb603113e5a167feacf0decdcfd8dbacc2a0db8fc801ab290920b1b02d52daec97a2442256ba513348c809029
6
+ metadata.gz: 574c6935f6220ee9f93b82d31278d7380f3f9e966a9cfa4e22b9731325d954449e2248a619b6057c0e2387ac3b71ca7e1b1356ee43a5bba0b41d3c8d023f335e
7
+ data.tar.gz: d6834e569ba8d687b612cdb0765885f2a7738c7c7392640aacc9e0d8ce3c54db8bab14179450dbe2782e07ac7bc2f2b3730ba93c2808a505883542f25549da0e
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ mkmf.log
16
16
 
17
17
  keys
18
18
  VERSION
19
+ attic
@@ -1,3 +1,5 @@
1
+ require 'securerandom'
2
+
1
3
  module Convection
2
4
  module Model
3
5
  module Mixin
@@ -61,6 +63,7 @@ module Convection
61
63
  attribute :sid
62
64
  attribute :effect
63
65
  attribute :principal
66
+ attribute :not_principal
64
67
  attribute :condition
65
68
  list :action
66
69
  list :resource
@@ -90,12 +93,13 @@ module Convection
90
93
  def render
91
94
  {
92
95
  'Effect' => effect,
93
- 'Action' => action,
94
- 'Resource' => resource
95
- }.tap do |statemant|
96
- statemant['Sid'] = sid unless sid.nil?
97
- statemant['Condition'] = condition unless condition.nil?
98
- statemant['Principal'] = principal unless principal.nil?
96
+ 'Action' => action
97
+ }.tap do |statement|
98
+ statement['Sid'] = sid unless sid.nil?
99
+ statement['Condition'] = condition unless condition.nil?
100
+ statement['Principal'] = principal unless principal.nil?
101
+ statement['NotPrincipal'] = not_principal unless not_principal.nil?
102
+ statement['Resource'] = resource unless resource.empty? # Avoid failure in CF if empty Resources array is passed
99
103
  end
100
104
  end
101
105
  end
@@ -0,0 +1,37 @@
1
+ require_relative '../resource'
2
+
3
+ module Convection
4
+ module Model
5
+ class Template
6
+ class Resource
7
+ ##
8
+ # AWS::IAM::ManagedPolicy
9
+ ##
10
+ class IAMManagedPolicy < Resource
11
+ extend Forwardable
12
+
13
+ type 'AWS::IAM::ManagedPolicy'
14
+ property :path, 'Path'
15
+ property :group, 'Groups', :type => :list
16
+ property :role, 'Roles', :type => :list
17
+ property :user, 'Users', :type => :list
18
+
19
+ attr_reader :document
20
+ def_delegators :@document, :allow, :deny, :id, :version, :statement
21
+
22
+ def initialize(*args)
23
+ super
24
+ @document = Model::Mixin::Policy.new(:template => @template)
25
+ end
26
+
27
+ def render
28
+ super.tap do |r|
29
+ document.render(r['Properties'])
30
+ r['Properties'].delete('PolicyName')
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Manero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-10 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -402,6 +402,7 @@ files:
402
402
  - lib/convection/model/template/resource/aws_iam_access_key.rb
403
403
  - lib/convection/model/template/resource/aws_iam_group.rb
404
404
  - lib/convection/model/template/resource/aws_iam_instance_profile.rb
405
+ - lib/convection/model/template/resource/aws_iam_managed_policy.rb
405
406
  - lib/convection/model/template/resource/aws_iam_policy.rb
406
407
  - lib/convection/model/template/resource/aws_iam_role.rb
407
408
  - lib/convection/model/template/resource/aws_iam_user.rb