func()

in internal/inventory/awsfetcher/fetcher_networking.go [113:139]


func (s *networkingFetcher) retrieveId(awsResource awslib.AwsResource) *string {
	switch resource := awsResource.(type) {
	case *ec2.InternetGatewayInfo:
		return resource.InternetGateway.InternetGatewayId
	case *ec2.NatGatewayInfo:
		return resource.NatGateway.NatGatewayId
	case *ec2.NACLInfo:
		return resource.NetworkAclId
	case *ec2.NetworkInterfaceInfo:
		return resource.NetworkInterface.NetworkInterfaceId
	case *ec2.SecurityGroup:
		return resource.GroupId
	case *ec2.SubnetInfo:
		return resource.Subnet.SubnetId
	case *ec2.TransitGatewayAttachmentInfo:
		return resource.TransitGatewayAttachment.TransitGatewayAttachmentId
	case *ec2.TransitGatewayInfo:
		return resource.TransitGateway.TransitGatewayId
	case *ec2.VpcPeeringConnectionInfo:
		return resource.VpcPeeringConnection.VpcPeeringConnectionId
	case *ec2.VpcInfo:
		return resource.Vpc.VpcId
	default:
		s.logger.Warnf("Unsupported Networking Fetcher type %T (id)", resource)
		return nil
	}
}