Simple terraform module and stack to create an Elastic Beanstalk Application Elastic Beanstalk Environment for nodejs application
-
-
Important make sure you install CLI v2
-
Configure your cli access
-
- run
aws configure --profile
- run
-
Verify you have set up your aws_access_key_id and aws_secret_access_key setup correctly by running the following command
cat ~/.aws/credentials
you should see something like so:
[your-profile-name] aws_access_key_id=test aws_secret_access_key=test
- verify access run the following command
aws sts get-caller-identity
it should output the following:
{ "UserId": "AXFAQ567RFGUYOL2MHNNX", "Account": "000000000000", "Arn": "arn:aws:iam::000000000000:user/ethan-local-dev" }
-
You will need to change the vpc, subnets, acm cert outlined under /variables/*
If you are running infrastructure that is for a specific environment please follow the instruction below. For each environment you will need to run the following commands in the following order:
terraform init -backend-config="key=${application-name}/${environment}/terraform.tfstate" -reconfigure
terraform plan -var-file="./variables/${environment}.tfvars"
terraform apply -var-file="./variables/${environment}.tfvars" -auto-approve
terraform init -backend-config="key=${application-name}/${environment}/terraform.tfstate" -reconfigure
terraform plan -destroy -var-file="./variables/${environment}.tfvars"
terraform destroy -var-file="./variables/${environment}.tfvars" -auto-approve