Terrascript supports Python 3.6 and later.
Module layout
Python-Terrascript release 0.8.0 changed the location of modules.
Providers, resources and data sources are now all available through just
three modules.
import terrascript
import terrascript.provider # aws, google, ...
import terrascript.resource # aws_instance, google_compute_instance, ...
import terrascript.data # aws_ami, google_compute_image, ...
The legacy layout is still available but should not be used for new projects.
import terrascript
import terrascript.aws # aws
import terrascript.aws.r # aws_instance, ...
import terrascript.aws.d # aws_ami, ...
A first example
The following example has been taken from the official Terraform documentation
for the AWS Provider and then converted into a Python script that generates