github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/docs/_docs/01_getting-started/packages-overview.md (about) 1 --- 2 layout: collection-browser-doc 3 title: Package by package overview 4 category: getting-started 5 excerpt: >- 6 Learn more about Terratest modules and how they can help you test different types infrastructure. 7 tags: ["packages"] 8 order: 103 9 nav_title: Documentation 10 nav_title_link: /docs/ 11 --- 12 13 Now that you've had a chance to browse the examples and their tests, here's an overview of the packages you'll find in 14 Terratest's [modules folder](https://github.com/gruntwork-io/terratest/tree/master/modules) and how they can help you test different types infrastructure: 15 16 {:.doc-styled-table} 17 | Package | Description | 18 | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 19 | **aws** | Functions that make it easier to work with the AWS APIs. Examples: find an EC2 Instance by tag, get the IPs of EC2 Instances in an ASG, create an EC2 KeyPair, look up a VPC ID. | 20 | **azure** | Functions that make it easier to work with the Azure APIs. Examples: get the size of a virtual machine, get the tags of a virtual machine. | 21 | **collections** | Go doesn't have much of a collections library built-in, so this package has a few helper methods for working with lists and maps. Examples: subtract two lists from each other. | 22 | **docker** | Functions that make it easier to work with Docker and Docker Compose. Examples: run `docker-compose` commands. | 23 | **environment** | Functions for interacting with os environment. Examples: check for first non empty environment variable in a list. | 24 | **files** | Functions for manipulating files and folders. Examples: check if a file exists, copy a folder and all of its contents. | 25 | **gcp** | Functions that make it easier to work with the GCP APIs. Examples: Add labels to a Compute Instance, get the Public IPs of an Instance, Get a list of Instances in a Managed Instance Group, Work with Storage Buckets and Objects. | 26 | **git** | Functions for working with Git. Examples: get the name of the current Git branch. | 27 | **http-helper** | Functions for making HTTP requests. Examples: make an HTTP request to a URL and check the status code and body contain the expected values, run a simple HTTP server locally. | 28 | **k8s** | Functions that make it easier to work with Kubernetes. Examples: Getting the list of nodes in a cluster, waiting until all nodes in a cluster is ready. | 29 | **logger** | A replacement for Go's `t.Log` and `t.Logf` that writes the logs to `stdout` immediately, rather than buffering them until the very end of the test. This makes debugging and iterating easier. | 30 | **logger/parser** | Includes functions for parsing out interleaved go test output and piecing out the individual test logs. Used by the [terratest_log_parser](https://github.com/gruntwork-io/terratest/tree/master/cmd/terratest_log_parser) command. | 31 | **oci** | Functions that make it easier to work with OCI. Examples: Getting the most recent image of a compartment + OS pair, deleting a custom image, retrieving a random subnet. | 32 | **packer** | Functions for working with Packer. Examples: run a Packer build and return the ID of the artifact that was created. | 33 | **random** | Functions for generating random data. Examples: generate a unique ID that can be used to namespace resources so multiple tests running in parallel don't clash. | 34 | **retry** | Functions for retrying actions. Examples: retry a function up to a maximum number of retries, retry a function until a stop function is called, wait up to a certain timeout for a function to complete. These are especially useful when working with distributed systems and eventual consistency. | 35 | **shell** | Functions to run shell commands. Examples: run a shell command and return its `stdout` and `stderr`. | 36 | **ssh** | Functions to SSH to servers. Examples: SSH to a server, execute a command, and return `stdout` and `stderr`. | 37 | **terraform** | Functions for working with Terraform. Examples: run `terraform init`, `terraform apply`, `terraform destroy`. | 38 | **test_structure** | Functions for structuring your tests to speed up local iteration. Examples: break up your tests into stages so that any stage can be skipped by setting an environment variable. |