All Projects → keilerkonzept → terraform-module-versions

keilerkonzept / terraform-module-versions

Licence: MIT license
CLI tool that checks Terraform code for module updates. Single binary, no dependencies. linux, osx, windows. #golang #cli #terraform

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to terraform-module-versions

Gitversion
From git log to SemVer in no time
Stars: ✭ 2,131 (+1390.21%)
Mutual labels:  semver, versioning
git-version-bumper
Bump your git tag to the next version, easily. 👊
Stars: ✭ 92 (-35.66%)
Mutual labels:  semver, versioning
Version
Represent and compare versions via semantic versioning (SemVer) in Swift
Stars: ✭ 160 (+11.89%)
Mutual labels:  semver, versioning
Reckon
Infer a project's version from your Git repository.
Stars: ✭ 124 (-13.29%)
Mutual labels:  semver, versioning
zerover
0️⃣ Minimalist versioning scheme for devs who can't be bothered.
Stars: ✭ 141 (-1.4%)
Mutual labels:  semver, versioning
Semver
Semantic versioning helper library for PHP
Stars: ✭ 144 (+0.7%)
Mutual labels:  semver, versioning
Maven Git Versioning Extension
This extension will virtually set project versions, based on current git branch or tag.
Stars: ✭ 178 (+24.48%)
Mutual labels:  repository, versioning
Shipjs
Take control of what is going to be your next release.
Stars: ✭ 668 (+367.13%)
Mutual labels:  semver, versioning
neptune-client
📒 Experiment tracking tool and model registry
Stars: ✭ 348 (+143.36%)
Mutual labels:  repository, versioning
ongeza
An automated way to follow the Semantic Versioning Specification
Stars: ✭ 36 (-74.83%)
Mutual labels:  semver, versioning
Jgitver
jgit based library to calculate semver compatible version from git tree
Stars: ✭ 119 (-16.78%)
Mutual labels:  semver, versioning
bump
A generic version tracking and update tool
Stars: ✭ 33 (-76.92%)
Mutual labels:  update, semver
Git Version Bumper
Bump your git tag to the next version, easily. 👊
Stars: ✭ 87 (-39.16%)
Mutual labels:  semver, versioning
Semver.c
Semantic version library written in ANSI C
Stars: ✭ 147 (+2.8%)
Mutual labels:  semver, versioning
Grabver
Gradle Automatic Build Versioning Plugin - An easy Gradle plugin that follows semver.org rules to automatically generate the Patch version, Build number and Code version, while Major, Minor and Pre-Release suffix remain under our control.
Stars: ✭ 39 (-72.73%)
Mutual labels:  semver, versioning
Tuf
A framework for securing software update systems
Stars: ✭ 1,202 (+740.56%)
Mutual labels:  repository, update
Jsemver
Java implementation of the SemVer Specification
Stars: ✭ 360 (+151.75%)
Mutual labels:  semver, versioning
React Native Version
🔢 Version your React Native or Expo app in a `npm version` fashion.
Stars: ✭ 408 (+185.31%)
Mutual labels:  semver, versioning
gradle-semantic-build-versioning
Gradle plugin to generate version-numbers and tags using semantic versioning
Stars: ✭ 19 (-86.71%)
Mutual labels:  semver, versioning
python-tuf
Python reference implementation of The Update Framework (TUF)
Stars: ✭ 1,425 (+896.5%)
Mutual labels:  repository, update

terraform-module-versions

Checks for updates of external terraform modules referenced in given Terraform source. Outputs Markdown tables by default, as well as JSONL (-o jsonl, one JSON object per line), JSON (-o json), and JUnit XML (-o junit).

Supported module sources:

  • Git with SemVer tags
  • Terraform Registry
    • public <NAMESPACE>/<NAME>/<PROVIDER>
    • private <HOSTNAME>/<NAMESPACE>/<NAME>/<PROVIDER>

Example

$ terraform-module-versions check examples
| UPDATE? |               NAME               | CONSTRAINT | VERSION | LATEST MATCHING | LATEST  |
|---------|----------------------------------|------------|---------|-----------------|---------|
| (Y)     | consul                           | ~0.7.3     |         | 0.7.11          | 0.11.0  |
| (Y)     | consul_github_https              | 0.8.0      | v0.8.0  |                 | v0.11.0 |
| (Y)     | consul_github_https_missing_ref  | 0.7.3      |         | v0.7.3          | v0.11.0 |
| (Y)     | consul_github_https_no_ref       |            |         |                 | v0.11.0 |
| Y       | consul_github_ssh                | ~0.1.0     | 0.1.0   | v0.1.2          | v0.11.0 |
| (Y)     | example_git_scp                  | ~> 0.12    | 0.12.0  |                 | 3.1.5   |
| (Y)     | example_git_ssh_branch           |            | master  |                 | 3.1.5   |
| (Y)     | example_with_prerelease_versions |            | v0.22.2 |                 | v0.22.3 |

Contents

Examples

$ cat examples/main.tf
module "consul" {
  source = "hashicorp/consul/aws"
  version = "~0.7.3"
}

module "consul_github_https_missing_ref" {
  source = "github.com/hashicorp/terraform-aws-consul"
  version = "0.7.3"
}

module "consul_github_https_no_ref" {
  source = "github.com/hashicorp/terraform-aws-consul"
}

module "consul_github_https" {
  source = "github.com/hashicorp/terraform-aws-consul?ref=v0.8.0"
  version = "0.8.0"
}

module "consul_github_ssh" {
  source = "[email protected]:hashicorp/terraform-aws-consul?ref=0.1.0"
  version = "~0.1.0"
}

module "example_git_ssh_branch" {
  source = "git::ssh://[email protected]/keilerkonzept/terraform-module-versions?ref=master"
}

module "example_git_scp" {
  source = "git::[email protected]:keilerkonzept/terraform-module-versions?ref=0.12.0"
  version = "~> 0.12"
}

module "example_with_prerelease_versions" {
  source = "[email protected]:kubernetes/api.git?ref=v0.22.2"
}

module "local" {
  source = "./local"
}

variable "_0_15_sensitive_example" {
  type      = string
  sensitive = true
}

output "0_15_sensitive_example" {
  value = "foo-${var._0_15_sensitive_example}"
  sensitive = true
}

output "0_15_nonsensitive_example" {
  value = nonsensitive(var._0_15_sensitive_example)
}

List modules with their current versions

# list modules with their current versions and version constraints (if specified)
$ terraform-module-versions list examples
TYPE NAME CONSTRAINT VERSION SOURCE
registry consul ~0.7.3 hashicorp/consul/aws
local local ./local
git example_with_prerelease_versions v0.22.2 [email protected]:kubernetes/api.git?ref=v0.22.2
git example_git_ssh_branch master git::ssh://[email protected]/keilerkonzept/terraform-module-versions?ref=master
git example_git_scp ~> 0.12 0.12.0 git::[email protected]:keilerkonzept/terraform-module-versions?ref=0.12.0
git consul_github_ssh ~0.1.0 0.1.0 [email protected]:hashicorp/terraform-aws-consul?ref=0.1.0
git consul_github_https_no_ref github.com/hashicorp/terraform-aws-consul
git consul_github_https_missing_ref 0.7.3 github.com/hashicorp/terraform-aws-consul
git consul_github_https 0.8.0 v0.8.0 github.com/hashicorp/terraform-aws-consul?ref=v0.8.0

with -o json:

[
  {
    "path": "examples/main.tf",
    "name": "consul",
    "type": "registry",
    "source": "hashicorp/consul/aws",
    "constraint": "~0.7.3"
  },
  {
    "path": "examples/main.tf",
    "name": "consul_github_https",
    "type": "git",
    "source": "github.com/hashicorp/terraform-aws-consul?ref=v0.8.0",
    "constraint": "0.8.0",
    "version": "v0.8.0"
  },
  {
    "path": "examples/main.tf",
    "name": "consul_github_https_missing_ref",
    "type": "git",
    "source": "github.com/hashicorp/terraform-aws-consul",
    "constraint": "0.7.3"
  },
  {
    "path": "examples/main.tf",
    "name": "consul_github_https_no_ref",
    "type": "git",
    "source": "github.com/hashicorp/terraform-aws-consul"
  },
  {
    "path": "examples/main.tf",
    "name": "consul_github_ssh",
    "type": "git",
    "source": "[email protected]:hashicorp/terraform-aws-consul?ref=0.1.0",
    "constraint": "~0.1.0",
    "version": "0.1.0"
  },
  {
    "path": "examples/main.tf",
    "name": "example_git_scp",
    "type": "git",
    "source": "git::[email protected]:keilerkonzept/terraform-module-versions?ref=0.12.0",
    "constraint": "~> 0.12",
    "version": "0.12.0"
  },
  {
    "path": "examples/main.tf",
    "name": "example_git_ssh_branch",
    "type": "git",
    "source": "git::ssh://[email protected]/keilerkonzept/terraform-module-versions?ref=master",
    "version": "master"
  },
  {
    "path": "examples/main.tf",
    "name": "example_with_prerelease_versions",
    "type": "git",
    "source": "[email protected]:kubernetes/api.git?ref=v0.22.2",
    "version": "v0.22.2"
  },
  {
    "path": "examples/main.tf",
    "name": "local",
    "type": "local",
    "source": "./local"
  }
]

Check for module updates

# check: check for module updates from (usually) remote sources
$ terraform-module-versions check examples
UPDATE? NAME CONSTRAINT VERSION LATEST MATCHING LATEST
(Y) consul ~0.7.3 0.7.11 0.11.0
(Y) consul_github_https 0.8.0 v0.8.0 v0.11.0
(Y) consul_github_https_missing_ref 0.7.3 v0.7.3 v0.11.0
(Y) consul_github_https_no_ref v0.11.0
Y consul_github_ssh ~0.1.0 0.1.0 v0.1.2 v0.11.0
(Y) example_git_scp ~> 0.12 0.12.0 3.1.5
(Y) example_git_ssh_branch master 3.1.5
(Y) example_with_prerelease_versions v0.22.2 v0.22.3

with -o json:

[
  {
    "path": "examples/main.tf",
    "name": "consul",
    "source": "hashicorp/consul/aws",
    "constraint": "~0.7.3",
    "latestMatching": "0.7.11",
    "latestOverall": "0.11.0",
    "nonMatchingUpdate": true
  },
  {
    "path": "examples/main.tf",
    "name": "consul_github_https",
    "source": "github.com/hashicorp/terraform-aws-consul?ref=v0.8.0",
    "constraint": "0.8.0",
    "version": "v0.8.0",
    "latestOverall": "v0.11.0",
    "nonMatchingUpdate": true
  },
  {
    "path": "examples/main.tf",
    "name": "consul_github_https_missing_ref",
    "source": "github.com/hashicorp/terraform-aws-consul",
    "constraint": "0.7.3",
    "latestMatching": "v0.7.3",
    "latestOverall": "v0.11.0",
    "nonMatchingUpdate": true
  },
  {
    "path": "examples/main.tf",
    "name": "consul_github_https_no_ref",
    "source": "github.com/hashicorp/terraform-aws-consul",
    "latestOverall": "v0.11.0",
    "nonMatchingUpdate": true
  },
  {
    "path": "examples/main.tf",
    "name": "consul_github_ssh",
    "source": "[email protected]:hashicorp/terraform-aws-consul?ref=0.1.0",
    "constraint": "~0.1.0",
    "version": "0.1.0",
    "latestMatching": "v0.1.2",
    "latestOverall": "v0.11.0",
    "matchingUpdate": true,
    "nonMatchingUpdate": true
  },
  {
    "path": "examples/main.tf",
    "name": "example_git_scp",
    "source": "git::[email protected]:keilerkonzept/terraform-module-versions?ref=0.12.0",
    "constraint": "~> 0.12",
    "version": "0.12.0",
    "latestOverall": "3.1.5",
    "nonMatchingUpdate": true
  },
  {
    "path": "examples/main.tf",
    "name": "example_git_ssh_branch",
    "source": "git::ssh://[email protected]/keilerkonzept/terraform-module-versions?ref=master",
    "version": "master",
    "latestOverall": "3.1.5",
    "nonMatchingUpdate": true
  },
  {
    "path": "examples/main.tf",
    "name": "example_with_prerelease_versions",
    "source": "[email protected]:kubernetes/api.git?ref=v0.22.2",
    "version": "v0.22.2",
    "latestOverall": "v0.22.3",
    "nonMatchingUpdate": true
  }
]
# check -all: check for updates, include up-to-date-modules in output
$ terraform-module-versions check -all examples
UPDATE? NAME CONSTRAINT VERSION LATEST MATCHING LATEST
(Y) consul ~0.7.3 0.7.11 0.11.0
(Y) consul_github_https 0.8.0 v0.8.0 v0.11.0
(Y) consul_github_https_missing_ref 0.7.3 v0.7.3 v0.11.0
(Y) consul_github_https_no_ref v0.11.0
Y consul_github_ssh ~0.1.0 0.1.0 v0.1.2 v0.11.0
(Y) example_git_scp ~> 0.12 0.12.0 3.1.5
(Y) example_git_ssh_branch master 3.1.5
(Y) example_with_prerelease_versions v0.22.2 v0.22.3
? local

Check for module updates using Github Token authentication

$ export GITHUB_TOKEN="<your Github PAT>"
$ terraform-module-versions check examples

Check for updates of specific modules

# check -module: check for updates of specific modules
$ terraform-module-versions check -all -module=consul_github_https -module=consul_github_ssh examples
UPDATE? NAME CONSTRAINT VERSION LATEST MATCHING LATEST
(Y) consul_github_https 0.8.0 v0.8.0 v0.11.0
Y consul_github_ssh ~0.1.0 0.1.0 v0.1.2 v0.11.0
# check -module: check for updates of specific modules
$ terraform-module-versions check -module=consul_github_https -module=consul_github_ssh examples
UPDATE? NAME CONSTRAINT VERSION LATEST MATCHING LATEST
(Y) consul_github_https 0.8.0 v0.8.0 v0.11.0
Y consul_github_ssh ~0.1.0 0.1.0 v0.1.2 v0.11.0

with -o json:

[
  {
    "path": "examples/main.tf",
    "name": "consul_github_https",
    "source": "github.com/hashicorp/terraform-aws-consul?ref=v0.8.0",
    "constraint": "0.8.0",
    "version": "v0.8.0",
    "latestOverall": "v0.11.0",
    "nonMatchingUpdate": true
  },
  {
    "path": "examples/main.tf",
    "name": "consul_github_ssh",
    "source": "[email protected]:hashicorp/terraform-aws-consul?ref=0.1.0",
    "constraint": "~0.1.0",
    "version": "0.1.0",
    "latestMatching": "v0.1.2",
    "latestOverall": "v0.11.0",
    "matchingUpdate": true,
    "nonMatchingUpdate": true
  }
]

Get it

Using go get:

go get -u github.com/keilerkonzept/terraform-module-versions

Or download the binary for your platform from the releases page.

Usage

USAGE
  terraform-module-versions [options] <subcommand>

SUBCOMMANDS
  list     List referenced terraform modules with their detected versions
  check    Check referenced terraform modules' sources for newer versions
  version  Print version and exit

FLAGS
  -o markdown       (alias for -output)
  -output markdown  output format, one of [json jsonl junit markdown markdown-wide]
  -q=false          (alias for -quiet)
  -quiet=false      suppress log output (stderr)

list

USAGE
  terraform-module-versions list [options] [<path> ...]

List referenced terraform modules with their detected versions

FLAGS
  -module ...       include this module (may be specified repeatedly. by default, all modules are included)
  -o markdown       (alias for -output)
  -output markdown  output format, one of [json jsonl junit markdown markdown-wide]

check

USAGE
  terraform-module-versions check [options] [<path> ...]

Check referenced terraform modules' sources for newer versions

FLAGS
  -H ...                                 (alias for -registry-header)
  -a=false                               (alias for -all)
  -all=false                             include modules without updates
  -any-updates-found-nonzero-exit=false  exit with a nonzero code when modules with updates are found (ignoring version constraints)
  -e=false                               (alias for -updates-found-nonzero-exit)
  -module ...                            include this module (may be specified repeatedly. by default, all modules are included)
  -n=false                               (alias for -any-updates-found-nonzero-exit)
  -o markdown                            (alias for -output)
  -output markdown                       output format, one of [json jsonl junit markdown markdown-wide]
  -pre-release=false                     include pre-release versions
  -registry-header ...                   extra HTTP headers for requests to Terraform module registries (a key/value pair KEY:VALUE, may be specified repeatedly)
  -sed=false                             generate sed statements for upgrade
  -updates-found-nonzero-exit=false      exit with a nonzero code when modules with updates matching are found (respecting version constraints)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].