{
  "typeName" : "AWS::Connect::IntegrationAssociation",
  "description" : "Resource Type definition for AWS::Connect::IntegrationAssociation",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-connect",
  "definitions" : {
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "description" : "The key name of the tag.",
          "type" : "string",
          "pattern" : "^(?!aws:)[a-zA-Z+-=._:/]+$",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "description" : "The value for the tag.",
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "additionalProperties" : false,
      "required" : [ "Key", "Value" ]
    },
    "IntegrationArn" : {
      "description" : "ARN of Integration being associated with the instance",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 140
    },
    "IntegrationType" : {
      "description" : "Specifies the integration type to be associated with the instance",
      "type" : "string",
      "enum" : [ "LEX_BOT", "LAMBDA_FUNCTION", "APPLICATION", "CASES_DOMAIN", "WISDOM_ASSISTANT", "WISDOM_KNOWLEDGE_BASE", "WISDOM_QUICK_RESPONSES", "FILE_SCANNER", "MESSAGE_PROCESSOR", "Q_MESSAGE_TEMPLATES", "SES_IDENTITY" ]
    },
    "InstanceId" : {
      "description" : "Amazon Connect instance identifier",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$",
      "minLength" : 1,
      "maxLength" : 100
    },
    "IntegrationAssociationId" : {
      "description" : "Identifier of the association with Connect Instance",
      "type" : "string"
    }
  },
  "properties" : {
    "IntegrationAssociationId" : {
      "$ref" : "#/definitions/IntegrationAssociationId"
    },
    "InstanceId" : {
      "$ref" : "#/definitions/InstanceId"
    },
    "IntegrationArn" : {
      "$ref" : "#/definitions/IntegrationArn"
    },
    "IntegrationType" : {
      "$ref" : "#/definitions/IntegrationType"
    },
    "Tags" : {
      "description" : "The tags used to organize, track, or control access for this resource.",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "minItems" : 0,
      "maxItems" : 200
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "connect:TagResource", "connect:UntagResource", "connect:ListTagsForResource" ]
  },
  "additionalProperties" : false,
  "required" : [ "InstanceId", "IntegrationType", "IntegrationArn" ],
  "readOnlyProperties" : [ "/properties/IntegrationAssociationId" ],
  "createOnlyProperties" : [ "/properties/InstanceId", "/properties/IntegrationArn", "/properties/IntegrationType" ],
  "primaryIdentifier" : [ "/properties/InstanceId", "/properties/IntegrationType", "/properties/IntegrationArn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "connect:DescribeInstance", "ds:DescribeDirectories", "app-integrations:CreateEventIntegrationAssociation", "mobiletargeting:GetApp", "cases:GetDomain", "wisdom:GetAssistant", "wisdom:GetKnowledgeBase", "wisdom:GetQuickResponse", "wisdom:GetMessageTemplate", "wisdom:TagResource", "voiceid:DescribeDomain", "events:PutTargets", "ses:GetIdentityVerificationAttributes", "events:PutRule", "connect:AssociateBot", "connect:AssociateLambdaFunction", "connect:CreateIntegrationAssociation", "connect:TagResource", "connect:ListBots", "connect:ListLambdaFunctions", "connect:ListIntegrationAssociations", "lambda:addPermission", "lex:GetBot", "lex:DescribeBotAlias", "lex:CreateResourcePolicy", "lex:UpdateResourcePolicy", "lex:CreateResourcePolicyStatement", "lambda:AddPermission", "app-integrations:GetApplication", "app-integrations:CreateApplicationAssociation", "iam:AttachRolePolicy", "iam:CreateServiceLinkedRole", "iam:GetRolePolicy", "iam:PutRolePolicy" ]
    },
    "read" : {
      "permissions" : [ "connect:ListBots", "connect:ListLambdaFunctions", "connect:ListIntegrationAssociations", "connect:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "connect:TagResource", "connect:UntagResource", "connect:ListTagsForResource", "connect:ListIntegrationAssociations" ]
    },
    "delete" : {
      "permissions" : [ "connect:DescribeInstance", "ds:DescribeDirectories", "app-integrations:DeleteEventIntegrationAssociation", "app-integrations:DeleteApplicationAssociation", "events:ListTargetsByRule", "events:RemoveTargets", "events:DeleteRule", "connect:DisassociateBot", "connect:DisassociateLambdaFunction", "connect:DeleteIntegrationAssociation", "connect:ListBots", "connect:ListLambdaFunctions", "connect:ListIntegrationAssociations", "lex:DeleteResourcePolicy", "lex:DeleteResourcePolicyStatement", "lambda:RemovePermission", "iam:GetRolePolicy", "iam:DeleteRolePolicy", "iam:PutRolePolicy" ]
    },
    "list" : {
      "permissions" : [ "connect:ListBots", "connect:ListLambdaFunctions", "connect:ListIntegrationAssociations", "connect:ListTagsForResource" ],
      "handlerSchema" : {
        "properties" : {
          "InstanceId" : {
            "$ref" : "resource-schema.json#/properties/InstanceId"
          }
        },
        "required" : [ "InstanceId" ]
      }
    }
  }
}