Skip to content

Releases: gruntwork-io/terratest

v1.0.0

11 May 12:55
ab607e4

Choose a tag to compare

Terratest 1.0.0 is the first stable release of the project. From this release forward, Terratest follows semantic versioning: breaking changes are restricted to major releases, and renamed or replaced symbols stay around as deprecated aliases in the v1 line. See the v1.0 announcement post for the narrative; the notes below cover what shipped.

✨ Highlights

  • Context plumbing throughout. Every cloud-API helper now takes an explicit context.Context as its second argument. FooContext (fail-fast) and FooContextE (returns the error) are the canonical entrypoints; the bare Foo and FooE forms remain as deprecated aliases.
  • Mockable SDK clients. Most Azure and GCP helpers that previously hid SDK client construction now ship with a WithClient sibling that accepts an injected client. Drive Terratest against Azure's azfake server or a GCP test double for fast unit tests with zero credentials.
  • Modern, supported underlying SDKs. modules/azure migrated off Microsoft's archived "track 1" SDK onto sdk/resourcemanager; AWS S3 helpers moved off the deprecated s3/manager to s3/transfermanager.
  • Terragrunt v1.0 feature parity. The terragrunt module fully supports Terragrunt v1.0's CLI redesign with new wrappers and single-unit variants. Terragrunt-specific code is separated from modules/terraform into its own module.
  • Reliability fixes. EC2 list calls paginate, OPA policy downloads deduplicate, several panics on empty SDK responses are now errors.

⚠️ Breaking Changes

Azure SDK migration

modules/azure moved off the archived "track 1" Azure SDK onto the actively maintained sdk/resourcemanager. Users who import the underlying SDK directly need to update import paths, move field access under .Properties, and replace iterators with pagers. The release also dropped 8 deprecated Get*ClientE getters in favor of Create*ClientE, renamed 4 CreateNew*Client* factories (with deprecated aliases), fixed the NsgRuleSummary.SourceAdresssPrefixes typo, and changed GetVirtualMachineImage{,E} to return *VMImage. See the Azure migration guide for full mechanics.

AWS S3 uploader

The four NewS3Uploader* helpers now return *transfermanager.Client instead of *manager.Uploader. The call shape moves from uploader.Upload(ctx, &s3.PutObjectInput{...}) to client.UploadObject(ctx, &transfermanager.UploadObjectInput{...}). Types live under github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager.

GCP Pub/Sub

modules/gcp/pubsub.go moved from cloud.google.com/go/pubsub v1 to v2. Wrapper shapes are unchanged, but callers driving the underlying client directly switch from client.Topic("name") / client.Subscription("name") handles to TopicAdminClient / SubscriptionAdminClient calls that take fully qualified resource names.

Terragrunt module split

Terragrunt-specific helpers were removed from modules/terraform/ and modules/test-structure/ in favor of the dedicated modules/terragrunt/ package: TgApplyAll, TgDestroyAll, TgPlanAllExitCode, ValidateInputs, InitAndValidateInputs, AssertTgPlanAllExitCode, TgInvalidBinary, TerragruntDefaultPath, ExtraArgs.ValidateInputs, NewTerragruntValidationOptions, and the TG constant. Terragrunt stack output keys were also renamed. See the terragrunt module migration table.

Kubernetes kubeconfig handling

GetKubernetesClientFromOptionsContextE now logs the kubeconfig load error before falling back to in-cluster authentication; previously the fallback was silent. A new KubectlOptions.InClusterAuth = true opt-in skips kubeconfig loading entirely for callers who want fully explicit auth.

testing.TestingT adoption

Helper signatures consistently take testing.TestingT (an interface) instead of the concrete *testing.T. Calls from *testing.T are unaffected; callers that wrap or substitute the test handle may need updates.

✨ New Features

WithClient injection helpers across Azure and GCP

Most Azure and GCP helpers now ship with a *WithClient sibling that accepts a pre-built SDK client, enabling unit testing against Azure's azfake server, GCP test doubles, and similar fakes without standing up real cloud resources or providing credentials.

Terragrunt v1.0 feature parity

All terraform-passthrough commands use terragrunt run -- <command> and multi-unit functions use terragrunt run --all -- <command>. Generic Run / RunE provide an escape hatch. New command wrappers: Render, RenderJSON, Graph, HclValidate, OutputAllJson, plus single-unit variants for Init, Plan, Apply, Destroy, Validate, and OutputJson.

GCP Pub/Sub helpers

AssertTopicExists and AssertSubscriptionExists added to modules/gcp/pubsub.go. Thanks to @Amit2465 for the contribution.

🔧 Code Quality & API Cleanup

  • Godoc and // Deprecated: annotations. A v1 documentation pass closed godoc gaps so the API surface renders cleanly on pkg.go.dev. Every renamed or replaced symbol carries a machine-readable // Deprecated: line so go vet, staticcheck, and IDE LSPs surface upgrade guidance automatically.
  • Strict golangci-lint v2 wired into pre-commit and CI across the project.
  • interface{}any sweep across the codebase.
  • collections generics: functions are now generic; ListContains is deprecated in favor of slices.Contains.

🐛 Bug Fixes

  • EC2 list pagination: DescribeInstances and DescribeTags now paginate; previously capped silently at 1,000 results.
  • Concurrent OPA download deduplication: modules/opa/download_policy.go uses singleflight so concurrent calls for the same rulePath share a single download.
  • Empty-response panics → errors: RDS, IAM, OCI list calls, and several Azure SDK-response paths return typed errors on empty responses where they previously panicked on unchecked slice access.
  • ACM pagination: ACM list calls now paginate.
  • OCI nil-safety: ListVcns and related calls loop on OpcNextPage; image sort handles nil timestamps; nil-pointer guards added across the package.
  • SSH file-handle leak: SCPDirFromContextE closes file handles on each download.
  • OPA cache concurrency race: cache initialization is now race-free under concurrent test runs.
  • Azure NSG field name typo: NsgRuleSummary.SourceAdresssPrefixes renamed to SourceAddressPrefixes.

📦 Dependency Updates

  • AWS SDK v2 bumped across every service used by Terratest; s3/manager (deprecated) replaced with s3/transfermanager.
  • GCP SDKs current: cloud.google.com/go/storage 1.62, cloud.google.com/go/pubsub/v2 2.4, google.golang.org/api 0.276.
  • Azure migrated off azure-sdk-for-go v51 onto the actively maintained sdk/resourcemanager modules (compute, network, storage, keyvault, sql, servicebus, frontdoor, monitor, recoveryservices, and others).
  • mitchellh/go-homedir (archived) removed as a direct dependency in favor of os.UserHomeDir; denisenkom/go-mssqldb swapped for the Microsoft-maintained fork.
  • google.golang.org/grpc 1.80, github.com/docker/cli 29.x, go.opentelemetry.io/otel/sdk 1.43, github.com/jackc/pgx/v5 5.9.
  • OpenTofu pin updated to 1.11.6; Terragrunt baseline bumped to v1.0.2.

📖 Documentation Updates

⚙️ Process Updates

  • All CI moved from CircleCI to GitHub Actions.
  • Multi-arch (linux / darwin / windows × amd64 / arm64 / 386) build-and-release workflow with SHA256SUMS.
  • go-mod-tidy-check workflow added.

Full Changelog: v0.56.0...v1.0.0

v0.56.0

13 Feb 17:02
cbe2ee4

Choose a tag to compare

✨ New Features

CreateJobFromCronJob and CreateJobFromCronJobE added.

The CreateJobFromCronJob and CreateJobFromCronJobE functions support creating Kubernetes cron jobs in a given namespace. This mirrors the behavior of the kubectl create job ... --from=cronjob/... command and provides a native way to trigger and test CronJob configurations within Terratest.

Special thanks to @Steffas for contributing this feature.

🐛 Bug Fixes

Preserve existing instance metadata in SetMetadata

Updates the newMetadata function to properly copy existing metadata items before applying new key-value pairs. This resolves an issue introduced in v0.55.0 where functions like SetMetadata and AddSshKey were accidentally overwriting all existing instance metadata instead of merging the new values.

Plan output parsing for Terraform 1.14+ fixed

Removes the trailing period requirement from the planWithChangesRegexp regular expression used by GetResourceCount. This resolves parsing failures caused by Terraform 1.14's new Actions feature, which appends additional text (e.g., . Actions: N to invoke.) to the standard plan summary line.

Update CronJob to use the batch/v1 API

Updates the CronJob implementation under the hood to use the stable batch/v1 API instead of batch/v1beta1. This restores compatibility with modern Kubernetes clusters, as the older v1beta1 API was completely removed in Kubernetes 1.25.

📖 Documentation Updates

Homepage examples for Terragrunt updated

Examples relevant to Terragrunt have been fixed in the https://terragrunt.gruntwork.io site.

⚙️ Process Updates

Golang bumped to 1.26

The version of Golang in go.mod has been updated to 1.26.

What's Changed

New Contributors

Full Changelog: v0.55.0...v0.56.0

v0.55.0

14 Jan 03:26
99cbde9

Choose a tag to compare

What's Changed

Full Changelog: v0.54.0...v0.55.0

v0.54.0

24 Nov 00:19
e743258

Choose a tag to compare

What's Changed

Full Changelog: v0.53.0...v0.54.0

v0.53.0

14 Nov 20:45
b23d0e3

Choose a tag to compare

What's Changed

Full Changelog: v0.52.0...v0.53.0

v0.52.0

26 Oct 23:27
e011dc7

Choose a tag to compare

What's Changed

  • feat: Add SSH certificate authentication support for Terratest by @james00012 in #1594
  • Update golang.org/x/tools to v0.36.0 for Go 1.25+ compatibility by @james00012 in #1593
  • fix: prevent segfault in helm.UnmarshalK8SYaml with empty YAML documents by @james00012 in #1597
  • Add ExecPod functions to execute commands in Kubernetes pods by @james00012 in #1599
  • Add terragrunt run-all helpers and refactor helm module by @james00012 in #1601
  • docs: add helm as an entry to package table by @Sacquer in #1604
  • Ensuring that multiple dummy servers can use the same handlers by @Malhavok in #1603
  • Fix order of ExtraArgs for Output command with non-empty key (fixes #1606) by @dee-kryvenko in #1607

New Contributors

Full Changelog: v0.51.0...v0.52.0

v0.51.0

23 Sep 04:40
af08d0f

Choose a tag to compare

What's Changed

Full Changelog: v0.50.0...v0.51.0

v0.50.0

15 Jun 16:37
1ce1b74

Choose a tag to compare

What's Changed

  • add cronjob by @james03160927 in #1553
  • fix ResourceGroupExists by @james03160927 in #1552
  • allow GOOGLE_OAUTH_ACCESS_TOKEN by @james03160927 in #1555
  • Adjust warning patterns by @james03160927 in #1550
  • chore: Offboarding Levko by @yhakbar in #1558
  • fix: Respect port selection by name by services in ForwardPortE by @s-diez in #1557
  • fix: Helm example deployment test by @james03160927 in #1559
  • Updated the subnet struct and corresponding function to fetch the subnet CIDR range by @Atchuthmullapudi in #1561
  • Implement support for terragrunt stack init by @james03160927 in #1560

New Contributors

Full Changelog: v0.49.0...v0.50.0

v0.49.0

08 May 17:34
8e99d31

Choose a tag to compare

Modules affected

  • terraform
  • helm
  • azure
  • aws
  • k8s
  • logger
  • packer

What's Changed

  • feat: Creating a test for TF_LOG by @james03160927 in #1512
  • feat: handle multiple yaml doc by @james03160927 in #1514
  • feat: use the new sdk for azure resource group by @james03160927 in #1511
  • feat: Stop DynamoDB methods with E Failing Immediately by @robmorgan in #1507
  • feat: Get and Put for ECR repo policies by @felixfriedrich in #1519
  • feat: include --version in helm upgrade by @jijiechen in #1532
  • feat: add mixed vars support by @james03160927 in #1517
  • feat: Add helper function for parsing packer-manifest.json by @james03160927 in #1546
  • feat: Support a s3:putobject by @james03160927 in #1525
  • feat: capture terraform stdout stderr and exitcode separately by @james03160927 in #1530
  • feat: add UnmarshalK8SYamlsE by @james03160927 in #1533
  • feat: add support for extra arguments by @james03160927 in #1523
  • feat: allow --backend-config to use file path by setting the value to nil by @james03160927 in #1539
  • feat: Support for ListNamespaces function by @james03160927 in #1543
  • feat: K8S fix forward to service port by @james03160927 in #1547
  • fix: add test for duplicate key by @james03160927 in #1518
  • fix: support custom TG logger settings by @bt-macole in #1509
  • docs: Improve README for terraform database example module by @james03160927 in #1515
  • chore: adjust fixture to fix broken tests by @james03160927 in #1548
  • chore: add RenderTemplateAndGetStdOutErrE & RunHelmCommandAndGetStdOutErrE by @james03160927 in #1526
  • chore: Update parseListOfMaps to handle non-map data structures by @james03160927 in #1529
  • chore: add test for literal block by @james03160927 in #1535
  • chore: Update CODEOWNERS by @james03160927 in #1554
  • chore: Adding Terragrunt team to CODEOWNERS by @yhakbar in #1513
  • chore(deps): Bump nokogiri from 1.16.5 to 1.18.3 in /docs by @dependabot in #1516
  • chore(deps): Bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2 by @dependabot in #1527
  • chore(deps): Bump golang.org/x/crypto from 0.32.0 to 0.35.0 by @dependabot in #1541
  • chore(deps): Bump golang.org/x/net from 0.34.0 to 0.38.0 by @dependabot in #1542
  • chore(deps): Bump nokogiri from 1.18.3 to 1.18.8 in /docs by @dependabot in #1545

New Contributors

Full Changelog: v0.48.2...v0.49.0

v0.48.2

04 Feb 16:06
23563d0

Choose a tag to compare

Modules affected

  • shell
  • aws
  • gcp
  • terraform
  • k8s
  • azure
  • database

What's Changed

  • feat: Add RunCommandAndGetStdOutErr by @james03160927
  • feat: Implement functionality for S3BucketServerSideEncryption by @james03160927
  • feat: Add an import SSH key for a specific project by @james03160927
  • feat: Do not merge stderr into stdout by @g7r
  • feat: Add bucket ownership control by @james03160927
  • feat: Add request-timeout options for kubectl by @james03160927
  • feat: Support pagination for GetAllParametersOfRdsInstance by @james03160927
  • feat: Add support for Azure container apps by @tjololo
  • chore(deps): Bump golang.org/x/crypto from 0.29.0 to 0.31.0 by @dependabot
  • feat: Add support for databases by @james03160927
  • chore(deps): Bump golang.org/x/net from 0.31.0 to 0.33.0 by @dependabot
  • feat: Add a new check for private DNS zones by @johannes-engler-mw
  • chore: Update copyright year in README by @ofek
  • fix: Use HasSuffix to check for suffixes by @amangale

New Contributors

Full Changelog: v0.48.1...v0.48.2