terraform {
required_providers {
anypoint = {
source = "mulesoft/anypoint"
version = "~> 1.0.0"
}
}
}
Install and Configure the Terraform Provider
To use the MuleSoft Terraform provider, install the provider from the Terraform Registry and configure authentication for your MuleSoft Platform organization.
The provider supports Terraform-based management for MuleSoft Platform resources, including CloudHub 2.0, API Manager, Access Management, Secrets Manager, MCP servers, and AI agent resources.
Access the Provider in the Terraform Registry
Go to the Terraform Registry and search for the MuleSoft Terraform provider.
For provider installation instructions and the complete list of supported resources, see the MuleSoft Terraform provider documentation.
Add the Provider
Add the provider to your Terraform configuration file:
Replace 1.0.0 with the latest version. See the MuleSoft Anypoint provider on the Terraform Registry for the current release.
|
Configure Credentials
The provider supports two types of connected apps depending on the resources you manage.
Standard Connected App
Most resources use a standard connected app (client credentials only):
export TF_VAR_anypoint_client_id="<client-id>"
export TF_VAR_anypoint_client_secret="<client-secret>"
export TF_VAR_anypoint_base_url="https://anypoint.mulesoft.com"
Admin Connected App
Some resources require an admin connected app configured with user credentials. This is needed for resources that authenticate on behalf of a user:
export TF_VAR_anypoint_admin_client_id="<admin-connected-app-client-id>"
export TF_VAR_anypoint_admin_client_secret="<admin-connected-app-client-secret>"
export TF_VAR_anypoint_admin_username="<admin-username>"
export TF_VAR_anypoint_admin_password="<admin-password>"
export TF_VAR_anypoint_base_url="https://anypoint.mulesoft.com"
Configure the Provider
Configure the provider using the authentication method required for your resources.
Standard Connected App
provider "anypoint" {
client_id = var.anypoint_client_id
client_secret = var.anypoint_client_secret
base_url = var.anypoint_base_url
}
Admin Connected App
provider "anypoint" {
alias = "admin"
username = var.anypoint_admin_username
password = var.anypoint_admin_password
client_id = var.anypoint_admin_client_id
client_secret = var.anypoint_admin_client_secret
base_url = var.anypoint_base_url
}
The provider also supports additional authentication methods, including access token authentication and control plane configuration. For the complete provider configuration reference, see the MuleSoft Terraform provider documentation.



