class Awspec::Type::TransitGateway

Public Instance Methods

has_attachment?(att_id) click to toggle source
# File lib/awspec/type/transit_gateway.rb, line 20
def has_attachment?(att_id)
  atts = find_tgw_attachments_by_tgw_id(id)

  atts.any? do |att|
    att.transit_gateway_attachment_id == att_id || attachment_has_name?(att, att_id)
  end
end
id() click to toggle source
# File lib/awspec/type/transit_gateway.rb, line 12
def id
  @id ||= resource_via_client.transit_gateway_id if resource_via_client
end
options() click to toggle source
# File lib/awspec/type/transit_gateway.rb, line 16
def options
  resource_via_client.options
end
resource_via_client() click to toggle source
# File lib/awspec/type/transit_gateway.rb, line 8
def resource_via_client
  @resource_via_client ||= find_transit_gateway(@display_name)
end

Private Instance Methods

attachment_has_name?(attachment, name) click to toggle source
# File lib/awspec/type/transit_gateway.rb, line 30
def attachment_has_name?(attachment, name)
  if name.is_a?(Regexp)
    attachment.tags.any? { |tag| tag.key == 'Name' && (name =~ tag.value) }
  else
    attachment.tags.any? { |tag| tag.key == 'Name' && tag.value == name }
  end
end