{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-lightsail/json-schema/amazon-lightsail-update-bucket-request-schema.json",
  "title": "UpdateBucketRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-lightsail-buckets-api-openapi.yml#/components/schemas/UpdateBucketRequest",
  "type": "object",
  "properties": {
    "bucketName": {
      "allOf": [
        {
          "$ref": "#/$defs/BucketName"
        }
      ],
      "description": "The name of the bucket to update."
    },
    "accessRules": {
      "allOf": [
        {
          "$ref": "#/$defs/AccessRules"
        }
      ],
      "description": "An object that sets the public accessibility of objects in the specified bucket."
    },
    "versioning": {
      "allOf": [
        {
          "$ref": "#/$defs/NonEmptyString"
        }
      ],
      "description": "Specifies whether to enable or suspend versioning of objects in the bucket. The following options can be specified: Enabled - Enables versioning of objects in the specified bucket. Suspended - Suspends versioning of objects in the specified bucket. Existing object versions are retained."
    },
    "readonlyAccessAccounts": {
      "allOf": [
        {
          "$ref": "#/$defs/PartnerIdList"
        }
      ],
      "description": "An array of strings to specify the Amazon Web Services account IDs that can access the bucket. You can give a maximum of 10 Amazon Web Services accounts access to a bucket."
    },
    "accessLogConfig": {
      "allOf": [
        {
          "$ref": "#/$defs/BucketAccessLogConfig"
        }
      ],
      "description": "An object that describes the access log configuration for the bucket."
    },
    "cors": {
      "allOf": [
        {
          "$ref": "#/$defs/BucketCorsConfig"
        }
      ],
      "description": "Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see Configuring cross-origin resource sharing (CORS) . CORS information is only returned in a response when you update the CORS policy."
    }
  },
  "required": [
    "bucketName"
  ],
  "$defs": {
    "AccessRules": {
      "type": "object",
      "properties": {
        "getObject": {
          "allOf": [
            {
              "$ref": "#/$defs/AccessType"
            }
          ],
          "description": "Specifies the anonymous access to all objects in a bucket. The following options can be specified: public - Sets all objects in the bucket to public (read-only), making them readable by anyone in the world. If the getObject value is set to public , then all objects in the bucket default to public regardless of the allowPublicOverrides value. private - Sets all objects in the bucket to private, making them readable only by you or anyone you give access to. If the getObject value is set to private , and the allowPublicOverrides value is set to true , then all objects in the bucket default to private unless they are configured with a public-read ACL. Individual objects with a public-read ACL are readable by anyone in the world."
        },
        "allowPublicOverrides": {
          "allOf": [
            {
              "$ref": "#/$defs/boolean"
            }
          ],
          "description": "A Boolean value that indicates whether the access control list (ACL) permissions that are applied to individual objects override the getObject option that is currently specified. When this is true, you can use the PutObjectAcl Amazon S3 API action to set individual objects to public (read-only) using the public-read ACL, or to private using the private ACL."
        }
      },
      "description": "Describes the anonymous access permissions for an Amazon Lightsail bucket and its objects. For more information about bucket access permissions, see Understanding bucket permissions in Amazon Lightsail in the Amazon Lightsail Developer Guide ."
    },
    "AccessType": {
      "type": "string",
      "enum": [
        "public",
        "private"
      ]
    },
    "BucketAccessLogConfig": {
      "type": "object",
      "properties": {
        "enabled": {
          "allOf": [
            {
              "$ref": "#/$defs/boolean"
            }
          ],
          "description": "A Boolean value that indicates whether bucket access logging is enabled for the bucket."
        },
        "destination": {
          "allOf": [
            {
              "$ref": "#/$defs/BucketName"
            }
          ],
          "description": "The name of the bucket where the access logs are saved. The destination can be a Lightsail bucket in the same account, and in the same Amazon Web Services Region as the source bucket. This parameter is required when enabling the access log for a bucket, and should be omitted when disabling the access log."
        },
        "prefix": {
          "allOf": [
            {
              "$ref": "#/$defs/BucketAccessLogPrefix"
            }
          ],
          "description": "The optional object prefix for the bucket access log. The prefix is an optional addition to the object key that organizes your access log files in the destination bucket. For example, if you specify a logs/ prefix, then each log object will begin with the logs/ prefix in its key (for example, logs/2021-11-01-21-32-16-E568B2907131C0C0 ). This parameter can be optionally specified when enabling the access log for a bucket, and should be omitted when disabling the access log."
        }
      },
      "required": [
        "enabled"
      ],
      "description": "Describes the access log configuration for a bucket in the Amazon Lightsail object storage service. For more information about bucket access logs, see Logging bucket requests using access logging in Amazon Lightsail in the Amazon Lightsail Developer Guide ."
    },
    "BucketAccessLogPrefix": {
      "type": "string",
      "pattern": "^[\\w/!.*')(-]+$",
      "minLength": 1,
      "maxLength": 100
    },
    "BucketCorsAllowedHeaders": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/string"
      }
    },
    "BucketCorsAllowedMethod": {
      "type": "string",
      "pattern": "^(DELETE|GET|HEAD|POST|PUT)$"
    },
    "BucketCorsAllowedMethods": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BucketCorsAllowedMethod"
      }
    },
    "BucketCorsAllowedOrigins": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/string"
      }
    },
    "BucketCorsConfig": {
      "type": "object",
      "properties": {
        "rules": {
          "allOf": [
            {
              "$ref": "#/$defs/BucketCorsRules"
            }
          ],
          "description": "A set of origins and methods (cross-origin access that you want to allow). You can add up to 20 rules to the configuration. The total size is limited to 64 KB."
        }
      },
      "description": "Describes the cross-origin resource sharing (CORS) configuration for a Lightsail bucket. CORS defines a way for client web applications that are loaded in one domain to interact with resources in a different domain. For more information, see Configuring cross-origin resource sharing (CORS) ."
    },
    "BucketCorsExposeHeaders": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/string"
      }
    },
    "BucketCorsRule": {
      "type": "object",
      "properties": {
        "id": {
          "allOf": [
            {
              "$ref": "#/$defs/BucketCorsRuleId"
            }
          ],
          "description": "A unique identifier for the CORS rule. The ID value can be up to 255 characters long. The IDs help you find a rule in the configuration."
        },
        "allowedMethods": {
          "allOf": [
            {
              "$ref": "#/$defs/BucketCorsAllowedMethods"
            }
          ],
          "description": "The HTTP methods that are allowed when accessing the bucket from the specified origin. Each CORS rule must identify at least one origin and one method. You can use the following HTTP methods: GET - Retrieves data from the server, such as downloading files or viewing content. PUT - Uploads or replaces data on the server, such as uploading new files. POST - Sends data to the server for processing, such as submitting forms or creating new resources. DELETE - Removes data from the server, such as deleting files or resources. HEAD - Retrieves only the headers from the server without the actual content, useful for checking if a resource exists."
        },
        "allowedOrigins": {
          "allOf": [
            {
              "$ref": "#/$defs/BucketCorsAllowedOrigins"
            }
          ],
          "description": "One or more origins you want customers to be able to access the bucket from. Each CORS rule must identify at least one origin and one method."
        },
        "allowedHeaders": {
          "allOf": [
            {
              "$ref": "#/$defs/BucketCorsAllowedHeaders"
            }
          ],
          "description": "Headers that are specified in the Access-Control-Request-Headers header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed."
        },
        "exposeHeaders": {
          "allOf": [
            {
              "$ref": "#/$defs/BucketCorsExposeHeaders"
            }
          ],
          "description": "One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object)."
        },
        "maxAgeSeconds": {
          "allOf": [
            {
              "$ref": "#/$defs/integer"
            }
          ],
          "description": "The time in seconds that your browser is to cache the preflight response for the specified resource. A CORS rule can have only one maxAgeSeconds element."
        }
      },
      "required": [
        "allowedMethods",
        "allowedOrigins"
      ],
      "description": "Describes a cross-origin resource sharing (CORS) rule for a Lightsail bucket. CORS rules specify which origins are allowed to access the bucket, which HTTP methods are allowed, and other access control information. For more information, see Configuring cross-origin resource sharing (CORS) ."
    },
    "BucketCorsRuleId": {
      "type": "string",
      "minLength": 0,
      "maxLength": 255
    },
    "BucketCorsRules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BucketCorsRule"
      }
    },
    "BucketName": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,52}[a-z0-9]$",
      "minLength": 3,
      "maxLength": 54
    },
    "NonEmptyString": {
      "type": "string",
      "pattern": "\\S"
    },
    "PartnerIdList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/NonEmptyString"
      }
    },
    "boolean": {
      "type": "boolean"
    },
    "integer": {
      "type": "integer"
    },
    "string": {
      "type": "string"
    }
  }
}