Skip to main content

Deployment walkthrough

Updating references to Gruntwork Infrastructure as Code Library

In order to take advantage of the Terraform AWS provider version 4, you need to update your references to the Gruntwork Infrastructure as Code Library to use a compatible version. We (Gruntwork) have gone through all our modules in the library to test and update the code to be compatible with AWS provider version 4. As a customer, you need to update to the proper versions of the Gruntwork library to pick up the fixes/changes that were made to be compatible. Be sure to read the release notes to know what changes need to be made to update to that version.

Refer to our guide on "Updating to new versions" for instructions on how to update the versions in your code.

The following table lists the versions of relevant Gruntwork AWS IaC library modules and Service Catalogs which are compatible with AWS provider version 4. Since the AWS provider version 3 upgrade, we have sunsetted some of our module repos. They have not been updated and are not listed below. Please visit the repo READMEs to see our recommendations for alternatives to those modules.

caution

Gruntwork follows semantic versioning. For pre-1.0 modules, version updates to the minor version are considered backward incompatible releases. Make sure to read the release notes for the relevant modules anytime you are updating minor versions! For example, if you are going from v0.5.x to v0.9.x, read the notes for v0.6.0, v0.7.0, v0.8.0, and v0.9.0 to get the migration steps for all backward incompatible updates in your upgrade path.

Version Compatibility table

Gruntwork Repo

Minimum version with AWS Provider v4 support

terraform-aws-utilities

v0.9.0

terraform-aws-vpc

v0.22.0

terraform-aws-asg

v0.19.0

terraform-aws-server

v0.15.0

terraform-aws-lambda

v0.20.0

terraform-aws-security

v0.65.0

terraform-aws-load-balancer

v0.29.0

terraform-aws-data-storage

v0.24.0

terraform-aws-cache

v0.18.0

terraform-aws-messaging

v0.9.0

terraform-aws-static-assets

v0.15.0

terraform-aws-monitoring

v0.34.1

terraform-aws-openvpn

v0.24.0

terraform-aws-ecs

v0.34.0

terraform-aws-ci

v0.48.0

terraform-aws-eks

v0.53.0

terraform-aws-service-catalog

v0.96.1

terraform-aws-cis-service-catalog

v0.41.0

Update the Gruntwork Reference Architecture to AWS Provider v4

If you purchased the Gruntwork Reference Architecture, update the relevant code in infrastructure-live to use a compatible version of the Gruntwork Infrastructure as Code Library, as per the compatibility table above.

To update your Reference Architecture:

  1. Update the underlying module source versions being referenced.
    • We recommend using tools like ripgrep, xargs, and sed to accomplish this.
    • E.g.: rg v0.95.0 --files-with-matches | xargs sed -i '' "s|v0.95.0|v0.96.1|g". This command finds and replaces all instances of v0.95.0 with v0.96.1 in your repo. Double-check all your changes before committing them to version control.
    • If you are several minors behind, please follow the migration guide for each minor version bump. Use the find-and-replace command to bump one minor version at a time.
    • Update the underlying Service Catalog versions, and also any one-off library module versions as well. You can accomplish this by grepping for each of the repos in the table above.
  2. Run terraform init -upgrade to allow Terraform to pull in the latest provider version. Without the -upgrade flag the 3.75.X version of the provider will be used instead. The -upgrade flag allows unlocking the provider restriction enforced in terraform.lock.hcl, in the module folder.
  3. Follow up with terraform plan. NOTE: The provider update creates and updates resources. You will see changes in the plan. These should be safe to apply, but always double-check anything slated for destruction.
  4. Then run terraform apply to bring Terraform state in sync with the provider changes.

If you have any questions, we'd love to hear them. Please reach out to Gruntwork Support.