Prevent AWS CloudFront from Caching a File

Following on from my previous post: Static Website Hosting/Publishing Using AWS S3, AWS CloudFront, SSL Certificate And Custom FQDN, I had the need to ensure that a particular file was not cached by CloudFront and instead fetched each time. The particular example was that we wanted to use CloudFront, but in this case the website … Read more

Uploading Files to AWS S3 Using CLI

I’ll assume you have your AWS CLI configured so you are able to login to an AWS account. If you need any help on this see: https://geekmungus.co.uk/?p=1167. Here’s a bit of a cheat sheet on how to use AWS S3 via the CLI. Listing Buckets Upload One File Upload the file called “myfile.txt” into the … Read more

AWS SSO Login Picking the Wrong Browser

When you are trying to login to AWS using the CLI tool, you may find that the window opens a tab in the wrong browser, to get around this you can apply a “–no-browser” at the end of the sso login command, for example: Now instead of opening a browser automatically, you’ll get the code … Read more

Set Default Root Object for Statically Hosted Website on AWS CloudFront (AWS CloudFront Functions)

A standard AWS CloudFront distribution is set to automatically serve the index.html file of a website when a client requests the root of the site, e.g. https://www.geekmungus.co.uk and does not specify any specific file or file within a sub-directory. However in certain instances your clients may request a page as follows e.g: https://www.geekmungus.co.uk/studies within which an index.html … Read more

Static Website Hosting/Publishing using AWS S3, AWS CloudFront, SSL Certificate and Custom FQDN

Amazon CloudFront is a content delivery network operated by Amazon Web Services. Content delivery networks provide a globally-distributed network of proxy servers to cache content, such as web videos or other bulky media, more locally to consumers, to improve access speed for downloading the content (citation). Although AWS CloudFront can be used as a CDN (caching … Read more

Block Admin Page Using AWS WAF Example

If you are using the AWS Web Application Firewall (WAF) on your Application Load Balancer or other supported AWS entity, you probably don’t want any administrative interfaces of the web application presented directly to the Internet without some form of restriction; perhaps to a range of IPv4 addresses you want to restrict. Adding a rule … Read more

check_http Gives 403 Forbidden Error Monitoring Site via AWS Application Load Balancer (ALB)

We’ve started to host websites on AWS, we want to monitor using NagiosXI, but we got some odd results when first attempting to. The web application has no “index.html” page, which is one cause of the 403 forbidden error. However we were getting the same thing even when specifying the correct path. It turns out … Read more

Example AWS Application Load Balancer (ALB)

The AWS application load balancer is a key infrastructure component for providing access to your application to the Internet, or even for use within your VPC between components. In this example we’ll create a VPC, then within deploy 2 private and 2 public subnets, we’ll then attach an Internet Gateway, a NAT gateway (to allow … Read more