AWS Cloudfront Manager Utility - How To Guide For Windows
Tags: aws, tooling, beginners, python
Published: 2022-05-02 06:51:21

I recently presented at an Open Mic event hosted by AWS for the AWS community members. After my presentation, one of the attendees suggested that I develop a Cloudfront utility like the one I developed for SQS.

This post explains how to use the AWS Cloudfront Manager application I developed for Windows based on the request. It enables anyone to interact with Cloudfront without needing to be familiar with the CLI/SDK or access the console on a frequent basis. An engineer can use this tool to Invalidate, Enable, Disable, or Delete a Cloudfront distribution. This tool is great for anyone who isn't particularly tech-savvy but wants to use Cloudfront services.

## Download
The AWS Cloudfront Manager executable can be found at this [link](https://github.com/hseera/cloudfront-manager/blob/main/cloudfront_manager_executable.zip). When you start the Cloudfront Manager exe after unzipping, you will be presented with the Config screen.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3a5nugrqoxe28duyapx1.png)

## Configuration Tab
In the Cloudfront Manager, you have two options for connecting to AWS services using credentials. The first step is to enter credentials on the configuration tab. Another option is to keep your credentials in the following location on your Windows PC.
```
/Users/[username]/.aws
```
Example:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8d2rpwqo2rrdgmj9hhhq.png)
 
For the article, we'll enter our credentials into the text box and connect.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hcisfyxyi0bjyxonkr31.png)
 
Once the connection has been established, select the Cloudfront tab. This is where all of the magic takes place.

## Cloudfront Tab
You have two ways for accessing a distribution on the Cloudfront tab. One can list distributions by distribution ID or by selecting the Show all option. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7w4q97moxg3geadukmc.png)

You can use the first option if you know the distribution id. If not, you can use the "Show All" button on the screen to view all the account's distributions. Currently, the tool only allows for the visualization of 100 distributions. More than 100 will be possible in the future.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7a35mtlxe0p3wdn4l0qb.png)

## Describe Distribution
Pick the correct row in the table to acquire more information about the distribution. More information about the distribution is shown in the description section.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h8x4z88n7iou1q5zc3ba.png)

## Invalidate Distribution
Select the distribution ID row and right-click on it to invalidate the distribution. This will show a dropdown menu with the option to Invalidate. When you select the Invalidate option, the Invalidation procedure will begin. The Invalidation ID will be displayed on the console screen.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcnv7nnn40lwh876e1vv.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7j2uvee2rumsxz8qknh.png)
   
## Enable Distribution
Select the distribution ID row and right-click on it to enable the distribution. This will open a dropdown menu with the Enable option. When you select the Enable option, the enable process will begin. To check the status, select Refresh from the dropdown menu. The output of the action will be displayed on the console.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xj62pslt5abykrj38u9s.png)
 
## Disable Distribution
Select the distribution ID row and right-click on it to disable the distribution. This will open a dropdown menu with the Disable option. When you select the Disable option, the disabled process will begin. To check the status, select Refresh from the dropdown menu. The output of the action will be displayed on the console.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a09qiyj7ugvv4c2tzz65.png)

## Delete Distribution 
To delete a distribution, right-click on the distribution ID row and select Delete. If the distribution is switched on, the process will disable it before deleting it. The distribution will be deleted if it isn't. To see the update in action, refresh the screen. The status of the deletion process will be displayed every 30 seconds on the console screen. The deletion process has timeout of 30minutes. If after 30minutes, the distribution is still not deleted, the process exists.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dlhy2dv0k3faz37nipm0.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/efsxrkmar52wtk4nfx50.png)

If you like the tool, please leave a star on the github repo. Also if you find a bug, do let me know.
------------------------------------------------------------------

Thanks for reading!

If you enjoyed this article feel free to share it on social media 🙂

Say Hello on: [Linkedin](https://www.linkedin.com/in/harinderseera/) | [Twitter](https://twitter.com/harinderseera) | [Polywork](https://www.polywork.com/harinderseera) 

Blogging: [Dev](https://dev.to/harinderseera) | [Hashnode](https://harinderseera.hashnode.dev/)

Github: [hseera](https://github.com/hseera)