v0.13.0
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, andrpcapicommands. - Added
TerraformCommand.query()andTerraformCommand.stacks(). - Added
run_parallelismsupport toTerraformCommand.test(). - Added
AsyncTerraformCommandfor 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:
passCompatibility
- Terraform: 1.13.5
- go-plugin: 1.6.3
- Python: 3.9 to 3.14
Install
pip install "libterraform==0.13.0"Links
- PyPI: https://pypi.org/project/libterraform/0.13.0/
- Full changelog: v0.12.0...v0.13.0