update_bucket
async
¶
update_bucket(
bucket_name: BucketName,
*,
config_overrides: Optional[AsyncLightsailClientConfig] = 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/async_lightsail.py
9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 | |