1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/resources/metadata/terraformExecute.yaml
Christian Volk 874a314bf7
feat(terraformExecute): workspace selection (#3233)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-04 13:03:45 +01:00

87 lines
2.5 KiB
YAML

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:
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
params:
- name: command
type: string
scope:
- PARAMETERS
- STAGES
- STEPS
default: plan
- name: terraformSecrets
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
resourceRef:
- type: vaultSecretFile
name: terraformExecuteFileVaultSecret
default: terraform
- name: globalOptions
type: "[]string"
scope:
- PARAMETERS
- STAGES
- STEPS
- name: additionalArgs
type: "[]string"
scope:
- PARAMETERS
- STAGES
- STEPS
- name: init
type: bool
descriptions: Executes terraform init prior to the configured command.
scope:
- PARAMETERS
- STAGES
- STEPS
default: false
- 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
- name: workspace
type: string
descriptions: Name of the terraform workspace to operate on.
scope:
- PARAMETERS
- STAGES
- STEPS
containers:
- name: terraform
image: hashicorp/terraform:1.0.10
options:
- name: --entrypoint
value: ''
env:
- name: TF_IN_AUTOMATION
value: piper
outputs:
resources:
- name: commonPipelineEnvironment
type: piperEnvironment
params:
- name: custom/terraformOutputs
type: 'map[string]interface{}'