github.com/terraform-modules-krish/terratest@v0.29.0/examples/terraform-aws-dynamodb-example/README.md (about) 1 # Terraform AWS DynamoDB Example 2 3 This folder contains a simple Terraform module that deploys a [DynamoDB](https://aws.amazon.com/dynamodb/) table 4 with server-side encryption, point in time recovery and a TTL (time to live) attribute 5 to demonstrate how you can use Terratest to write automated tests for your AWS Terraform code. 6 7 Check out [test/terraform_aws_dynamodb_example_test.go](https://github.com/terraform-modules-krish/terratest/blob/v0.29.0/test/terraform_aws_dynamodb_example_test.go) to see how you can 8 test this module and validate the configuration of the parameters and options. 9 10 **WARNING**: This module and the automated tests for it deploy real resources into your AWS account which can cost you 11 money. 12 13 ## Running this module manually 14 15 1. Sign up for [AWS](https://aws.amazon.com/). 16 1. Configure your AWS credentials using one of the [supported methods for AWS CLI 17 tools](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html), such as setting the 18 `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". 19 1. Set the AWS region you want to use as the environment variable `AWS_DEFAULT_REGION`. 20 1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`. 21 1. Run `terraform init`. 22 1. Run `terraform apply`. 23 1. When you're done, run `terraform destroy`. 24 25 ## Running automated tests against this module 26 27 1. Sign up for [AWS](https://aws.amazon.com/). 28 1. Configure your AWS credentials using one of the [supported methods for AWS CLI 29 tools](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html), such as setting the 30 `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". 31 1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`. 32 1. Install [Golang](https://golang.org/) and make sure this code is checked out into your `GOPATH`. 33 1. `cd test` 34 1. `dep ensure` 35 1. `go test -v -run TestTerraformAwsDynamoDBExample`