?? Securely Host Internal HTTPS Static Websites on AWS with ALB, S3, & PrivateLink
Khijar Shaikh
AWS/Azure Devops Engg 4yr of exp in IT Industry. | Kubernetes | Jenkins | Github action | Docker | Ansible | Terraform | cloudformation | ECR | Git | Gitlab | Cloudwatch | Wazuh | Prowler | Sonarcube | shell scrypting.
Step-by-Step Guide to Hosting Internal HTTPS Static Websites
1. Prerequisites
2. Create an S3 VPC Endpoint
Navigate to VPC Dashboard → Endpoints → Create Endpoint.
Select AWS S3 Interface Endpoint.
Attach it to your VPC and subnets (multi-AZ recommended).
Configure security groups to allow HTTPS/HTTP traffic from the ALB.
Note the VPC Endpoint’s IP addresses for later.
3. Lock Down S3 Bucket Access
Update the S3 bucket policy to restrict access to the VPC Endpoint:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::portal.example.com/*",
"Condition": {"StringEquals": {"aws:SourceVpce": "vpce-12345abcde"}}
}]
}
领英推荐
4. Set Up the Internal Application Load Balancer (ALB)
Create ALB:
Configure Target Group:
Register Targets: Add the S3 VPC Endpoint IP addresses.
5. Fix S3 Paths with ALB Listener Rules
Add a rule to the ALB listener:
6. Configure Private DNS (Route53)
How:
Create an A-record in your private hosted zone.
Alias the record to the internal ALB’s DNS name.
7. Test & Validate
curl -kIv https://portal.example.com
Ensure the ALB returns your S3 hosted content over HTTPS.