All Downloads are FREE. Search and download functionalities are using the official Maven repository.

essentialworkflows.sf_create_structureDefinition.json Maven / Gradle / Ivy

The newest version!
{
  "name": "createStructureDefinition",
  "allowedRoles": ["ADMIN", "UNMANNED"],
  "workflowVersion": 1,
  "functionDefinition": {
    "Comment": "A description of my state machine",
    "StartAt": "Validate Create Entity",
    "States": {
      "Validate Create Entity": {
        "Type": "Task",
        "Resource": "arn:aws:states:::states:startExecution.sync",
        "Parameters": {
          "StateMachineArn": "arn:aws:states:ap-southeast-2:705130463218:stateMachine:${var.environment}_validateCreateStructureDefinition",
          "Input": {
            "NeedCallback ": true,
            "query.$": "$.query",
            "AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID.$": "$$.Execution.Id"
          }
        },
        "Next": "Delete Previous Entity",
        "ResultPath": "$.input.validateCreateStructureDefinition"
      },
      "Delete Previous Entity": {
        "Type": "Task",
        "ResultPath": "$.input.deletePreviousEntity",
        "Resource": "arn:aws:states:::apigateway:invoke",
        "Parameters": {
          "ApiEndpoint": "${var.structureEndpoint}",
          "Path": "/structure/destroy-structure-type",
          "Method": "POST",
          "Headers": {
            "Content-Type": [
              "application/json"
            ]
          },
          "RequestBody": {
            "type.$":  "$.query.type"
          },
          "AuthType": "IAM_ROLE"
        },
        "Next": "Save Entity"
      },
      "Save Entity": {
        "Type": "Task",
        "ResultPath": "$.input.saveEntity",
        "Resource": "arn:aws:states:::apigateway:invoke",
        "Parameters": {
          "ApiEndpoint": "${var.structureEndpoint}",
          "Path": "/structure/insert",
          "Method": "POST",
          "Headers": {
            "Content-Type": [
              "application/json"
            ]
          },
          "RequestBody": {
            "username.$": "$.query.authorization.username",
            "type": "structureDefinition",
            "query": {
              "type.$": "$.query.type",
              "definition.$": "$.query.definition"
            }
          },
          "AuthType": "IAM_ROLE"
        },
        "Next": "Recreate Entity Table"
      },
      "Recreate Entity Table": {
        "Type": "Task",
        "ResultPath": "$.input.saveEntity",
        "Resource": "arn:aws:states:::apigateway:invoke",
        "Parameters": {
          "ApiEndpoint": "${var.structureEndpoint}",
          "Path": "/structure/create-structure",
          "Method": "POST",
          "Headers": {
            "Content-Type": [
              "application/json"
            ]
          },
          "RequestBody": {
            "type.$": "$.query.type"
          },
          "AuthType": "IAM_ROLE"
        },
        "End": true
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy