in src/inventory/mappers.py [0:0]
def _do_mapping(self, config_resource: dict) -> List[InventoryData]:
data_list: List[InventoryData] = []
data = { "asset_type": self._get_asset_type_name(config_resource),
"unique_id": config_resource["arn"],
"is_virtual": "Yes",
"authenticated_scan_planned": "Yes",
"is_public": "Yes" if config_resource["configuration"]["scheme"] == "internet-facing" else "No",
# Classic ELBs have key of "vpcid" while V2 ELBs have key of "vpcId"
"network_id": config_resource["configuration"]["vpcId"] if "vpcId" in config_resource["configuration"] else config_resource["configuration"]["vpcid"],
"owner": _get_tag_value(config_resource["tags"], "owner") }
if len(ip_addresses := self._get_ip_addresses(config_resource["configuration"]["availabilityZones"])) > 0:
for ip_address in ip_addresses:
data = copy.deepcopy(data)
data["ip_address"] = ip_address
data_list.append(InventoryData(**data))
else:
data_list.append(InventoryData(**data))
return data_list