update_distribution
¶
update_distribution(
distribution_name: ResourceName,
*,
config_overrides: Optional[LightsailClientConfig] = 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/lightsail.py
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 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 | |