{
  "typeName": "AWS::S3::Bucket",
  "description": "The AWS::S3::Bucket resource creates an Amazon S3 bucket.",
  "properties": {
    "BucketName": {
      "type": "string",
      "description": "A name for the bucket.",
      "minLength": 3,
      "maxLength": 63,
      "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$"
    },
    "Arn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the bucket."
    },
    "BucketEncryption": {
      "$ref": "#/definitions/BucketEncryption",
      "description": "Specifies default encryption for a bucket."
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Tag"
      },
      "description": "An arbitrary set of tags (key-value pairs) for this S3 bucket."
    },
    "VersioningConfiguration": {
      "$ref": "#/definitions/VersioningConfiguration",
      "description": "Enables multiple versions of all objects in this bucket."
    }
  },
  "definitions": {
    "BucketEncryption": {
      "type": "object",
      "description": "Specifies default encryption for a bucket using server-side encryption.",
      "properties": {
        "ServerSideEncryptionConfiguration": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Specifies the default server-side-encryption configuration."
        }
      },
      "required": ["ServerSideEncryptionConfiguration"]
    },
    "Tag": {
      "type": "object",
      "description": "A key-value pair to associate with a resource.",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key name of the tag.",
          "minLength": 1,
          "maxLength": 128
        },
        "Value": {
          "type": "string",
          "description": "The value for the tag.",
          "maxLength": 256
        }
      },
      "required": ["Key", "Value"]
    },
    "VersioningConfiguration": {
      "type": "object",
      "description": "Describes the versioning state of an Amazon S3 bucket.",
      "properties": {
        "Status": {
          "type": "string",
          "description": "The versioning state of the bucket.",
          "enum": ["Enabled", "Suspended"]
        }
      },
      "required": ["Status"]
    }
  },
  "required": ["BucketName"],
  "readOnlyProperties": ["/properties/Arn"],
  "createOnlyProperties": ["/properties/BucketName"],
  "primaryIdentifier": ["/properties/BucketName"],
  "additionalProperties": false
}
