update_distribution
async
¶
update_distribution(
distribution_name: ResourceName,
*,
config_overrides: Optional[AsyncLightsailClientConfig] = None,
origin: Optional[InputOrigin] = None,
default_cache_behavior: Optional[CacheBehavior] = None,
cache_behavior_settings: Optional[CacheSettings] = None,
cache_behaviors: Optional[CacheBehaviorList] = None,
is_enabled: Optional[boolean] = None,
viewer_minimum_tls_protocol_version: Optional[
ViewerMinimumTlsProtocolVersionEnum
] = None,
certificate_name: Optional[ResourceName] = None,
use_default_certificate: Optional[boolean] = None,
enable_private_origin_access: Optional[boolean] = None,
default_root_object: Optional[string] = None,
custom_error_responses: Optional[DistributionCustomErrorResponseList] = None,
) -> UpdateDistributionResult
Updates an existing Amazon Lightsail content delivery network (CDN) distribution.
Use this action to update the configuration of your existing distribution.
Parameters:
-
distribution_name(ResourceName) –The name of the distribution to update.
Use the
GetDistributionsaction to get a list of distribution names that you can specify. -
origin(Optional[InputOrigin], default:None) –An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket, or load balancer.
The distribution pulls, caches, and serves content from the origin.
-
default_cache_behavior(Optional[CacheBehavior], default:None) –An object that describes the default cache behavior for the distribution.
-
cache_behavior_settings(Optional[CacheSettings], default:None) –An object that describes the cache behavior settings for the distribution.
The
cacheBehaviorSettingsspecified in yourUpdateDistributionRequestwill replace your distribution's existing settings. -
cache_behaviors(Optional[CacheBehaviorList], default:None) –An array of objects that describe the per-path cache behavior for the distribution.
-
is_enabled(Optional[boolean], default:None) –Indicates whether to enable the distribution.
-
viewer_minimum_tls_protocol_version(Optional[ViewerMinimumTlsProtocolVersionEnum], default:None) –Use this parameter to update the minimum TLS protocol version for the SSL/TLS certificate that's attached to the distribution.
-
certificate_name(Optional[ResourceName], default:None) –The name of the SSL/TLS certificate that you want to attach to the distribution.
Only certificates with a status of
ISSUEDcan be attached to a distribution.Use the GetCertificates action to get a list of certificate names that you can specify.
-
use_default_certificate(Optional[boolean], default:None) –Indicates whether the default SSL/TLS certificate is attached to the distribution. The default value is
true. Whentrue, the distribution uses the default domain name such asd111111abcdef8.cloudfront.net.Set this value to
falseto attach a new certificate to the distribution. -
enable_private_origin_access(Optional[boolean], default:None) –Specifies whether to enable private origin access for the distribution. With private origin access, the distribution can serve objects that aren't publicly accessible from a Lightsail bucket.
Lightsail grants the distribution permission to read the bucket's objects. Enabling private origin access doesn't change the bucket's access settings, and you can still retrieve publicly accessible objects directly from the bucket's endpoint.
When you include this parameter, you must also include the
originparameter with the resource name, even if the origin is not changing.You can enable private origin access only when the distribution's origin is a Lightsail bucket. If the origin is another resource type, the request fails.
-
default_root_object(Optional[string], default:None) –The object (for example,
index.html) that the distribution returns when a viewer requests the root URL of the distribution (/) instead of a specific object. The object that you specify must be available from the origin. -
custom_error_responses(Optional[DistributionCustomErrorResponseList], default:None) –An array of objects that describe the custom error responses for the distribution. With a custom error response, you can specify the page to return when the origin responds with a given HTTP error code. You can also specify the HTTP status code to send to the viewer.
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.
-
OperationFailureException–Lightsail throws this exception when an operation fails to execute.
-
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
9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 | |