Skip to content

qualimente/tf_s3_bucket

Repository files navigation

Generic Terraform S3 module

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.

CircleCI

Local Development and Testing

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:

  1. Start-off with a clean slate of running test infrastructure: make destroy; make all
  2. Make changes and (repeatedly) run: make converge && make verify
  3. Rebuild everything from scratch: make destroy; make all
  4. Commit and issue pull request

Running Test Kitchen for a single module

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        Verified

To 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"

About

tf_s3_bucket provides an s3 bucket configured with safe defaults and tagging.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors