Skip to content

Commit

Permalink
Parse all targets from AWS Config
Browse files Browse the repository at this point in the history
Parse all targets from AWS Config
  • Loading branch information
Ladas committed Mar 3, 2017
1 parent b9bcede commit c7a8076
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,26 @@ def self.collect_cloudwatch_ec2_references!(available_targets, event)
end

def self.collect_config_references!(available_targets, event)
add_ref(available_targets, Vm, parse_vm_ref(event.full_data)) if parse_vm_ref(event.full_data)
resource_type = event.fetch_path("configurationItem", "resourceType")
resource_id = event.fetch_path("configurationItem", "resourceId")
target_class = case resource_type
when "AWS::EC2::Instance"
Vm
when "AWS::EC2::SecurityGroup"
SecurityGroup
when "AWS::EC2::Volume"
CloudVolume
when "AWS::EC2::NetworkInterface"
NetworkPort
when "AWS::EC2::VPC"
CloudNetwork
when "AWS::EC2::Subnet"
CloudSubnet
when "AWS::EC2::EIP"
FloatingIp
end

add_ref(available_targets, target_class, resource_id) if target_class && resource_id
end

def self.collect_cloudwatch_api_references!(available_targets, hash, depth = 0)
Expand Down

0 comments on commit c7a8076

Please sign in to comment.