Create Terraform plugin procedures

2 minute readExtensibilityDeveloper productivity

Plugin procedures can be used in procedure steps, process steps, and pipeline tasks, allowing you to orchestrate third-party tools at the appropriate time in your component, application process, or pipeline.

Depending on your plugin configuration and how you run procedures, the Input parameters  Configuration name field may behave differently in the CloudBees CD/RO UI. For more information, refer to Differences in plugin UI behavior.

Apply

Executes the terraform apply command.

Input parameters

Table 1. Apply input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Terraform plan name

Required. File name that is used as the Terraform plan.

Additional command-line arguments

Arguments for the command line. For example, -var 'foo=bar'.

Output property

Required. Property name used to store the results of the terraform show command, if provisioning was successful.

CreateTerraformConfig

Creates a Terraform configuration in the Terraform working directory.

Input parameters

Table 2. CreateTerraformConfig input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Terraform config file name

Required. Name of the config file to be written.

If this file already exists, it is overwritten.

Source of Terraform config file

Required. Source of the Terraform config file. This can be an existing file or a new file.

Terraform config file location

Location of the Terraform config file in the file system. This file is copied to the Terraform working directory.

Terraform config file content

The Terraform config file content to be written.

Destroy

Executes the terraform destroy command.

Input parameters

Table 3. Destroy input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Additional command-line arguments

Arguments for the command line. For example, -var 'foo=bar'.

Init

Executes the terraform init command.

Input parameters

Table 4. Init input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Additional command-line arguments

Arguments for the command line. For example, -var 'foo=bar'.

Plan

Executes the terraform plan command.

Input parameters

Table 5. Plan input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Terraform plan name

Required. File name that is used as the Terraform plan.

Additional command-line arguments

Arguments for the command line. For example, -var 'foo=bar'.

Provision

Provisions environments using Terraform.

Input parameters

Table 6. Provision input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Source of Terraform config file

Required. Source of the Terraform config file. This can be an existing file or a new file.

Terraform config file location

Location of the Terraform config file in the file system. This file is copied to the Terraform working directory.

Terraform config file content

The Terraform config file content to be written.

Output property

Required. Property name used to store the results of the terraform show command, if provisioning was successful.

RunCustomCommand

Runs the Terraform custom command.

Input parameters

Table 7. RunCustomCommand input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Terraform command

Required. Terraform command to use. For example, init.

Additional command-line arguments

Arguments for the command line. For example, -var 'foo=bar'.

Output property path

This property contains the procedure execution output.

Switch workspace?

If selected, Terraform switches from the configuration to the workspace.

Apply variables file?

If selected, the variables file from the configuration is applied to the custom command.