# Configure the cloud management provider
Source: https://speakeasy.com/blog/release-terraform-per-resources

Large infrastructure companies often expose multiple APIs under a single platform: a cloud management API for creating and configuring resources, plus specialized APIs for managing individual databases, clusters, or other infrastructure components. Each API may have its own endpoint and credentials.

Terraform's configuration model presents a challenge here. It provides only two levels of configuration: global provider settings and individual resource settings. There's no concept of grouping related resources with shared configuration. This limitation meant you either needed to create separate Terraform providers for each API or write significant custom code to handle the complexity.

We've added support for per-resource security and server URLs in Terraform provider generation. This feature allows resource groups to declare their own endpoints and credentials while staying within a single provider.

## The challenge with multi-API infrastructure platforms

Infrastructure platforms often separate their control plane APIs from their data plane APIs. Here's a common pattern:

- **Cloud API**: Manages users, organizations, clusters, and high-level resources at `https://api.platform.com`
- **Cluster API**: Manages resources within a specific cluster at `https://cluster-abc123.platform.com` with cluster-specific credentials

Take MongoDB Atlas as a real-world example. The Atlas Admin API handles projects, clusters, and organizational resources. But once a cluster exists, managing databases, collections, and users within that cluster requires connecting to the cluster's specific API endpoint with database-specific credentials.

### The traditional approach: multiple providers

The technically correct solution in Terraform is to create separate providers:

```hcl

provider "platform_cloud" {
  api_token = var.cloud_token
  api_url   = "https://api.platform.com"
}