source/services/custom-resource/ssm/OperationsConductor-CreateSnapshot/automation_document.yaml [188:257]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          return  { 'statusCode': 200 }
-   name: "REMOVE_MSG_FROM_RESOURCE_QUEUE"
    action: "aws:executeAwsApi"
    inputs: {
      "Service": "sqs",
      "Api": "DeleteMessage",
      "QueueUrl": "%%ResourceQueueUrl%%",
      "ReceiptHandle": "{{ SQSMsgReceiptHandle }}"
    }
-   name: "UPDATE_AUTOMATION_EXECUTION_RECORD"
    action: aws:executeAwsApi
    timeoutSeconds: 30
    description: "Updates the record of this automation execution in the Operations Conductor Automation Executions Table to mark it as successfully completed"
    inputs: {
      "Service": "dynamodb",
      "Api": "UpdateItem",
      "TableName": "%%AutomationExecutionsTableName%%",
      "Key": {
        "parentExecutionId": { "S": "{{ VALIDATE_MSG_CONTENTS.parent_execution_id }}" },
        "automationExecutionId": { "S": "{{ automation:EXECUTION_ID }}" }
      },
      "UpdateExpression": "SET #stat = :val1",
      "ExpressionAttributeNames": {
        "#stat": "status"
      },
      "ExpressionAttributeValues": {
        ":val1": { "S": "Success" }
      }
    }
-   name: "UPDATE_TASK_EXECUTIONS_RECORD"
    action: aws:executeAwsApi
    timeoutSeconds: 30
    description: "Updates the record for the overall execution of the Operations Conductor Task that spawned this automation"
    inputs: {
      "Service": "dynamodb",
      "Api": "UpdateItem",
      "TableName": "%%TaskExecutionsTableName%%",
      "Key": {
        "taskId": { "S": "{{ VALIDATE_MSG_CONTENTS.task_id }}" },
        "parentExecutionId": { "S": "{{ VALIDATE_MSG_CONTENTS.parent_execution_id }}" }
      },
      "UpdateExpression": "SET completedResourceCount = completedResourceCount + :incr, lastUpdateTime = :uptime",
      "ExpressionAttributeValues": {
        ":incr": { "N": "1" },
        ":uptime": { "S": "{{ global:DATE_TIME }}" }
      }
    }
-   name: "CHECK_FOR_TASK_EXECUTION_COMPLETION"
    action: aws:executeAwsApi
    timeoutSeconds: 30
    description: "Marks the overall task execution as Success if all resources have been successfully acted on"
    inputs: {
      "Service": "dynamodb",
      "Api": "UpdateItem",
      "TableName": "%%TaskExecutionsTableName%%",
      "Key": {
        "taskId": { "S": "{{ VALIDATE_MSG_CONTENTS.task_id }}" },
        "parentExecutionId": { "S": "{{ VALIDATE_MSG_CONTENTS.parent_execution_id }}" }
      },
      "UpdateExpression": "SET #s = :stat",
      "ConditionExpression": "completedResourceCount = totalResourceCount",
      "ExpressionAttributeNames": {
        "#s": "status"
      },
      "ExpressionAttributeValues": {
        ":stat": { "S": "Success" }
      }
    }
    onFailure: Continue
    isEnd: true
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



source/services/custom-resource/ssm/OperationsConductor-ResizeInstance/automation_document.yaml [681:750]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          return  { 'statusCode': 200 }
-   name: "REMOVE_MSG_FROM_RESOURCE_QUEUE"
    action: "aws:executeAwsApi"
    inputs: {
      "Service": "sqs",
      "Api": "DeleteMessage",
      "QueueUrl": "%%ResourceQueueUrl%%",
      "ReceiptHandle": "{{ SQSMsgReceiptHandle }}"
    }
-   name: "UPDATE_AUTOMATION_EXECUTION_RECORD"
    action: aws:executeAwsApi
    timeoutSeconds: 30
    description: "Updates the record of this automation execution in the Operations Conductor Automation Executions Table to mark it as successfully completed"
    inputs: {
      "Service": "dynamodb",
      "Api": "UpdateItem",
      "TableName": "%%AutomationExecutionsTableName%%",
      "Key": {
        "parentExecutionId": { "S": "{{ VALIDATE_MSG_CONTENTS.parent_execution_id }}" },
        "automationExecutionId": { "S": "{{ automation:EXECUTION_ID }}" }
      },
      "UpdateExpression": "SET #stat = :val1",
      "ExpressionAttributeNames": {
        "#stat": "status"
      },
      "ExpressionAttributeValues": {
        ":val1": { "S": "Success" }
      }
    }
-   name: "UPDATE_TASK_EXECUTIONS_RECORD"
    action: aws:executeAwsApi
    timeoutSeconds: 30
    description: "Updates the record for the overall execution of the Operations Conductor Task that spawned this automation"
    inputs: {
      "Service": "dynamodb",
      "Api": "UpdateItem",
      "TableName": "%%TaskExecutionsTableName%%",
      "Key": {
        "taskId": { "S": "{{ VALIDATE_MSG_CONTENTS.task_id }}" },
        "parentExecutionId": { "S": "{{ VALIDATE_MSG_CONTENTS.parent_execution_id }}" }
      },
      "UpdateExpression": "SET completedResourceCount = completedResourceCount + :incr, lastUpdateTime = :uptime",
      "ExpressionAttributeValues": {
        ":incr": { "N": "1" },
        ":uptime": { "S": "{{ global:DATE_TIME }}" }
      }
    }
-   name: "CHECK_FOR_TASK_EXECUTION_COMPLETION"
    action: aws:executeAwsApi
    timeoutSeconds: 30
    description: "Marks the overall task execution as Success if all resources have been successfully acted on"
    inputs: {
      "Service": "dynamodb",
      "Api": "UpdateItem",
      "TableName": "%%TaskExecutionsTableName%%",
      "Key": {
        "taskId": { "S": "{{ VALIDATE_MSG_CONTENTS.task_id }}" },
        "parentExecutionId": { "S": "{{ VALIDATE_MSG_CONTENTS.parent_execution_id }}" }
      },
      "UpdateExpression": "SET #s = :stat",
      "ConditionExpression": "completedResourceCount = totalResourceCount",
      "ExpressionAttributeNames": {
        "#s": "status"
      },
      "ExpressionAttributeValues": {
        ":stat": { "S": "Success" }
      }
    }
    onFailure: Continue
    isEnd: true
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



