Getting started Community Training Tutorials Documentation APIs, AI & Tools
terraform {
required_providers {
anypoint = {
source = "mulesoft/anypoint"
version = "~> 1.0.0"
}
}
}
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.
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 to your Terraform configuration file:
terraform {
required_providers {
anypoint = {
source = "mulesoft/anypoint"
version = "~> 1.0.0"
}
}
}
Replace 1.0.0 with the latest version. See the MuleSoft Anypoint provider on the Terraform Registry for the current release.
|
The provider supports two types of connected apps depending on the resources you manage.
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"
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 using the authentication method required for your resources.
provider "anypoint" {
client_id = var.anypoint_client_id
client_secret = var.anypoint_client_secret
base_url = var.anypoint_base_url
}
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.