Skip to main content

Using Versioned Modules

Gruntwork versions the Infrastructure as Code (IaC) Library using Semantic Versioning (SemVer). Since much of the Gruntwork IaC Library remains pre-1.0.0, most version numbers follow the format 0.MINOR.PATCH. For 0.MINOR.PATCH, the versioning rules are as follows:

  • The MINOR version is incremented when we introduce backward incompatible API changes.
  • The PATCH version is incremented when we add backward compatible functionality or bug fixes.

For modules that include submodules (e.g., terraform-aws-server/modules/single-server), not every release will contain changes for all submodules. While we recommend using the latest version, you can identify the most recent version with modifications to a specific submodule in the Library Reference.

Submodules show the last version in which they were modifiedSubmodules show the last version in which they were modified

We release new module versions through GitHub releases. Refer to the release notes in the corresponding GitHub repository’s release page for a detailed list of changes, including migration guides when applicable.

Example: Reference a version

The git tag created by a release can be referenced in the source argument of a module block when sourcing from a git URL.

For example, the module block below references version 0.15.4 of the single-server submodule within the terraform-aws-server module:

module "my_instance" {
source = "git::git@github.com:gruntwork-io/terraform-aws-server.git//modules/single-server?ref=v0.15.4"

name = "my_instance"
ami = "ami-123456"
instance_type = "t2.medium"
keypair_name = "my-keypair"
user_data = "${var.user_data}"

vpc_id = "${var.vpc_id}"
subnet_id = "${var.subnet_id}"
}

Once you start using versioned modules, it’s important to keep the modules up to date. Refer to the Updating Modules guide to learn more.