update_bucket
¶
update_bucket(
bucket_name: BucketName,
*,
config_overrides: Optional[LightsailClientConfig] = None,
access_rules: Optional[AccessRules] = None,
versioning: Optional[NonEmptyString] = None,
readonly_access_accounts: Optional[PartnerIdList] = None,
access_log_config: Optional[BucketAccessLogConfig] = None,
cors: Optional[BucketCorsConfig] = None,
) -> UpdateBucketResult
Updates an existing Amazon Lightsail bucket.
Use this action to update the configuration of an existing bucket, such as versioning, public accessibility, and the Amazon Web Services accounts that can access the bucket.
Parameters:
-
bucket_name(BucketName) –The name of the bucket to update.
-
access_rules(Optional[AccessRules], default:None) –An object that sets the public accessibility of objects in the specified bucket.
-
versioning(Optional[NonEmptyString], default:None) –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.
-
-
readonly_access_accounts(Optional[PartnerIdList], default:None) –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.
-
access_log_config(Optional[BucketAccessLogConfig], default:None) –An object that describes the access log configuration for the bucket.
-
cors(Optional[BucketCorsConfig], default:None) –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.
Raises:
-
AccessDeniedException–Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.
-
InvalidInputException–Lightsail throws this exception when user input does not conform to the validation rules of an input field.
Domain and distribution APIs are only available in the N. Virginia (
us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration tous-east-1to create, view, or edit these resources. -
NotFoundException–Lightsail throws this exception when it cannot find a resource.
-
RegionSetupInProgressException–Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.
-
ServiceException–A general service exception.
-
UnauthenticatedException–Lightsail throws this exception when the user has not been authenticated.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lightsail/_services/lightsail.py
9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 | |