automated-actions/AWS_EBS_VOLUME_LOST/SydneySummitDemo/aws_ebs_vol_lost_cfn.yaml [258:281]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                eventid = event["id"]
                volid = event["resources"][0]
                time = event['time']
                eventtime = time
                result = {}
                ec2client = boto3.client('ec2')
                resp = ec2client.describe_volumes( VolumeIds=[ volid ] )
                resp_volume =  resp['Volumes'][0]

                a = resp_volume['Attachments']
                if not a:
                    resp_volume['Attachment'] = {}
                    resp_volume['Attachment']['Device'] = "none"
                    resp_volume['Attachment']['AttachTime'] = "none"
                    resp_volume['Attachment']['InstanceId'] = "none"
                    resp_volume['Attachment']['State'] = "none"
                    resp_volume['Attachment']['DeleteOnTermination'] = "none"
                else:
                    resp_volumes_attachment = resp_volume['Attachments'][0]
                    resp_volume['Attachment'] = resp_volumes_attachment

                resp_volume.pop('Attachments', None)
                resp_volume['PhdEventTime'] = eventtime
                resp_volume['PhdEventId'] = eventid
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



automated-actions/AWS_EBS_VOLUME_LOST/stepbystep/step_3_stepfunctions_reinvent_workshop.yml [90:111]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                  eventid = event["id"]
                  volid = event["resources"][0]
                  time = event['time']
                  eventtime = time
                  result = {}
                  ec2client = boto3.client('ec2')
                  resp = ec2client.describe_volumes( VolumeIds=[ volid ] )
                  resp_volume =  resp['Volumes'][0]
                  a = resp_volume['Attachments']
                  if not a:
                      resp_volume['Attachment'] = {}
                      resp_volume['Attachment']['Device'] = "none" 
                      resp_volume['Attachment']['AttachTime'] = "none" 
                      resp_volume['Attachment']['InstanceId'] = "none" 
                      resp_volume['Attachment']['State'] = "none" 
                      resp_volume['Attachment']['DeleteOnTermination'] = "none" 
                  else:
                      resp_volumes_attachment = resp_volume['Attachments'][0]
                      resp_volume['Attachment'] = resp_volumes_attachment
                  resp_volume.pop('Attachments', None)
                  resp_volume['PhdEventTime'] = eventtime
                  resp_volume['PhdEventId'] = eventid
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



