public ResourceScanMetadata withEc2(Ec2Metadata ec2) {
        setEc2(ec2);
        return this;
    }
<p>
An object that contains metadata details for an Amazon EC2 instance.
</p>

@param ec2
       An object that contains metadata details for an Amazon EC2 instance.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-inspector2/src/main/java/com/amazonaws/services/inspector2/model/ResourceScanMetadata.java