Cloud Infrastructure
Provisioned and configured AWS S3, CloudFront, and supporting infrastructure using Terraform to host and distribute a production website.
AWS Cloud Hosting · Infrastructure as Code · CI/CD Automation
A personal portfolio website built with Next.js and deployed on AWS, featuring Terraform-managed cloud infrastructure, automated CI/CD, and secure authentication through GitHub Actions and OIDC.
Personal Portfolio
AWS Infrastructure & CI/CD Architecture
Image coming soon
The Project
I developed this portfolio as a central place to showcase my technical projects, professional experience, and interests. Beyond creating the website itself, I wanted to gain practical experience deploying and maintaining a production application using cloud infrastructure.
Rather than relying on a managed hosting platform, I built the deployment infrastructure using Amazon Web Services (AWS) and Terraform. The website is developed with Next.js and TypeScript, exported as static files, and delivered through Amazon CloudFront with a private Amazon S3 bucket as its origin.
I also implemented an automated CI/CD pipeline using GitHub Actions, allowing changes pushed to the main branch to be built and deployed automatically. Authentication between GitHub and AWS uses OpenID Connect (OIDC), eliminating the need to store long-lived AWS access keys.
This project brought together frontend development, cloud architecture, infrastructure as code, deployment automation, and cloud security.
Key Contributions
Provisioned and configured AWS S3, CloudFront, and supporting infrastructure using Terraform to host and distribute a production website.
Implemented a GitHub Actions workflow that builds and deploys the website automatically whenever changes are pushed to the main branch.
Configured GitHub Actions OIDC authentication with AWS IAM, using temporary credentials and narrowly scoped deployment permissions.
Behind the Build
I wanted to create a personal website that would provide a centralized, accessible presentation of my technical projects and professional background.
While building a portfolio was the immediate goal, I also wanted to use the project to develop practical skills in cloud infrastructure, deployment automation, and production application management.
Rather than deploying through a platform that abstracts away infrastructure management, I chose to configure the underlying hosting environment myself.
My primary objectives were to build a responsive portfolio, deploy it securely using AWS, manage infrastructure through Terraform, and automate future deployments through GitHub Actions.
The portfolio was developed using Next.js, React, and TypeScript, providing a component-based architecture for organizing project information and other website content.
I structured the website around reusable components and project data files, making it easier to add new projects and maintain consistent presentation across individual project pages.
Because the portfolio does not require a continuously running application server, I configured Next.js to generate a static export during the production build process.
This approach produces HTML, CSS, JavaScript, and other assets that can be hosted directly through object storage and distributed through a content delivery network.
I designed the hosting architecture around Amazon S3 and Amazon CloudFront. The generated website files are stored in an S3 bucket, while CloudFront serves the content to visitors through its content delivery network.
The S3 bucket is configured to remain private rather than allowing unrestricted public access. CloudFront uses Origin Access Control (OAC) to retrieve website files securely from the bucket.
I also configured a CloudFront Function to handle URL rewriting for the static Next.js export. This allows visitors to navigate to project pages using clean URLs without needing to include .html extensions.
Cloudflare manages DNS for my custom domain, arilui.com, while AWS Certificate Manager provides the TLS certificate used by CloudFront for HTTPS.
Together, these services provide a static hosting environment without requiring a continuously running web server.
I used Terraform to define and provision the AWS resources required to host the portfolio. This included the S3 bucket, CloudFront distribution, Origin Access Control configuration, bucket policies, and supporting infrastructure.
Managing these resources through Terraform allows the infrastructure configuration to be version-controlled alongside the application code.
Before applying infrastructure changes, I used Terraform validation and planning commands to review the proposed modifications and verify that existing resources would not be unintentionally replaced or destroyed.
I later extended the Terraform configuration to provision a dedicated IAM role and OIDC provider for GitHub Actions deployments.
This project provided practical experience working with declarative infrastructure configuration, resource dependencies, IAM policies, and infrastructure change management.
To simplify website maintenance, I implemented an automated deployment pipeline using GitHub Actions.
The workflow is triggered whenever changes are pushed to the main branch of the GitHub repository. It checks out the application code, installs dependencies, and builds the Next.js application.
After verifying that the static export was generated successfully, the workflow authenticates with AWS and synchronizes the generated website files to the S3 bucket.
The deployment process also removes outdated files from S3 and creates a CloudFront cache invalidation so that updated content becomes available to visitors.
I retained a separate PowerShell deployment script as an alternative for manually building and deploying the website from my local development environment.
The resulting workflow allows me to publish website changes through a standard Git commit and push without manually uploading files or managing the deployment process.
A key consideration in the deployment pipeline was securing authentication between GitHub Actions and AWS.
Instead of creating permanent AWS access keys and storing them as GitHub secrets, I configured OpenID Connect (OIDC) authentication through AWS Identity and Access Management (IAM).
The GitHub Actions workflow requests an OIDC token and uses it to assume a dedicated AWS IAM role. AWS then provides temporary credentials for the deployment.
The role follows the principle of least privilege, granting access only to the S3 bucket operations and CloudFront invalidation permissions required by the deployment workflow.
The IAM trust policy also restricts which GitHub repository and branch can assume the role, preventing unrelated workflows from using the deployment identity.
This approach reduces the need to manage long-lived credentials while keeping deployment permissions separate from broader AWS account administration.
One of the most significant challenges occurred while configuring GitHub Actions authentication with AWS.
Although the OIDC provider, IAM role, and GitHub Actions workflow were configured, the initial deployment failed with an authorization error indicating that the workflow was not permitted to perform sts:AssumeRoleWithWebIdentity.
I investigated the failure by examining the IAM role's trust policy, confirming the GitHub repository and branch configuration, and reviewing the workflow's OIDC permissions.
To identify the mismatch, I added a temporary diagnostic step to the GitHub Actions workflow that decoded selected claims from the OIDC token without exposing the token itself.
The diagnostic output revealed that the token's subject claim included numeric GitHub account and repository identifiers, rather than the conventional repository-name format expected by the original IAM trust policy.
I updated the Terraform configuration to match the actual OIDC subject claim while preserving the strict repository and branch restrictions.
After applying the updated trust policy, GitHub Actions successfully authenticated with AWS and completed the automated deployment.
This experience reinforced the importance of inspecting actual authentication claims, understanding IAM trust relationships, and debugging authorization failures systematically rather than broadening permissions unnecessarily.
The completed project is a publicly accessible portfolio hosted on AWS with a custom domain, HTTPS, and automated deployment capabilities.
The hosting infrastructure is defined through Terraform, allowing AWS resources and security configurations to be managed as code.
GitHub Actions automatically builds and deploys updates when changes are pushed to the main branch, reducing the manual work required to maintain the website.
Using OIDC authentication allows the deployment pipeline to access AWS through temporary credentials rather than stored permanent access keys.
Beyond the finished website, this project strengthened my understanding of cloud architecture, infrastructure as code, identity and access management, and CI/CD workflows.
Potential future improvements include automated testing, deployment previews, additional monitoring, and further optimization of website performance and accessibility.