tf_s3_bucket provides an s3 bucket configured with safe defaults and tagging.
The metadata specified via variables will be used to construct a namespaced bucket name, apply appropriate tags, and configuree access logging.
Testing modules locally can be accomplished using a series of Make tasks
contained in this repo.
| Make Task | What happens |
|---|---|
| all | Execute the canonical build for the generic infrastructure module (does not destroy infra) |
| converge | Execute kitchen converge for all modules |
| circleci-build | Run a local circleci build |
| lint | Execute tflint for generic infrastructure module |
| test | Execute kitchen test --destroy=always for all modules |
| verify | Execute kitchen verify for all modules |
| destroy | Execute kitchen destroy for all modules |
| kitchen | Execute kitchen <command>. Specify the command with the COMMAND argument to make |
e.g. run a single test: make kitchen COMMAND="verify minimal-aws"
Typical Workflow:
- Start-off with a clean slate of running test infrastructure:
make destroy; make all - Make changes and (repeatedly) run:
make converge && make verify - Rebuild everything from scratch:
make destroy; make all - Commit and issue pull request
Test Kitchen uses the concept of "instances" as it's medium for multiple test
packages in a project.
An "instance" is the combination of a test suite and a platform.
This project uses a single platform for all specs (e.g. aws).
The name of this platform actually doesn't matter since the terraform provisioner
and driver are not affected by it.
You can see the available test instances by running the kitchen list command:
$ make kitchen COMMAND=list
Instance Driver Provisioner Verifier Transport Last Action Last Error
default-aws Terraform Terraform Terraform Ssh VerifiedTo run Test Kitchen processes for a single instance, you must use the kitchen
target from the make file and pass the command and the instance name using the
COMMAND variable to make.
# where 'default-aws is an Instance name from kitchen's list
$ make kitchen COMMAND="converge default-aws"