Sha256: 03d469284fa467897324a53b5941da62b087e72f88ef47804fcd30004f3ba6fe

Contents?: true

Size: 1.11 KB

Versions: 67

Compression:

Stored size: 1.11 KB

Contents

require 'forwardable'
require_relative '../resource'

module Convection
  module Model
    class Template
      class Resource
        # @example
        #   sqs_queue_policy 'QueuePolicy' do
        #     queue "my-queue"
        #     allow do
        #       principal '*'
        #       sqs_resource my_region, my_account, "my-queue"
        #       action 'sqs:SendMessage'
        #       condition :ArnEquals => { "AWS:SourceArn" => "arn:aws:sns:...." }
        #     end
        #   end
        class SQSQueuePolicy < Resource
          extend Forwardable

          type 'AWS::SQS::QueuePolicy'
          property :queue, 'Queues', :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-2.3.1 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.3.0 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.29 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.28.pre.beta.2 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.28.pre.beta.1 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.27 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.26 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.25 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.24 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.23 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.22 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.21 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.20 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.19 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.18 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.17 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.16 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.15 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.14 lib/convection/model/template/resource/aws_sqs_queue_policy.rb
convection-2.2.13 lib/convection/model/template/resource/aws_sqs_queue_policy.rb