Configure the provider
You must configure the provider to allow Terraform to reference and manage a subset of Ansible Automation Platform resources.
Before you begin
- You have installed and configured Terraform Enterprise or HCP Terraform.
- You have installed the latest release version of
terraform-provider-aapfrom the Terraform registry.Note The default latest version on the Terraform registry might be a pre-release version (such as 1.2.3-beta). Select a supported release version, which uses a 1.2.3 format without dashes.
- You have created a username and password or an API token for Ansible Automation Platform. Environment variables are also supported.
Note Token authentication is recommended because users can manage tokens for specific integrations (such as Terraform), limit token access, and have full control over token lifecycle.
About this task
The provider configuration belongs in the root module of a Terraform configuration. Child modules receive their provider configurations from the root module.
Procedure
- Terraform Enterprise and HCP Terraform
- Terraform registry
- Local names
- required_providers block
- Expressions
- Alias configuration
- Terraform State
- Associate tokens with applications (2.5 and later)
- Create tokens for a user (2.4)
- The Module providers Meta-Argument
- Module Development: Providers Within Modules