Harrison Holt

CloudFormation Infrastructure Templates

This page showcases a series of AWS CloudFormation templates I wrote from scratch to provision secure, scalable infrastructure. These templates were built as part of my DevOps learning journey and reflect production-level practices such as Origin Access Identity (OAI), secure S3 bucket policies, and automated deployments.

Featured Template: Static Website with S3 & CloudFront

This template provisions a private S3 bucket, a CloudFront distribution with Origin Access Identity (OAI), and a secure bucket policy. It enables global, HTTPS-accessible static site hosting with fine-grained access control.

Key Services: S3, CloudFront, OAI, BucketPolicy

Live Demo: View Deployed Site

GitHub Repository: Static Site Template

Challenges Solved

Technologies & Services

Template Roadmap

Coming soon: additional templates including


Code Preview

This is a snippet from the static website template:

Resources:
  MyStaticWebsite:
    Type: AWS::S3::Bucket
    Properties:
      WebsiteConfiguration:
        IndexDocument: index.html
      PublicAccessBlockConfiguration:
        BlockPublicAcls: true
        BlockPublicPolicy: true
        IgnorePublicAcls: true
        RestrictPublicBuckets: true

  MyOAI:
    Type: AWS::CloudFront::CloudFrontOriginAccessIdentity
    Properties:
      CloudFrontOriginAccessIdentityConfig:
        Comment: Access Identity For The S3 Bucket

  BucketPolicy:
    Type: AWS::S3::BucketPolicy
    DependsOn: MyStaticWebsite
    Properties:
      Bucket: 
        Ref: MyStaticWebsite
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Action: s3:GetObject
            Resource: 
              Fn::Sub: arn:aws:s3:::${MyStaticWebsite}/*
            Principal:
              CanonicalUser:
                Fn::GetAtt: [MyOAI, S3CanonicalUserId]

Deployment Screenshot

CloudFormation Stack Success
CloudFormation Stack Created Successfully