HCL
kind: hcl
On this page
source | condition | target |
---|---|---|
✔ | ✔ | ✔ |
Description
source
The HCL "source" retrieves an attribute from a HCL file at configured path.
condition
The HCL "condition" tests that attribute at configured path matches the value in a HCL file.
target
The HCL "target" ensures that an attribute at configured path in a HCL file is set to a specific value.
Parameter
Name | Type | Description | Required |
---|---|---|---|
file | string | “file” defines the hcl file path to interact with.
| |
files | array | “files” defines the list of hcl files path to interact with.
| |
path | string | “path” defines the hcl attribute path.
| |
value | string | “value” is the value associated with a hcl path.
|
Example
# updatecli.yaml
name: Basic HCL Example
scms:
default:
kind: git
spec:
url: https://github.com/updatecli/updatecli.git
sources:
local:
name: Get value from hcl
kind: hcl
scmid: default
spec:
file: pkg/plugins/resources/hcl/testdata/data.hcl
path: resource.person.john.first_name
http:
name: Get value from hcl
kind: hcl
spec:
file: https://raw.githubusercontent.com/updatecli/updatecli/master/pkg/plugins/resources/hcl/testdata/data.hcl
path: resource.person.john.first_name
conditions:
local:
name: Test value from hcl
kind: hcl
sourceid: local
scmid: default
spec:
file: pkg/plugins/resources/hcl/testdata/data.hcl
path: resource.person.john.first_name
http:
name: Test value from hcl
kind: hcl
disablesourceinput: true
spec:
file: https://raw.githubusercontent.com/updatecli/updatecli/master/pkg/plugins/resources/hcl/testdata/data.hcl
path: resource.person.john.first_name
value: John
targets:
local:
name: Test value from hcl
kind: hcl
sourceid: local
scmid: default
spec:
file: pkg/plugins/resources/hcl/testdata/data.hcl
path: resource.person.john.first_name
value: John