{
  "typeName" : "AWS::AppIntegrations::DataIntegration",
  "description" : "Resource Type definition for AWS::AppIntegrations::DataIntegration",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "definitions" : {
    "ScheduleConfig" : {
      "type" : "object",
      "properties" : {
        "FirstExecutionFrom" : {
          "description" : "The start date for objects to import in the first flow run. Epoch or ISO timestamp format is supported.",
          "type" : "string",
          "pattern" : ".*\\S.*",
          "minLength" : 1,
          "maxLength" : 255
        },
        "Object" : {
          "description" : "The name of the object to pull from the data source.",
          "type" : "string",
          "pattern" : "^[a-zA-Z0-9/\\._\\-]+$",
          "minLength" : 1,
          "maxLength" : 255
        },
        "ScheduleExpression" : {
          "description" : "How often the data should be pulled from data source.",
          "type" : "string",
          "pattern" : ".*\\S.*",
          "minLength" : 1,
          "maxLength" : 255
        }
      },
      "additionalProperties" : false,
      "required" : [ "FirstExecutionFrom", "Object", "ScheduleExpression" ]
    },
    "Tag" : {
      "description" : "A label for tagging DataIntegration resources",
      "type" : "object",
      "properties" : {
        "Key" : {
          "description" : "A key to identify the tag.",
          "type" : "string",
          "pattern" : "^(?!aws:)[a-zA-Z+-=._:/]+$",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "description" : "Corresponding tag value for the key.",
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "additionalProperties" : false,
      "required" : [ "Key", "Value" ]
    }
  },
  "properties" : {
    "Description" : {
      "description" : "The data integration description.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1000
    },
    "Id" : {
      "description" : "The unique identifer of the data integration.",
      "type" : "string",
      "pattern" : "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
      "minLength" : 1,
      "maxLength" : 255
    },
    "DataIntegrationArn" : {
      "description" : "The Amazon Resource Name (ARN) of the data integration.",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z]*:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$",
      "minLength" : 1,
      "maxLength" : 2048
    },
    "Name" : {
      "description" : "The name of the data integration.",
      "type" : "string",
      "pattern" : "^[a-zA-Z0-9/\\._\\-]+$",
      "minLength" : 1,
      "maxLength" : 255
    },
    "KmsKey" : {
      "description" : "The KMS key of the data integration.",
      "type" : "string",
      "pattern" : ".*\\S.*",
      "minLength" : 1,
      "maxLength" : 255
    },
    "ScheduleConfig" : {
      "description" : "The name of the data and how often it should be pulled from the source.",
      "$ref" : "#/definitions/ScheduleConfig"
    },
    "SourceURI" : {
      "description" : "The URI of the data source.",
      "type" : "string",
      "pattern" : "^\\w+\\:\\/\\/\\w+\\/[\\w/!@#+=.-]+$",
      "minLength" : 1,
      "maxLength" : 255
    },
    "Tags" : {
      "description" : "The tags (keys and values) associated with the data integration.",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "minItems" : 0,
      "maxItems" : 200
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags"
  },
  "additionalProperties" : false,
  "required" : [ "Name", "KmsKey", "ScheduleConfig", "SourceURI" ],
  "readOnlyProperties" : [ "/properties/Id", "/properties/DataIntegrationArn" ],
  "createOnlyProperties" : [ "/properties/KmsKey", "/properties/ScheduleConfig", "/properties/SourceURI" ],
  "primaryIdentifier" : [ "/properties/Id" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "app-integrations:CreateDataIntegration", "app-integrations:TagResource", "appflow:DescribeConnectorProfiles", "appflow:CreateFlow", "appflow:DeleteFlow", "appflow:DescribeConnectorEntity", "appflow:UseConnectorProfile", "appflow:TagResource", "appflow:UntagResource", "kms:CreateGrant", "kms:DescribeKey", "kms:ListAliases", "kms:ListGrants", "kms:ListKeys" ]
    },
    "read" : {
      "permissions" : [ "app-integrations:GetDataIntegration", "app-integrations:ListTagsForResource" ]
    },
    "list" : {
      "permissions" : [ "app-integrations:ListDataIntegrations" ]
    },
    "update" : {
      "permissions" : [ "app-integrations:GetDataIntegration", "app-integrations:UpdateDataIntegration", "app-integrations:TagResource", "app-integrations:UntagResource", "appflow:DescribeConnectorProfiles", "appflow:DeleteFlow", "appflow:DescribeConnectorEntity", "appflow:UseConnectorProfile", "appflow:TagResource", "appflow:UntagResource", "kms:CreateGrant", "kms:DescribeKey", "kms:ListAliases", "kms:ListGrants", "kms:ListKeys" ]
    },
    "delete" : {
      "permissions" : [ "app-integrations:DeleteDataIntegration", "app-integrations:UntagResource", "appflow:CreateFlow", "appflow:DeleteFlow", "appflow:DescribeConnectorEntity", "appflow:UseConnectorProfile", "appflow:TagResource", "appflow:UntagResource", "kms:CreateGrant", "kms:DescribeKey", "kms:ListAliases", "kms:ListGrants", "kms:ListKeys" ]
    }
  }
}