Shows how to use the AWS SDK for Python (Boto3) with Amazon CloudFront to list and update distributions.
CloudFront speeds up distribution of static and dynamic web content by delivering it through a worldwide network of edge locations that provide low latency and high performance.
- Listing CloudFront distributions
(
list_distributions) - Updating a CloudFront distribution
(
get_distribution_config,update_distribution)
- As an AWS best practice, grant this code least privilege, or only the permissions required to perform a task. For more information, see Grant Least Privilege in the AWS Identity and Access Management User Guide.
- This code has not been tested in all AWS Regions. Some AWS services are available only in specific Regions. For more information, see the AWS Region Table on the AWS website.
- Running this code might result in charges to your AWS account.
- You must have an AWS account, and have your default credentials and AWS Region configured as described in the AWS Tools and SDKs Shared Configuration and Credentials Reference Guide.
- Python 3.8 or later
- Boto3 1.14.47 or later
List distributions at a command prompt with the following command.
python list_distributions.py
Update the comment field in a distribution by running the following command and answering the prompts.
python update_distribution.py
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0