Skip to content

v0.13.0

Choose a tag to compare

@Prodesire Prodesire released this 09 Jun 06:44
· 1 commit to main since this release

Highlights

libterraform 0.13.0 updates the embedded Terraform runtime to 1.13.5 and adds AsyncTerraformCommand for asyncio-compatible Terraform command execution.

What's Changed

  • Updated Terraform from 1.12.2 to 1.13.5.
  • Added support for Terraform 1.13 query, stacks, and rpcapi commands.
  • Added TerraformCommand.query() and TerraformCommand.stacks().
  • Added run_parallelism support to TerraformCommand.test().
  • Added AsyncTerraformCommand for running Terraform commands from async Python code.
  • Added cooperative cancellation for async Terraform calls through Terraform's native shutdown path.

Async Usage Example

import asyncio

from libterraform import AsyncTerraformCommand


async def main():
    tf = AsyncTerraformCommand("/path/to/terraform/project")

    version = await tf.version()
    print(version.value)

    plan = await tf.plan()
    print(plan.retcode)


asyncio.run(main())

Cancelling an async Terraform task asks Terraform to shut down through its normal shutdown path:

task = asyncio.create_task(tf.apply())
task.cancel()

try:
    await task
except asyncio.CancelledError:
    pass

Compatibility

  • Terraform: 1.13.5
  • go-plugin: 1.6.3
  • Python: 3.9 to 3.14

Install

pip install "libterraform==0.13.0"

Links