{
  "typeName" : "AWS::Athena::DataCatalog",
  "description" : "Resource schema for AWS::Athena::DataCatalog",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-athena.git",
  "definitions" : {
    "Tags" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Name" : {
      "description" : "The name of the data catalog to create. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters. ",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 256
    },
    "Description" : {
      "description" : "A description of the data catalog to be created. ",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1024
    },
    "Parameters" : {
      "description" : "Specifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type. ",
      "type" : "object",
      "patternProperties" : {
        ".*" : {
          "type" : "string",
          "maxLength" : 51200
        }
      },
      "additionalProperties" : false
    },
    "Tags" : {
      "description" : "A list of comma separated tags to add to the data catalog that is created. ",
      "$ref" : "#/definitions/Tags"
    },
    "Type" : {
      "description" : "The type of data catalog to create: LAMBDA for a federated catalog, GLUE for AWS Glue Catalog, or HIVE for an external hive metastore. FEDERATED is a federated catalog for which Athena creates the connection and the Lambda function for you based on the parameters that you pass.",
      "type" : "string",
      "enum" : [ "LAMBDA", "GLUE", "HIVE", "FEDERATED" ]
    },
    "Status" : {
      "description" : "The status of the creation or deletion of the data catalog. LAMBDA, GLUE, and HIVE data catalog types are created synchronously. Their status is either CREATE_COMPLETE or CREATE_FAILED. The FEDERATED data catalog type is created asynchronously.",
      "type" : "string",
      "enum" : [ "CREATE_IN_PROGRESS", "CREATE_COMPLETE", "CREATE_FAILED", "CREATE_FAILED_CLEANUP_IN_PROGRESS", "CREATE_FAILED_CLEANUP_COMPLETE", "CREATE_FAILED_CLEANUP_FAILED", "DELETE_IN_PROGRESS", "DELETE_COMPLETE", "DELETE_FAILED" ]
    },
    "ConnectionType" : {
      "description" : "The type of connection for a FEDERATED data catalog",
      "type" : "string"
    },
    "Error" : {
      "description" : "Text of the error that occurred during data catalog creation or deletion.",
      "type" : "string"
    }
  },
  "required" : [ "Name", "Type" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "athena:CreateDataCatalog", "athena:GetDataCatalog", "athena:TagResource", "s3:ListBucket", "glue:TagResource", "glue:CreateConnection", "glue:DeleteConnection", "glue:UpdateConnection", "serverlessrepo:CreateCloudFormationTemplate", "serverlessrepo:GetCloudFormationTemplate", "cloudformation:CreateStack", "cloudformation:DeleteStack", "cloudformation:DescribeStacks", "cloudformation:CreateChangeSet", "iam:AttachRolePolicy", "iam:DetachRolePolicy", "iam:DeleteRolePolicy", "iam:PutRolePolicy", "iam:CreateRole", "iam:TagRole", "iam:DeleteRole", "iam:GetRole", "iam:GetRolePolicy", "iam:PassRole", "lambda:DeleteFunction", "lambda:CreateFunction", "lambda:TagResource", "lambda:GetFunction", "ec2:DescribeSecurityGroups", "ec2:DescribeSubnets", "ec2:DescribeVpcs", "secretsmanager:ListSecrets", "glue:GetConnection", "ecr:BatchGetImage", "ecr:GetDownloadUrlForLayer" ]
    },
    "read" : {
      "permissions" : [ "athena:GetDataCatalog", "athena:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "athena:UpdateDataCatalog", "athena:TagResource", "athena:GetDataCatalog", "athena:UntagResource", "athena:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "athena:DeleteDataCatalog", "athena:GetDataCatalog", "glue:GetConnection", "glue:UpdateConnection", "cloudformation:DeleteStack", "cloudformation:DescribeStacks", "lambda:DeleteFunction", "iam:DeleteRole", "iam:DeleteRolePolicy", "iam:DetachRolePolicy", "s3:ListBucket" ]
    },
    "list" : {
      "permissions" : [ "athena:ListDataCatalogs" ]
    }
  },
  "primaryIdentifier" : [ "/properties/Name" ],
  "createOnlyProperties" : [ "/properties/Name" ],
  "additionalProperties" : false,
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "athena:UntagResource", "athena:TagResource", "athena:ListTagsForResource" ]
  }
}