Terraform Registry

kind: terraform/registry

sourceconditiontarget

Description

source

The terraform/registry "source" retrieves the Terraform registry provider or module version matching then versioning rule.

condition

The terraform/registry "condition" checks if the Terraform registry provider or module version matching then versioning rule exist.

Parameter

NameTypeDescriptionRequired
hostnamestring

“hostname” the hostname of the provider or module.

	compatible:
		* source
		* condition

	remark:
		* Optional
		* Not allowed with rawstring.
		* Applicable for module and provider.
namestring

“name” the name of the provider or module.

	compatible:
		* source
		* condition

	remark:
		* Required unless using rawstring
		* Not allowed with rawstring.
		* Applicable for module and provider.
namespacestring

“namespace” the namespace of the provider or module

	compatible:
		* source
		* condition

	remark:
		* Required unless using rawstring
		* Not allowed with rawstring.
		* Applicable for module and provider.
rawstringstring

“rawstring” provider reference to registry in single string.

	compatible:
		* source
		* condition

	Examples:
		* hashicorp/kubernetes
		* registry.terraform.io/hashicorp/kubernetes
		* terraform-aws-modules/vpc/aws
		* app.terraform.io/terraform-aws-modules/vpc/aws

	remark:
		* Applicable for module and provider.
		* Not allowed with hostname, namespace, name, and targetsystem.
targetsystemstring

“targetsystem” the target system for the module in registry

	compatible:
		* source
		* condition

	remark:
		* Required for type module unless using rawstring
		* Not allowed with rawstring
		* Applicable for module.
typestring

“type” defines the type registry request to look up.

	compatible:
		* source
		* condition

	Supported values: module, provider
versionstring

“version” defines a specific version to be used during condition check.

	compatible:
		* condition
versionfilterobject

“versionfilter” provides parameters to specify version pattern and its type like regex, semver, or just latest.

	compatible:
		* source
    kindstringspecifies the version kind such as semver, regex, or latest
    patternstringspecifies the version pattern according the version kind
    strictbooleanstrict enforce strict versioning rule. Only used for semantic versioning at this time

Example

# updatecli.yaml
name: Terraform Registry

sources:
  kubernetes:
    name: Get version from registry
    kind: terraform/registry
    spec:
      type: provider
      namespace: hashicorp
      name: kubernetes

  terraform-aws-modules:
    name: Get version from registry
    kind: terraform/registry
    spec:
      type: module
      namespace: terraform-aws-modules
      name: vpc
      targetsystem: aws

conditions:
  provider-using-value:
    name: Condition using value
    kind: terraform/registry
    disablesourceinput: true
    spec:
      type: provider
      namespace: hashicorp
      name: kubernetes
      version: 2.22.0

  module-using-value:
    name: Condition using value
    kind: terraform/registry
    disablesourceinput: true
    spec:
      type: module
      namespace: terraform-aws-modules
      name: vpc
      targetsystem: aws
      version: 5.1.0
Top