Skip to main content

Terraform Library for Robot Framework

The TerraformLibrary is a wrapper for the Hashicorp Terraform CLI

With the integration of Terraform into Robot Framework, inputs can be passed from tests to terraform executions and outputs from terraform script can be used in robot tests. Commands like terraform init, plan, apply and destroy can be used with any terraform script.

https://developer.hashicorp.com/terraform/cli


Keyword Documentation

Link to the keyword documentation


Installation

If you already have Python >= 3.8 with pip installed, you can simply run:
pip install --upgrade robotframework-terraformlibrary


Getting started

Some examples how to import and use the library.

*** Settings ***
Library            TerraformLibrary

*** Variables ***
${PATH_TO_TERRAFORM_SCRIPT}    ${CURDIR}/terraform-script

*** Test Cases ***
Run Terraform Init
    ${rc}    ${output}    Terraform Init    ${PATH_TO_TERRAFORM_SCRIPT}

Run Terraform Plan
    Set TF Var    my_var    test_value
    ${rc}    ${output}    Terraform Plan    ${PATH_TO_TERRAFORM_SCRIPT}
    Should Contain    ${output}    Plan: 1 to add, 0 to change, 0 to destroy.

Run Terraform Apply
    ${rc}    ${output}    Terraform Apply    ${PATH_TO_TERRAFORM_SCRIPT}
    Should Contain    ${output}    Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Inspect Terraform State
    ${output}    Get Terraform State    ${PATH_TO_TERRAFORM_SCRIPT}
    Should Be Equal As Strings    ${output["values"]["root_module"]["resources"][0]["name"]}    foo

Run Terraform Destroy
    ${rc}    ${output}    Terraform Destroy    ${PATH_TO_TERRAFORM_SCRIPT}
    Should Contain    ${output}    Destroy complete! Resources: 1 destroyed.

Metadata

Release files for robotframework-terraformlibrary 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robotframework-terraformlibrary 0.2.0
File Size Uploaded
robotframework_terraformlibrary-0.2.0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for robotframework-terraformlibrary 0.2.0
File Interpreter ABI Platform
robotframework_terraformlibrary-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / robotframework_terraformlibrary-0.2.0.tar.gz

Download URL robotframework_terraformlibrary-0.2.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2565b1bfa14f30f8c48de4dc06a94f5667e5123a8e9dac8beec79674be03b85d
BLAKE2b-256 checksum
How to use checksums
248a34e04631de7563094414c2ce059eab5753a1d40c4f2205314768cba88680
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 25, 2025.

Transparency log

Release files / robotframework_terraformlibrary-0.2.0-py3-none-any.whl

Download URL robotframework_terraformlibrary-0.2.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
299f6da572df8d8f4339b0b2dadabbaa93566a98a42bdfa32762a73d0638b0e4
BLAKE2b-256 checksum
How to use checksums
258c46ef42ba4c39394472c5e5437d8899e3b7d27742b02cf4abd26c482939f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 25, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page