Skip to content

qaware/state-of-terraform-2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

state-of-terraform-2025

TODO

How to demo

1. Basic setup

  1. Start LocalStack Container
docker run --rm -it -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack:4.1.0
  1. Run Terraform init
terraform init
  1. Run Terraform apply
terraform apply
  1. Open the Static Website in Browser The link will be displayed in the console output of terraform apply and will look something like https://some-example-bucket-for-a-static-website.s3-website.localhost.localstack.cloud:4566/.

2. Validations

  1. Validation fails
terraform plan --var bucket_name="1.1.1.1"
  1. Validation passes
terraform plan --var bucket_name="some-example-bucket-for-a-static-website"

3. Preconditions

This would fail the precondition:

terraform plan --var website_index_object_key="hello_world.html"

4. Postconditions

This would fail the postcondition:

terraform apply --var enable_versioning=false

This would satisfy the postcondition again:

terraform apply --var enable_versioning=true

Note, that this command does not fail the postcondition:

terraform plan --var enable_versioning=false

5. "Unit Tests" / "Integration Tests"

terraform test

6. Checks ("End-to-End Tests")

Rerun terraform apply and watch the output. You can also change something in the assertion in check.tf to see how the check fails.