Terraform Provider

kind: terraform/provider

sourceconditiontarget

Description

condition

The terraform/provider "condition" tests that a version in the required_provider block matches the value for a given provider.

target

The terraform/provider "target" ensures that a version is the required_provider block is update to date for given provider.

Parameter

NameTypeDescriptionRequired
filestring

“file” defines the file path to interact with.

	compatible:
		* condition
		* target

	remark:
		* "file" and "files" are mutually exclusive
		* protocols "https://", "http://", and "file://" are supported in path for condition
filesarray

“files” defines the list of files path to interact with.

	compatible:
		* condition
		* target

	remark:
		* file and files are mutually exclusive
		* when using as a condition only one file is supported
		* protocols "https://", "http://", and "file://" are supported in file path for condition
providerstring

“provider” is the terraform provider you wish to update.

	compatible:
		* condition
		* target
valuestring

“value” is the value associated with a terraform provider.

	compatible:
		* condition
		* target

	default:
		When used from a condition or a target, the default value is set to linked source output.

Example

The example uses an additional resource plugin: terraform/registry.

# updatecli.yaml
name: Terraform Provider

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

conditions:
  using-value:
    name: Condition using value
    kind: terraform/provider
    disablesourceinput: true
    spec:
      file: versions.tf
      provider: kubernetes
      value: 2.22.0

targets:
  update-file-from-source:
    name: Update files content from value
    kind: terraform/provider
    sourceid: kubernetes
    spec:
      file: versions.tf
      provider: kubernetes
Top