Class: Convection::Model::Template::Resource::SQSQueuePolicy

Inherits:
Convection::Model::Template::Resource show all
Extended by:
Forwardable
Defined in:
lib/convection/model/template/resource/aws_sqs_queue_policy.rb

Overview

Examples:

sqs_queue_policy 'QueuePolicy' do
  queue "my-queue"
  allow do
    principal '*'
    sqs_resource my_region, , "my-queue"
    action 'sqs:SendMessage'
    condition :ArnEquals => { "AWS:SourceArn" => "arn:aws:sns:...." }
  end
end

See Also:

Instance Attribute Summary collapse

Attributes inherited from Convection::Model::Template::Resource

#exist, #name, #parent, #properties, #resource_attributes, #template

Instance Method Summary collapse

Methods inherited from Convection::Model::Template::Resource

#as_attribute, attach_method, #deletion_policy, #depends_on, properties, #property, property, #reference, type, #type, #with_output

Methods included from Mixin::Conditional

#condition, #render_condition

Methods included from DSL::Template::Resource

attach_resource

Methods included from DSL::Helpers

#camel_case, included, method_name, #screaming_snake_case, #snake_case

Methods included from DSL::IntrinsicFunctions

#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_not, #fn_or, #fn_ref, #get_att, #get_azs, #join, #select

Constructor Details

#initialize(*args) ⇒ SQSQueuePolicy

Returns a new instance of SQSQueuePolicy



28
29
30
31
# File 'lib/convection/model/template/resource/aws_sqs_queue_policy.rb', line 28

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

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document



23
24
25
# File 'lib/convection/model/template/resource/aws_sqs_queue_policy.rb', line 23

def document
  @document
end

Instance Method Details

#queueObject #queue(value) ⇒ Object

Overloads:

  • #queueObject

    Returns the value of the 'Queues' CloudFormation property.

  • #queue(value) ⇒ Object

    Sets the 'Queues' CloudFormation property.

    Parameters:

    • value

      the value to set the 'Queues' CloudFormation property to.



22
# File 'lib/convection/model/template/resource/aws_sqs_queue_policy.rb', line 22

property :queue, 'Queues', :type => :list

#renderObject



33
34
35
36
37
# File 'lib/convection/model/template/resource/aws_sqs_queue_policy.rb', line 33

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