Skip to content

Latest commit

 

History

History
53 lines (47 loc) · 1.97 KB

README.md

File metadata and controls

53 lines (47 loc) · 1.97 KB

iac-sample-aws

Infrastructure as code repository setting up AWS infrastructure. This project is not complete.

Contents

.                # Root directory with README and .gitignore
|-infrastructure # general directory for all infrastracture as code
|--aws           # AWS infrastructure as code
|-sample-app     # code for a sample node.js application for deployment (empty)

To see more information about infrastructure see the README.md file in infrastructure/ subdirectory - (https://github.com/Blackweather/iac-bright/tree/master/infrastructure)

To see more information about AWS infrastructure see the README.md file in infrastructure/aws/ subdirectory - (https://github.com/Blackweather/iac-bright/tree/master/infrastructure/aws)

Prerequisites

Running the code

export AWS_ACCESS_KEY_ID=<YOUR_AWS_ACCESS_KEY_ID>
export AWS_SECRET_ACCESS_KEY=<YOUR_AWS_SECRET_ACCESS_KEY>
  • initialize the terraform modules and providers
cd infrastructure/aws/
terraform init
  • validate the infrastructure code
terraform validate
  • create a creation plan (make sure to check what is going to be created)
terraform plan -out=tfplan
  • apply the infrastructure plan
terraform apply tfplan

Optional: Destroy the infrastructure

  • show a destruction plan (make sure to check what is going to be destroy)
terraform plan -destroy
  • destroy the infrastructure
terraform destroy