Deploy a new VPC:
cd 01-vpc
terraform init
terraform plan
terraform apply
Update vpc_id
and subnet_ids
with VPC module output.
Deploy a new EKS cluster and nodegroup:
cd ../02-eks
terraform init
terraform plan
terraform apply
Build and push to ECR:
cd ../app
./buiid.sh
Create a YAML file for K8s Deployment, Service, HorizontalPodAutoscaler, and Ingress using a template file.
sed -e "s|<account-id>|${ACCOUNT_ID}|g" ping-api-template.yaml | sed -e "s|<region>|${REGION}|g" > ping-api.yaml
cat ping-api.yaml
kubectl apply -f ping-api.yaml
cd 02-eks
terraform destroy
cd ../01-vpc
terraform destroy
find . -name ".terraform" -exec rm -rf {} \;
find . -name "terraform.tfstate" -exec rm -rf {} \;
find . -name ".terraform.lock.hcl" -exec rm -rf {} \;