This repository contains Terraform code for setting up a basic infrastructure on AWS using Amazon Elastic Kubernetes Service (EKS) to run a Node.js application in a containerized environment.
The infrastructure setup involves:
- Provisioning a Virtual Private Cloud (VPC) and security groups on AWS.
- Configuring Amazon EKS to orchestrate containerized applications.
- Managing resources and configurations via Terraform for automation and consistency.
Ensure the following tools are installed and properly configured:
- AWS CLI: Configure it with the necessary permissions to access AWS resources.
- Terraform: To define and manage the infrastructure resources.
- kubectl: For interacting with the EKS cluster.
- Clone the repository:
git clone https://github.com/tukue/simpleAppInfraCode.git
cd simpleAppInfraCode- Configure AWS CLI: Make sure AWS CLI is configured with the correct credentials:
aws configure- Initialize Terraform:
terraform init- Set up the infrastructure: Apply the Terraform configurations to create the required AWS resources:
terraform applyNote: Review the output for any important details, including the URL to access your EKS cluster and other relevant resource identifiers, and enter "yes" to confirm.
- Deploy to EKS: Use kubectl to apply your Kubernetes configurations for deploying the app. Ensure the correct directory for your YAML files:
kubectl apply -f kubernets/ # Ensure the path is correctmain.tf: Core Terraform script to set up the AWS environment.variables.tf: Contains configurable variables for easy customization.outputs.tf: Defines outputs to be displayed after terraform apply.buildspec.yaml: Specifies build instructions, including placeholders for AWS account numbers.
To delete all resources created by Terraform:
terraform destroy