{
  "typeName" : "AWS::Timestream::Table",
  "description" : "The AWS::Timestream::Table resource creates a Timestream Table.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-timestream.git",
  "definitions" : {
    "Tag" : {
      "description" : "You can use the Resource Tags property to apply tags to resources, which can help you identify and categorize those resources.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Arn" : {
      "type" : "string"
    },
    "Name" : {
      "description" : "The table name exposed as a read-only attribute.",
      "type" : "string"
    },
    "DatabaseName" : {
      "description" : "The name for the database which the table to be created belongs to.",
      "type" : "string",
      "pattern" : "^[a-zA-Z0-9_.-]{3,256}$"
    },
    "TableName" : {
      "description" : "The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.",
      "type" : "string",
      "pattern" : "^[a-zA-Z0-9_.-]{3,256}$"
    },
    "RetentionProperties" : {
      "description" : "The retention duration of the memory store and the magnetic store.",
      "type" : "object",
      "properties" : {
        "MemoryStoreRetentionPeriodInHours" : {
          "description" : "The duration for which data must be stored in the memory store.",
          "type" : "string"
        },
        "MagneticStoreRetentionPeriodInDays" : {
          "description" : "The duration for which data must be stored in the magnetic store.",
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "MagneticStoreWriteProperties" : {
      "description" : "The properties that determine whether magnetic store writes are enabled.",
      "type" : "object",
      "properties" : {
        "EnableMagneticStoreWrites" : {
          "description" : "Boolean flag indicating whether magnetic store writes are enabled.",
          "type" : "boolean"
        },
        "MagneticStoreRejectedDataLocation" : {
          "description" : "Location to store information about records that were asynchronously rejected during magnetic store writes.",
          "type" : "object",
          "properties" : {
            "S3Configuration" : {
              "description" : "S3 configuration for location to store rejections from magnetic store writes",
              "type" : "object",
              "properties" : {
                "BucketName" : {
                  "description" : "The bucket name used to store the data.",
                  "type" : "string"
                },
                "ObjectKeyPrefix" : {
                  "description" : "String used to prefix all data in the bucket.",
                  "type" : "string"
                },
                "EncryptionOption" : {
                  "description" : "Either SSE_KMS or SSE_S3.",
                  "type" : "string"
                },
                "KmsKeyId" : {
                  "description" : "Must be provided if SSE_KMS is specified as the encryption option",
                  "type" : "string"
                }
              },
              "required" : [ "EncryptionOption", "BucketName" ],
              "additionalProperties" : false
            }
          },
          "additionalProperties" : false
        }
      },
      "required" : [ "EnableMagneticStoreWrites" ],
      "additionalProperties" : false
    },
    "Tags" : {
      "description" : "An array of key-value pairs to apply to this resource.",
      "type" : "array",
      "maxItems" : 200,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "required" : [ "DatabaseName" ],
  "primaryIdentifier" : [ "/properties/DatabaseName", "/properties/TableName" ],
  "createOnlyProperties" : [ "/properties/DatabaseName", "/properties/TableName" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/Name" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "timestream:CreateTable", "timestream:DescribeEndpoints" ]
    },
    "read" : {
      "permissions" : [ "timestream:DescribeTable", "timestream:DescribeEndpoints", "timestream:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "timestream:UpdateTable", "timestream:DescribeEndpoints", "timestream:TagResource", "timestream:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "timestream:DeleteTable", "timestream:DescribeEndpoints" ]
    },
    "list" : {
      "permissions" : [ "timestream:ListTables", "timestream:DescribeEndpoints" ]
    }
  }
}