4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/awspec/helper/finder/security_group.rb', line 4
def find_security_group(sg_id)
res = ec2_client.describe_security_groups({
filters: [{ name: 'group-id', values: [sg_id] }]
})
resource = res.security_groups.single_resource(sg_id)
return resource if resource
res = ec2_client.describe_security_groups({
filters: [{ name: 'group-name', values: [sg_id] }]
})
resource = res.security_groups.single_resource(sg_id)
return resource if resource
res = ec2_client.describe_security_groups({
filters: [{ name: 'tag:Name', values: [sg_id] }]
})
res.security_groups.single_resource(sg_id)
end
|