terraform

Collection: community.general

Full Name: parallax.community.general.terraform

Aliases: community.general.terraform, terraform

Synopsis

Apply and destroy Terraform configurations

Parameters

NameTypeRequiredDefaultDescription
project_pathstringyesPath to the Terraform project directory
statestringpresentDesired state (present to apply, absent to destroy, planned to plan only)
plan_filestringPath to an existing plan file to apply
state_filestringPath to the Terraform state file
variablesstringTerraform variables as key=value pairs, comma-separated
targetsstringTerraform resource targets, comma-separated
lockbooltrueLock the state file during operations
lock_timeoutint0Duration to wait for state lock in seconds
force_initboolfalseForce terraform init even if already initialized
backend_configstringBackend configuration as key=value pairs, comma-separated
binary_pathstringterraformPath to the terraform binary
parallelismint10Number of concurrent operations
workspacestringdefaultTerraform workspace to use
purge_workspaceboolfalseDelete the workspace after destroy
overwrite_initbooltrueOverwrite existing init configuration
check_destroyboolfalseCheck if the plan would destroy resources
init_reconfigureboolfalseForce reconfiguration of the backend during init

Example

- name: Apply the network stack
  terraform:
    project_path: /srv/infra/network
    state: present
    force_init: true
    workspace: production