def action_attach(self):
        vol = self._determine_volume()
        
        if vol.status == "in-use":
            if vol.attach_data.instance_id != self.resource.env.config.aws.instance_id:
                raise Fail("Volume with id %s exists but is attached to instance %s" % (vol.id, vol.attach_data.instance_id))
            else:
                self.log.debug("Volume is already attached")
        else:
            self._attach_volume(vol, self.resource.env.config.aws.instance_id, self.resource.device, self.resource.timeout)
            self.resource.updated()
dataset/ETHPy150Open samuel/kokki/kokki/cookbooks/aws/libraries/providers.py/EBSVolumeProvider.action_attach/original