  def DisassociateInstanceProfile(
      self,
      assoc_id: str) -> None:
    """Remove an instance profile attachment from an instance.

    Args:
      assoc_id (str): The instance profile association ID. Can be retrieved via
        ec2.GetInstanceProfileAttachment.

    Raises:
      ResourceNotFoundError: If the assoc_id cannot be found.
    """
    try:
      client = self.aws_account.ClientApi(common.EC2_SERVICE)
      client.disassociate_iam_instance_profile(AssociationId=assoc_id)
    except client.exceptions.ClientError as exception:
      raise errors.ResourceNotFoundError(
        'AssociationID {0:s} not found: {1!s}'.format(assoc_id,
           exception), __name__) from exception
Remove an instance profile attachment from an instance.

Args:
assoc_id (str): The instance profile association ID. Can be retrieved via
ec2.GetInstanceProfileAttachment.

Raises:
ResourceNotFoundError: If the assoc_id cannot be found.
libcloudforensics/providers/aws/internal/ec2.py