source/services/custom-resource/ssm/OperationsConductor-CopySnapshot/automation_document.yaml [39:69]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Script: |-
        import boto3
        import json
        def script_handler(events, context):
          output = { "statusCode": 200 }
          sqs_msg_body = json.loads(events["SQSMsgBody"])

          if "ResourceId" not in sqs_msg_body:
            raise Exception("ResourceId was not found in the SQS Message Body.")

          output["resource_id"] = sqs_msg_body["ResourceId"]

          if "ResourceRegion" not in sqs_msg_body:
            raise Exception("ResourceRegion was not found in the SQS Message Body.")
          output["source_region"] = sqs_msg_body["ResourceRegion"]

          if "ResourceAccount" not in sqs_msg_body:
            raise Exception("ResourceAccount was not found in the SQS Message Body.")
          output["source_account_id"] = sqs_msg_body["ResourceAccount"]

          if "TargetTag" not in sqs_msg_body:
            raise Exception("TargetTag was not found in the SQS Message Body.")
          output["target_tag_name"] = sqs_msg_body["TargetTag"]

          if "TaskId" not in sqs_msg_body:
            raise Exception("TaskId was not found in the SQS Message Body.")
          output["task_id"] = sqs_msg_body["TaskId"]

          if "ParentExecutionId" not in sqs_msg_body:
            raise Exception("ParentExecutionId was not found in the SQS Message Body.")
          output["parent_execution_id"] = sqs_msg_body["ParentExecutionId"]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



source/services/custom-resource/ssm/OperationsConductor-CreateSnapshot/automation_document.yaml [34:64]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Script: |-
        import boto3
        import json
        def script_handler(events, context):
          output = { "statusCode": 200 }
          sqs_msg_body = json.loads(events["SQSMsgBody"])

          if "ResourceId" not in sqs_msg_body:
            raise Exception("ResourceId was not found in the SQS Message Body.")

          output["resource_id"] = sqs_msg_body["ResourceId"]

          if "ResourceRegion" not in sqs_msg_body:
            raise Exception("ResourceRegion was not found in the SQS Message Body.")
          output["source_region"] = sqs_msg_body["ResourceRegion"]

          if "ResourceAccount" not in sqs_msg_body:
            raise Exception("ResourceAccount was not found in the SQS Message Body.")
          output["source_account_id"] = sqs_msg_body["ResourceAccount"]

          if "TargetTag" not in sqs_msg_body:
            raise Exception("TargetTag was not found in the SQS Message Body.")
          output["target_tag_name"] = sqs_msg_body["TargetTag"]

          if "TaskId" not in sqs_msg_body:
            raise Exception("TaskId was not found in the SQS Message Body.")
          output["task_id"] = sqs_msg_body["TaskId"]

          if "ParentExecutionId" not in sqs_msg_body:
            raise Exception("ParentExecutionId was not found in the SQS Message Body.")
          output["parent_execution_id"] = sqs_msg_body["ParentExecutionId"]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



