Terratest v2 Import Map

Status: FROZEN for import paths. The one open decision (renames) is resolved: the three hyphenated packages are renamed to idiomatic Go names at the /v2 boundary.

Some symbols also moved between modules during the beta. See Symbols relocated during the v2 beta.

Built from the actual v1 layout at tag v1.0.1-test (27 modules/ packages, 2 cmd/ binaries, 1 internal/lib tree).

Module base path: github.com/gruntwork-io/terratest

Transformation rule

For any surviving import path, the rewrite is a prefix replacement that also applies to every subpackage:

So e.g. modules/logger/parser -> modules/core/v2/logger/parser, modules/aws/foo -> modules/aws/v2/foo, and modules/http-helper -> modules/httphelper/v2.

core collapse (6 v1 packages -> one modules/core/v2)

v1 import path v2 import path
modules/logger modules/core/v2/logger
modules/testing modules/core/v2/testing
modules/retry modules/core/v2/retry
modules/random modules/core/v2/random
modules/files modules/core/v2/files
modules/shell modules/core/v2/shell

Standalone /v2 submodules

v1 import path v2 import path
modules/aws modules/aws/v2
modules/azure modules/azure/v2
modules/gcp modules/gcp/v2
modules/k8s modules/k8s/v2
modules/helm modules/helm/v2
modules/ssh modules/ssh/v2
modules/docker modules/docker/v2
modules/packer modules/packer/v2
modules/database modules/database/v2
modules/opa modules/opa/v2
modules/terraform modules/terraform/v2
modules/terragrunt modules/terragrunt/v2
modules/http-helper modules/httphelper/v2
modules/dns-helper modules/dnshelper/v2
modules/test-structure modules/teststructure/v2

Removed in v2.0.0 (deprecated in v1 first, deleted at cutover)

v1 import path replacement
modules/collections stdlib slices
modules/environment stdlib os.Getenv
modules/git stdlib os/exec
modules/slack none, vendor from frozen v1 if needed
modules/version-checker none, shell out
modules/oci none, Oracle Cloud support not carried forward; remains in frozen v1, vendor if needed
cmd/pick-instance-type none, standalone binary, out of scope
cmd/terratest_log_parser none, standalone binary (its logger/parser lib survives under modules/core/v2/logger/parser)

Internal flatten (non-importable, not consumer-facing)

v1 v2
internal/lib/formatting internal/formatting

Symbols relocated during the v2 beta

Moved to the module owning the type, so teststructure no longer requires aws, k8s, packer and ssh (#1877). Signatures and on-disk filenames are unchanged, and every call site is a compile error.

beta.1 beta.2 onwards
teststructure.{Save,Load}Ec2KeyPair aws.{Save,Load}Ec2KeyPair
teststructure.{Save,Load}KubectlOptions k8s.{Save,Load}KubectlOptions
teststructure.{Save,Load}PackerOptions packer.{Save,Load}PackerOptions
teststructure.{Save,Load}SSHKeyPair ssh.{Save,Load}SSHKeyPair

Nothing else moved. Watch for files that alias Terratest’s aws because plain aws is the AWS SDK.

Behavior changes during the v2 beta

Node addresses prefer ExternalIP (#1878). k8s.FindNodeHostnameContextE and GetServiceEndpoint (NodePort) now return the Node’s ExternalIP when present, falling back to the internal hostname as before. On EKS that is the public IP, so no EC2 call and no ec2:DescribeInstances permission is needed. Signatures are unchanged; the new FindNodeHostnameWithOptionsContext[E] consults NodePublicIPLookup for clusters with no ExternalIP.

KubectlOptions carrying a RestConfig no longer serializes (#1879). MarshalJSON returns k8s.ErrRestConfigNotSerializable instead of dropping the config. This already failed, with an opaque json: unsupported type: transport.WrapperFunc. Use NewKubectlOptions or NewKubectlOptionsWithInClusterAuth.

Accounting

27 modules/ packages = 6 collapsed into core + 15 standalone submodules + 6 removed. Plus 2 removed cmd/ binaries and 1 internal flatten. Submodule count: 16.

Open decisions

None. The map is frozen.

Resolved