{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/BucketName",
  "/properties/LocationName",
  "/properties/DataRedundancy"
 ],
 "definitions": {
  "AbortIncompleteMultipartUpload": {
   "additionalProperties": false,
   "properties": {
    "DaysAfterInitiation": {
     "minimum": 0,
     "type": "integer"
    }
   },
   "required": [
    "DaysAfterInitiation"
   ],
   "type": "object"
  },
  "Arn": {
   "type": "string"
  },
  "BucketEncryption": {
   "additionalProperties": false,
   "properties": {
    "ServerSideEncryptionConfiguration": {
     "insertionOrder": true,
     "items": {
      "$ref": "#/definitions/ServerSideEncryptionRule"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "required": [
    "ServerSideEncryptionConfiguration"
   ],
   "type": "object"
  },
  "Destination": {
   "additionalProperties": false,
   "properties": {
    "BucketAccountId": {
     "type": "string"
    },
    "BucketArn": {
     "type": "string"
    },
    "Format": {
     "enum": [
      "CSV",
      "ORC",
      "Parquet"
     ],
     "type": "string"
    },
    "Prefix": {
     "type": "string"
    }
   },
   "required": [
    "BucketArn",
    "Format"
   ],
   "type": "object"
  },
  "InventoryConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Destination": {
     "$ref": "#/definitions/Destination"
    },
    "Enabled": {
     "type": "boolean"
    },
    "Id": {
     "type": "string"
    },
    "IncludedObjectVersions": {
     "enum": [
      "All",
      "Current"
     ],
     "type": "string"
    },
    "OptionalFields": {
     "insertionOrder": true,
     "items": {
      "enum": [
       "Size",
       "LastModifiedDate",
       "StorageClass",
       "ETag",
       "IsMultipartUploaded",
       "EncryptionStatus",
       "BucketKeyStatus",
       "ChecksumAlgorithm",
       "LifecycleExpirationDate"
      ],
      "type": "string"
     },
     "type": "array",
     "uniqueItems": true
    },
    "Prefix": {
     "type": "string"
    },
    "ScheduleFrequency": {
     "enum": [
      "Daily",
      "Weekly"
     ],
     "type": "string"
    }
   },
   "required": [
    "Destination",
    "Enabled",
    "Id",
    "IncludedObjectVersions",
    "ScheduleFrequency"
   ],
   "type": "object"
  },
  "LifecycleConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Rules": {
     "insertionOrder": true,
     "items": {
      "$ref": "#/definitions/Rule"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "required": [
    "Rules"
   ],
   "type": "object"
  },
  "MetricsConfiguration": {
   "additionalProperties": false,
   "properties": {
    "AccessPointArn": {
     "type": "string"
    },
    "Id": {
     "type": "string"
    },
    "Prefix": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "Rule": {
   "additionalProperties": false,
   "properties": {
    "AbortIncompleteMultipartUpload": {
     "$ref": "#/definitions/AbortIncompleteMultipartUpload"
    },
    "ExpirationInDays": {
     "type": "integer"
    },
    "Id": {
     "maxLength": 255,
     "type": "string"
    },
    "ObjectSizeGreaterThan": {
     "maxLength": 20,
     "pattern": "[0-9]+",
     "type": "string"
    },
    "ObjectSizeLessThan": {
     "maxLength": 20,
     "pattern": "[0-9]+",
     "type": "string"
    },
    "Prefix": {
     "type": "string"
    },
    "Status": {
     "enum": [
      "Enabled",
      "Disabled"
     ],
     "type": "string"
    }
   },
   "required": [
    "Status"
   ],
   "type": "object"
  },
  "ServerSideEncryptionByDefault": {
   "additionalProperties": false,
   "properties": {
    "KMSMasterKeyID": {
     "anyOf": [
      {
       "format": "AWS::KMS::Key.Arn"
      },
      {
       "format": "AWS::KMS::Key.Id"
      },
      {
       "format": "AWS::KMS::Alias.AliasName"
      }
     ],
     "type": "string"
    },
    "SSEAlgorithm": {
     "enum": [
      "aws:kms",
      "AES256"
     ],
     "type": "string"
    }
   },
   "required": [
    "SSEAlgorithm"
   ],
   "type": "object"
  },
  "ServerSideEncryptionRule": {
   "additionalProperties": false,
   "properties": {
    "BucketKeyEnabled": {
     "type": "boolean"
    },
    "ServerSideEncryptionByDefault": {
     "$ref": "#/definitions/ServerSideEncryptionByDefault"
    }
   },
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "pattern": "^(?!aws:.*)([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$",
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "minLength": 0,
     "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$",
     "type": "string"
    }
   },
   "required": [
    "Key",
    "Value"
   ],
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/BucketName"
 ],
 "properties": {
  "Arn": {
   "$ref": "#/definitions/Arn",
   "examples": [
    "arn:aws:s3express:us-west-2:123456789123:bucket/DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"
   ]
  },
  "AvailabilityZoneName": {
   "examples": [
    "us-east-1f"
   ],
   "type": "string"
  },
  "BucketEncryption": {
   "$ref": "#/definitions/BucketEncryption"
  },
  "BucketName": {
   "format": "AWS::S3::Bucket.Name",
   "maxLength": 63,
   "pattern": "^[a-z0-9][a-z0-9//.//-]*[a-z0-9]$",
   "type": "string"
  },
  "DataRedundancy": {
   "enum": [
    "SingleAvailabilityZone",
    "SingleLocalZone"
   ],
   "type": "string"
  },
  "InventoryConfigurations": {
   "insertionOrder": true,
   "items": {
    "$ref": "#/definitions/InventoryConfiguration"
   },
   "type": "array",
   "uniqueItems": true
  },
  "LifecycleConfiguration": {
   "$ref": "#/definitions/LifecycleConfiguration"
  },
  "LocationName": {
   "type": "string"
  },
  "MetricsConfigurations": {
   "insertionOrder": true,
   "items": {
    "$ref": "#/definitions/MetricsConfiguration"
   },
   "type": "array",
   "uniqueItems": true
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "type": "array",
   "uniqueItems": true
  }
 },
 "readOnlyProperties": [
  "/properties/Arn",
  "/properties/AvailabilityZoneName"
 ],
 "required": [
  "LocationName",
  "DataRedundancy"
 ],
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::S3Express::DirectoryBucket"
}
