2021-03-29 16:22:23 +02:00
metadata :
name : terraformExecute
description : Executes Terraform
longDescription : |
This step executes the terraform binary with the given command, and is able to fetch additional variables from vault.
spec :
inputs :
2021-10-29 13:58:34 +02:00
secrets :
- name : cliConfigFileCredentialsId
description : Jenkins 'Secret file' credentials ID containing terraform CLI configuration. You can find more details about it in the [Terraform documentation](https://www.terraform.io/docs/cli/config/config-file.html#credentials).
type : jenkins
2021-03-29 16:22:23 +02:00
params :
- name : command
type : string
scope :
- PARAMETERS
- STAGES
- STEPS
default : plan
- name : terraformSecrets
scope :
- PARAMETERS
- STAGES
- STEPS
type : string
resourceRef :
- type : vaultSecretFile
2021-12-15 21:12:57 +02:00
name : terraformFileVaultSecretName
2021-10-29 13:58:34 +02:00
default : terraform
2021-10-28 16:20:14 +02:00
- name : globalOptions
type : "[]string"
scope :
- PARAMETERS
- STAGES
- STEPS
2021-03-29 16:22:23 +02:00
- name : additionalArgs
type : "[]string"
scope :
- PARAMETERS
- STAGES
- STEPS
2021-10-29 12:06:06 +02:00
- name : init
type : bool
descriptions : Executes terraform init prior to the configured command.
scope :
- PARAMETERS
- STAGES
- STEPS
default : false
2021-10-29 13:58:34 +02:00
- name : cliConfigFile
type : string
description : Path to the terraform CLI configuration file (https://www.terraform.io/docs/cli/config/config-file.html#credentials).
scope :
- PARAMETERS
- STAGES
- STEPS
secret : true
resourceRef :
- name : cliConfigFileCredentialsId
type : secret
- type : vaultSecretFile
name : cliConfigFileVaultSecretName
default : terraform
2021-11-04 14:03:45 +02:00
- name : workspace
type : string
descriptions : Name of the terraform workspace to operate on.
scope :
- PARAMETERS
- STAGES
- STEPS
2021-03-29 16:22:23 +02:00
containers :
- name : terraform
2021-11-04 13:24:57 +02:00
image : hashicorp/terraform:1.0.10
2021-10-28 13:14:29 +02:00
options :
- name : --entrypoint
value : ''
2021-10-28 16:55:43 +02:00
env :
- name : TF_IN_AUTOMATION
value : piper
2021-11-04 11:28:41 +02:00
outputs :
resources :
- name : commonPipelineEnvironment
type : piperEnvironment
params :
- name : custom/terraformOutputs
type : 'map[string]interface{}'