Skip to content

Demo to show terraform IaaC for AWS Fargate/ALB/TF Compliance testing

Notifications You must be signed in to change notification settings

devopsman/terraform-fargate-demo1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy service with AWS Fargate using terraform

Pre-requisites

You should have next things installed on your PC:

  • awscli-v2 + configured credentials for any AWS Account
  • terraform v0.12 or later
  • terraform-compliance - used to run BDD tests against Terraform code

Deploy

To deploy whole solution to AWS, clone this repo and run script:

./scripts/tf_deploy.sh

After deploy is finished, get output value of alb_hostname parameter and test service by visiting 2 URLs:

  • http://<alb_hostname>:5000/service
  • http://<alb_hostname>:5000/__healthcheck__

Cleanup

To remove all Infrastructure(if was deployed in step #Deploy), run script:

./scripts/tf_cleanup.sh

Run tests

To run BDD tests against provided Terraform code run commands:

./scripts/run_tests.sh

You should see output similar to:

14 scenarios (12 passed, 2 skipped)
41 steps (37 passed, 2 skipped)
Run 1576506078 finished within a moment

Notes:

  • This step does not require that Terraform Infrastructure to be deployed on AWS, it runs against Terraform code only.
  • Not whole code covered here, I added just a few tests for Demo

About

Demo to show terraform IaaC for AWS Fargate/ALB/TF Compliance testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published