Integrate with the cloud.terraform collection
When you integrate with cloud.terraform, you must create a credential, build an execution environment, and launch a job template in Ansible Automation Platform.
Create a credential for using cloud.terraform Copy linkLink copied!
You can set up credentials directly from the Ansible Automation Platform user interface. The credentials are provided to the execution environment and Ansible Automation Platform reads them from there. This eliminates the need to manually update each playbook.
Before you begin Copy linkLink copied!
- You must have a Terraform API token.
- Install the certified
cloud.terraformcollection from automation hub. (You need an Ansible subscription to access and download collections on automation hub.)
Procedure Copy linkLink copied!
Build an execution environment in Ansible Automation Platform Copy linkLink copied!
You must build an execution environment using the automation controller so that Ansible Automation Platform can provide the credentials necessary for using its automation features.
Before you begin Copy linkLink copied!
- You need a pre-existing execution environment with the latest version of
cloud.terraformcollection before you can create it using an automation controller. You cannot use the default execution environment provided by Ansible Automation Platform because the default environment does not include theterraformCLI binary.Note If you have migrated from Terraform Community Edition, you can continue to use your existing execution environment and update it to the latest version of
cloud.terraform. - Install the
terraformCLI binary in your pre-existing execution environment. See Additional resources below for a link to the binary.
Procedure Copy linkLink copied!
- From the navigation panel, select .
- Click .

- For Name, enter a name for your Ansible Automation Platform execution environment.
- For Image, enter the repository link to the image for your pre-existing execution environment.
- Click . Your newly added execution environment is ready to be used in a job template.
Create and launch a job template Copy linkLink copied!
Create and launch a job template to complete the integration and use the automation features in Ansible Automation Platform.
Procedure Copy linkLink copied!
- From the navigation panel, select .
- Select Create template > Create Job Template.
- From the Execution Environment list, select the environment you created.
- From the Credentials list, select the credentials instance you created previously. If you do not see the credentials, click to see more options in the list.
- Enter any additional information for the required fields.
- Click .
- Click .
- To launch the job, click and . The job output shows that the job has run.
Results Copy linkLink copied!
To see that the job has run successfully from the Terraform user interface, select Workspaces > Ansible-Content-Integration > Run. The Run list shows the state of the Triggered via CLI job. You can see it go from the Queued to the Plan Finished state.