convection 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 075a28b9e49edf4315587f8de99945362fd9e837
4
- data.tar.gz: 97a5572cf09f71edca02765fda206d77483bbfc0
3
+ metadata.gz: 0af26e690c4ed714efb0befe58bbfceedca3235c
4
+ data.tar.gz: 9e6d1cca9a5cbba8eaa53072fa7005b3be49d74f
5
5
  SHA512:
6
- metadata.gz: 7c0a82cfe5c746882ca8d48c45929ed0a136d27def8f98bd59a5a3394c4ea00ce5ecf4c19ddd30dd17dff84c9f2612ca6b9a9ebe14d103fd0d0ef29acc1f4f13
7
- data.tar.gz: c2dbf7220245c5c4b4274a40c1db694f5ac3c68b0a954a88418bd4da0270d8359d60f0a63644d93905ace121a226e70f1aad2ca4fdeca5a9988776b570f45844
6
+ metadata.gz: 5e1dd60cb1def647b0aad5a5ebac2aafd283e6c54bdf024db70ed2d287e7c999e8a9c80922aa21de08dc793671f2625432d9eeabce041a613fd2b0c8853f9687
7
+ data.tar.gz: 4672e928d3ec4db7f9de14e8bb82d037d5a79e475aba13ad470284925db886210b980d5669c3e9ddb128aae75bd881dd82692b563e224fbc4ffe04a8dd1b8311
@@ -62,6 +62,14 @@ module Convection
62
62
  resource "arn:aws:s3:::#{ bucket }"
63
63
  end
64
64
 
65
+ def sqs_resource(region, account, queue)
66
+ resource "arn:aws:sqs:#{ region }:#{ account }:#{ queue }"
67
+ end
68
+
69
+ def sns_resource(region, account, topic)
70
+ resource "arn:aws:sns:#{ region }:#{ account }:#{ topic }"
71
+ end
72
+
65
73
  def initialize(effect = 'Allow', template = nil)
66
74
  @effect = effect
67
75
 
@@ -0,0 +1,35 @@
1
+ require 'forwardable'
2
+ require_relative '../resource'
3
+
4
+ module Convection
5
+ module Model
6
+ class Template
7
+ class Resource
8
+ ##
9
+ # AWS::SNS::TopicPolicy
10
+ ##
11
+ class SNSTopicPolicy < Resource
12
+ extend Forwardable
13
+
14
+ type 'AWS::SNS::TopicPolicy'
15
+ property :topics, 'Topics'
16
+ attr_reader :document
17
+
18
+ def_delegators :@document, :allow, :id, :version, :statement
19
+ def_delegator :@document, :name, :policy_name
20
+
21
+ def initialize(*args)
22
+ super
23
+ @document = Model::Mixin::Policy.new(:name => false, :template => @template)
24
+ end
25
+
26
+ def render
27
+ super.tap do |r|
28
+ document.render(r['Properties'])
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Manero
@@ -412,6 +412,7 @@ files:
412
412
  - lib/convection/model/template/resource/aws_s3_bucket.rb
413
413
  - lib/convection/model/template/resource/aws_s3_bucket_policy.rb
414
414
  - lib/convection/model/template/resource/aws_sns_topic.rb
415
+ - lib/convection/model/template/resource/aws_sns_topic_policy.rb
415
416
  - lib/convection/model/template/resource/aws_sqs_queue.rb
416
417
  - lib/convection/model/template/resource/aws_sqs_queue_policy.rb
417
418
  - lib/convection/version.rb