Sha256: 2221b078c62ea2fda217077aceb5a14ab0d5adea381e1c46791544b22ceec34e

Contents?: true

Size: 1.14 KB

Versions: 67

Compression:

Stored size: 1.14 KB

Contents

require 'forwardable'
require_relative '../resource'

module Convection
  module Model
    class Template
      class Resource
        # @example
        #   sns_topic_policy 'TopicPolicy' do
        #     topic "my-sns-topic"
        #     allow do
        #       principal :Service => 's3.amazonaws.com'
        #       sns_resource my_region, my_account, "my-sns-topic"
        #       action 'sns:Publish'
        #       condition :ArnLike => { "AWS:SourceArn" => "arn:aws:s3:......." }
        #     end
        #   end
        class SNSTopicPolicy < Resource
          extend Forwardable

          type 'AWS::SNS::TopicPolicy'
          property :topic, 'Topics', :type => :list
          attr_reader :document

          def_delegators :@document, :allow, :id, :version, :statement
          def_delegator :@document, :name, :policy_name

          def initialize(*args)
            super
            @document = Model::Mixin::Policy.new(:name => false, :template => @template)
          end

          def render
            super.tap do |r|
              document.render(r['Properties'])
            end
          end
        end
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
convection-1.1.3 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.1.2 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.1.1 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.1.0 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.7 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.6 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.5 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.4 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.3 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.2 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.1 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.0.pre.beta.10 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.0.pre.beta.9 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.0.pre.beta.8 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.0.pre.beta.7 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.0.pre.beta.6 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.0.pre.beta.4 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-1.0.0.pre.beta.1 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-0.4.3 lib/convection/model/template/resource/aws_sns_topic_policy.rb
convection-0.4.2 lib/convection/model/template/resource/aws_sns_topic_policy.rb