Sha256: 07f7bf94286ed84c6b41a9c45370ff40122b6d80509cd7463dcaf0d4fcda278d
Contents?: true
Size: 1.25 KB
Versions: 40
Compression:
Stored size: 1.25 KB
Contents
module Awspec::Helper module Finder module SecurityGroup def find_security_group(id) res = @ec2_client.describe_security_groups({ filters: [{ name: 'group-id', values: [id] }] }) return res[:security_groups].first if res[:security_groups].count == 1 res = @ec2_client.describe_security_groups({ filters: [{ name: 'group-name', values: [id] }] }) return res[:security_groups].first if res[:security_groups].count == 1 res = @ec2_client.describe_security_groups({ filters: [{ name: 'tag:Name', values: [id] }] }) return res[:security_groups].first if res[:security_groups].count == 1 end def select_security_group_by_vpc_id(vpc_id) res = @ec2_client.describe_security_groups({ filters: [{ name: 'vpc-id', values: [vpc_id] }] }) res[:security_groups] end end end end
Version data entries
40 entries across 40 versions & 1 rubygems