class Awspec::Type::Mq

Constants

STATES

Public Instance Methods

has_security_group?(sg_id) click to toggle source
# File lib/awspec/type/mq.rb, line 24
def has_security_group?(sg_id)
  return true if has_vpc_security_group_id?(sg_id)
  return true if has_vpc_security_group_name?(sg_id)
  return true if has_vpc_security_group_tag_name?(sg_id)
end
has_tag?(tag_key, tag_value) click to toggle source
# File lib/awspec/type/mq.rb, line 30
def has_tag?(tag_key, tag_value)
  @resource_via_client.tags do |tag|
    tag.key == tag_key && tag.value == tag_value
  end
end
id() click to toggle source
# File lib/awspec/type/mq.rb, line 9
def id
  @id ||= resource_via_client.broker_id if resource_via_client
end
resource_via_client() click to toggle source
# File lib/awspec/type/mq.rb, line 5
def resource_via_client
  @resource_via_client ||= find_broker(@display_name)
end

Private Instance Methods

has_vpc_security_group_id?(sg_id) click to toggle source
# File lib/awspec/type/mq.rb, line 38
def has_vpc_security_group_id?(sg_id)
  sgs = @resource_via_client.security_groups
  sgs.find do |sg|
    sg == sg_id
  end
end
has_vpc_security_group_name?(sg_id) click to toggle source
# File lib/awspec/type/mq.rb, line 45
def has_vpc_security_group_name?(sg_id)
  res = select_security_group_by_group_name([sg_id])

  return false unless res.count == 1

  has_vpc_security_group_id?(res.first.group_id)
end
has_vpc_security_group_tag_name?(sg_id) click to toggle source
# File lib/awspec/type/mq.rb, line 53
def has_vpc_security_group_tag_name?(sg_id)
  res = select_security_group_by_tag_name([sg_id])

  return false unless res.count == 1

  has_vpc_security_group_id?(res.first.group_id)
end