Skip to content

Latest commit

 

History

History

terraform-remote-exec-example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Terraform remote-exec example

This folder contains a simple Terraform module that deploys resources in AWS to demonstrate how you can use Terratest to test modules which use remote-exec, files, and other ssh-based provisioners.

Check out test/terraform_remote_exec_example_test.go to see how you can write automated tests for this module.

WARNING: This module and the automated tests for it deploy real resources into your AWS account which can cost you money. The resources are all part of the AWS Free Tier, so if you haven't used that up, it should be free, but you are completely responsible for all AWS charges.

Running this module manually

  1. Sign up for AWS.
  2. Configure your AWS credentials using one of the supported methods for AWS CLI tools, such as setting the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. If you're using the ~/.aws/config file for profiles then export AWS_SDK_LOAD_CONFIG as "True".
  3. Install Terraform and make sure it's on your PATH.
  4. Run terraform init.
  5. Run terraform apply.
  6. When you're done, run terraform destroy.

Running automated tests against this module

  1. Sign up for AWS.
  2. Configure your AWS credentials using one of the supported methods for AWS CLI tools, such as setting the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. If you're using the ~/.aws/config file for profiles then export AWS_SDK_LOAD_CONFIG as "True".
  3. Install Terraform and make sure it's on your PATH.
  4. Install Golang and make sure this code is checked out into your GOPATH.
  5. cd test
  6. dep ensure
  7. go test -v -run TestTerraformRemoteExecExample