TODO
- Start LocalStack Container
docker run --rm -it -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack:4.1.0
- Run Terraform init
terraform init
- Run Terraform apply
terraform apply
- Open the Static Website in Browser
The link will be displayed in the console output of
terraform apply
and will look something likehttps://some-example-bucket-for-a-static-website.s3-website.localhost.localstack.cloud:4566/
.
- Validation fails
terraform plan --var bucket_name="1.1.1.1"
- Validation passes
terraform plan --var bucket_name="some-example-bucket-for-a-static-website"
This would fail the precondition:
terraform plan --var website_index_object_key="hello_world.html"
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
terraform test
Rerun terraform apply
and watch the output. You can also change something in the assertion in check.tf
to see how the check fails.