The purpose of infrastructure as code is to enable developers or operations teams to automatically manage, monitor and provision resources, rather than manually configure discrete hardware devices and operating systems. Infrastructure as code is sometimes referred to as programmable or software-defined infrastructure. This repository is to build the infrastructure required for hosting webapp Bookstore
Using Terraform, AWS resources like VPC, Subnets, S3 bucket, RDS, EC2, Auto Scaling, Elastic Load Balancer, etc. are provisioned.
- Clone this repository
- Download terraform from the official site
- Copy the terraform binary into your cloned folder or set it in your path
- Open Terminal and enter
terraform plan
- Once the plan is verified, enter
terraform apply
- View your VPC on AWS VPC Console
- Incase, you want tear down the infrastructure enter
terraform destroy
Following command uploads SSL certifcate of the website domain to AWS Certificate Manager (ACM)
sudo aws acm import-certificate --certificate fileb://prodcertificate.pem --certificate-chain fileb://prod_certificate_chain.pem --private-key fileb://privatekey.pem --profile prod