Terraform Lock
kind: terraform/lock
On this page
source | condition | target |
---|---|---|
✗ | ✔ | ✔ |
Description
condition
The terraform/lock "condition" tests that lock file version and hashes match the value for a given provider.
target
The terraform/lock "target" ensures that an the lock file version and hashes are update to date for given provider.
Parameter
Name | Type | Description | Required |
---|---|---|---|
file | string | “file” defines the terraform lock file path to interact with.
| |
files | array | “files” defines the list of terraform lock files path to interact with.
| |
platforms | array | “platforms” is the target platforms to request package checksums for.
| |
provider | string | “provider” is the terraform provider you wish to update, supports with or without registry url.
| |
skipconstraints | boolean | “skipconstraints” will control whether the constraint in lock file is updated
| |
value | string | “value” is the value associated with a terraform provider.
|
Example
The example uses an additional resource plugin: terraform/registry
.
# updatecli.yaml
name: Terraform Lock
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/lock
disablesourceinput: true
spec:
file: .terraform.lock.hcl
provider: hashicorp/kubernetes
platforms:
- linux_amd64
value: 2.22.0
https:
name: Condition using HTTP
kind: terraform/lock
disablesourceinput: true
spec:
file: https://raw.githubusercontent.com/updatecli-test/jenkins-infra-aws/main/.terraform.lock.hcl
provider: hashicorp/kubernetes
platforms:
- linux_amd64
value: 2.22.0
targets:
update-file-from-source:
name: Update files content from value
kind: terraform/lock
sourceid: kubernetes
spec:
file: .terraform.lock.hcl
provider: hashicorp/kubernetes
platforms:
- linux_amd64