Provider Configuration Documentation

7 minute read

Provider Documentation Overview

The provider configuration documentation is the entry point for users. It must clearly explain authentication, configuration options, and getting started.

Page Structure

---
page_title: "Provider: CacheCloud"
description: |-
  The CacheCloud provider is used to interact with CacheCloud resources.
---

# CacheCloud Provider

[Overview]

## Example Usage

[Quick Start]

## Authentication

[Auth Methods]

## Schema

[Configuration Options]

Provider Overview

Clear Introduction

# CacheCloud Provider

The CacheCloud provider allows Terraform to create and manage resources in CacheCloud, a managed caching service supporting Redis and Memcached.

## Features

- **Multi-Engine Support**: Manage both Redis and Memcached caches
- **High Availability**: Configure multi-AZ deployments with automatic failover
- **Security**: Built-in support for encryption and VPC networking
- **Monitoring**: Integrated metrics and alerting
- **Backup & Recovery**: Automated backups with point-in-time recovery

## Supported Resources

- **Caches**: Create and manage cache instances
- **Clusters**: Configure cache clusters
- **Parameter Groups**: Customize cache parameters
- **Users**: Manage cache access control
- **Snapshots**: Create and restore backups

Getting Started

## Getting Started

### 1. Install the Provider

The provider is automatically downloaded when you run `terraform init`.

```terraform
terraform {
  required_providers {
    cachecloud = {
      source  = "example/cachecloud"
      version = "~> 1.0"
    }
  }
}

2. Configure Authentication

Set your API key:

export CACHECLOUD_API_KEY="your-api-key"

3. Create Your First Cache

provider "cachecloud" {}

resource "cachecloud_cache" "example" {
  name      = "my-first-cache"
  engine    = "redis"
  node_type = "cache.t3.micro"
}

4. Apply Configuration

terraform init
terraform plan
terraform apply

## Example Usage

### Basic Configuration

```markdown
## Example Usage

### Basic Setup

```terraform
provider "cachecloud" {
  api_key  = var.cachecloud_api_key
  endpoint = "https://api.cachecloud.example.com"
}

### Multiple Environments

```markdown
### Multi-Environment Setup

```terraform
# Production provider
provider "cachecloud" {
  alias    = "prod"
  api_key  = var.prod_api_key
  endpoint = "https://api.us-east-1.cachecloud.example.com"
  region   = "us-east-1"
}

# Development provider
provider "cachecloud" {
  alias    = "dev"
  api_key  = var.dev_api_key
  endpoint = "https://api.us-west-2.cachecloud.example.com"
  region   = "us-west-2"
}

# Use production provider
resource "cachecloud_cache" "prod" {
  provider  = cachecloud.prod
  name      = "prod-cache"
  engine    = "redis"
  node_type = "cache.m5.large"
}

# Use development provider
resource "cachecloud_cache" "dev" {
  provider  = cachecloud.dev
  name      = "dev-cache"
  engine    = "redis"
  node_type = "cache.t3.micro"
}

### Advanced Configuration

```markdown
### Advanced Configuration

```terraform
provider "cachecloud" {
  # Authentication
  api_key = var.cachecloud_api_key
  
  # Endpoint configuration
  endpoint = "https://api.cachecloud.example.com"
  region   = "us-east-1"
  
  # Retry configuration
  max_retries = 3
  timeout     = 30
  
  # TLS configuration
  skip_tls_verify     = false
  ca_certificate_path = "/path/to/ca.pem"
  
  # Rate limiting
  rate_limit          = 100
  rate_limit_interval = "1m"
  
  # Request headers
  headers = {
    "X-Custom-Header" = "value"
    "User-Agent"      = "terraform-provider-cachecloud/1.0"
  }
  
  # Debug logging
  debug = true
}

## Authentication

### Multiple Authentication Methods

```markdown
## Authentication

The provider supports multiple authentication methods:

### API Key (Recommended)

#### Environment Variable

```bash
export CACHECLOUD_API_KEY="your-api-key"
provider "cachecloud" {}

Provider Configuration

provider "cachecloud" {
  api_key = var.cachecloud_api_key
}

Configuration File

Create ~/.cachecloud/credentials:

[default]
api_key = your-api-key
region = us-east-1

[production]
api_key = prod-api-key
region = us-east-1

[development]
api_key = dev-api-key
region = us-west-2

Use specific profile:

provider "cachecloud" {
  profile = "production"
}

OAuth 2.0

provider "cachecloud" {
  auth_method  = "oauth"
  client_id     = var.client_id
  client_secret = var.client_secret
  token_url     = "https://auth.cachecloud.example.com/token"
}

IAM Role (AWS Integration)

provider "cachecloud" {
  auth_method = "iam"
  role_arn    = "arn:aws:iam::123456789012:role/CacheCloudAccess"
}

Service Account (Kubernetes)

provider "cachecloud" {
  auth_method              = "service_account"
  service_account_token    = var.sa_token
  service_account_endpoint = "https://k8s.example.com"
}

Authentication Precedence

  1. Provider configuration (api_key attribute)
  2. Environment variables (CACHECLOUD_API_KEY)
  3. Credentials file (~/.cachecloud/credentials)
  4. Instance metadata (IAM role on AWS) ```

Schema Documentation

Configuration Attributes

## Schema

### Optional

#### Authentication

- `api_key` (String, Sensitive) API key for authentication. Can also be set via `CACHECLOUD_API_KEY` environment variable.
- `auth_method` (String) Authentication method. Valid values: `api_key`, `oauth`, `iam`, `service_account`. Defaults to `api_key`.
- `profile` (String) Credentials profile name from `~/.cachecloud/credentials`. Defaults to `default`.

#### Endpoint Configuration

- `endpoint` (String) API endpoint URL. Defaults to `https://api.cachecloud.io`. Can be set via `CACHECLOUD_ENDPOINT`.
- `region` (String) Default region for resources. Can be set via `CACHECLOUD_REGION`.
- `account_id` (String) Account ID for multi-tenant environments. Can be set via `CACHECLOUD_ACCOUNT_ID`.

#### Network Configuration

- `skip_tls_verify` (Boolean) Skip TLS certificate verification. Not recommended for production. Defaults to `false`.
- `ca_certificate_path` (String) Path to custom CA certificate bundle.
- `proxy_url` (String) HTTP proxy URL for API requests.

#### Retry and Timeout

- `max_retries` (Number) Maximum number of retry attempts for failed requests. Valid range: 0-10. Defaults to `3`.
- `timeout` (Number) Request timeout in seconds. Valid range: 1-300. Defaults to `30`.
- `backoff_multiplier` (Number) Exponential backoff multiplier. Defaults to `2.0`.
- `backoff_min` (Number) Minimum backoff delay in seconds. Defaults to `1`.
- `backoff_max` (Number) Maximum backoff delay in seconds. Defaults to `30`.

#### Rate Limiting

- `rate_limit` (Number) Maximum requests per interval. Defaults to `100`.
- `rate_limit_interval` (String) Rate limit interval. Valid values: `1s`, `1m`, `1h`. Defaults to `1m`.

#### Logging and Debugging

- `debug` (Boolean) Enable debug logging. Logs include request/response details. Defaults to `false`.
- `log_level` (String) Logging level. Valid values: `trace`, `debug`, `info`, `warn`, `error`. Defaults to `info`.
- `log_file` (String) Path to log file. If not set, logs to stderr.

#### Custom Headers

- `headers` (Map of String) Custom HTTP headers to include in all requests.

Environment Variables

## Environment Variables

The provider supports these environment variables:

| Variable | Description | Default |
|----------|-------------|---------|
| `CACHECLOUD_API_KEY` | API key for authentication | - |
| `CACHECLOUD_ENDPOINT` | API endpoint URL | `https://api.cachecloud.io` |
| `CACHECLOUD_REGION` | Default region | - |
| `CACHECLOUD_ACCOUNT_ID` | Account ID | - |
| `CACHECLOUD_PROFILE` | Credentials profile | `default` |
| `CACHECLOUD_DEBUG` | Enable debug logging | `false` |
| `CACHECLOUD_TIMEOUT` | Request timeout (seconds) | `30` |
| `CACHECLOUD_MAX_RETRIES` | Maximum retry attempts | `3` |
| `CACHECLOUD_PROXY` | HTTP proxy URL | - |
| `CACHECLOUD_CA_CERT` | Path to CA certificate | - |
| `CACHECLOUD_SKIP_TLS_VERIFY` | Skip TLS verification | `false` |

### Usage

```bash
export CACHECLOUD_API_KEY="your-api-key"
export CACHECLOUD_REGION="us-east-1"
export CACHECLOUD_DEBUG="true"
export CACHECLOUD_TIMEOUT="60"

terraform apply

## Complete Documentation

```markdown
---
page_title: "Provider: CacheCloud"
description: |-
  Use the CacheCloud provider to manage cache infrastructure.
---

# CacheCloud Provider

The CacheCloud provider allows Terraform to manage CacheCloud resources including cache instances, clusters, parameter groups, and access controls.

## Quick Start

```terraform
terraform {
  required_providers {
    cachecloud = {
      source  = "example/cachecloud"
      version = "~> 1.0"
    }
  }
}

provider "cachecloud" {
  api_key = var.cachecloud_api_key
}

resource "cachecloud_cache" "example" {
  name      = "my-cache"
  engine    = "redis"
  node_type = "cache.t3.micro"
}

Example Usage

Basic Configuration

provider "cachecloud" {
  api_key = var.cachecloud_api_key
}

Multi-Region Setup

provider "cachecloud" {
  alias    = "us_east"
  api_key  = var.api_key
  region   = "us-east-1"
}

provider "cachecloud" {
  alias    = "eu_west"
  api_key  = var.api_key
  region   = "eu-west-1"
}

resource "cachecloud_cache" "us" {
  provider  = cachecloud.us_east
  name      = "us-cache"
  engine    = "redis"
  node_type = "cache.t3.micro"
}

Advanced Configuration

provider "cachecloud" {
  # Authentication
  api_key = var.cachecloud_api_key
  region  = "us-east-1"
  
  # Timeouts and retries
  timeout     = 60
  max_retries = 5
  
  # Custom endpoint (for private deployments)
  endpoint = "https://api.internal.example.com"
  
  # Debug logging
  debug = var.enable_debug
}

Authentication

API Key

The recommended authentication method:

export CACHECLOUD_API_KEY="your-api-key"
provider "cachecloud" {}

Or specify in configuration:

provider "cachecloud" {
  api_key = var.cachecloud_api_key
}

Configuration File

Create ~/.cachecloud/credentials:

[default]
api_key = your-api-key
region = us-east-1
provider "cachecloud" {
  profile = "default"
}

IAM Role (AWS Integration)

For providers running on AWS:

provider "cachecloud" {
  auth_method = "iam"
  role_arn    = "arn:aws:iam::123456789012:role/CacheCloudAccess"
}

Schema

Optional

  • api_key (String, Sensitive) API key for authentication
  • endpoint (String) API endpoint URL
  • region (String) Default region
  • profile (String) Credentials profile name
  • timeout (Number) Request timeout in seconds (1-300). Default: 30
  • max_retries (Number) Maximum retry attempts (0-10). Default: 3
  • debug (Boolean) Enable debug logging. Default: false

Environment Variables

  • CACHECLOUD_API_KEY - API key
  • CACHECLOUD_ENDPOINT - API endpoint
  • CACHECLOUD_REGION - Default region
  • CACHECLOUD_DEBUG - Enable debug logging

Support

  • Documentation: https://docs.cachecloud.example.com
  • API Reference: https://api-docs.cachecloud.example.com
  • GitHub: https://github.com/example/terraform-provider-cachecloud
  • Issues: https://github.com/example/terraform-provider-cachecloud/issues ```

Best Practices

1. Clear Authentication Instructions

# ✅ Good: Multiple clear methods
## Authentication

### Method 1: Environment Variable (Recommended)
```bash
export CACHECLOUD_API_KEY="your-key"

Method 2: Terraform Variables

provider "cachecloud" {
  api_key = var.api_key
}

❌ Bad: Vague instructions

Authentication

Set your API key.


### 2. Working Examples

```markdown
# ✅ Good: Complete, testable example
```terraform
terraform {
  required_providers {
    cachecloud = {
      source  = "example/cachecloud"
      version = "~> 1.0"
    }
  }
}

provider "cachecloud" {
  api_key = var.cachecloud_api_key
}

resource "cachecloud_cache" "example" {
  name      = "my-cache"
  engine    = "redis"
  node_type = "cache.t3.micro"
}

❌ Bad: Incomplete example

provider "cachecloud" {}

### 3. Document Defaults

```markdown
# ✅ Good: Clear defaults
- `timeout` (Number) Request timeout in seconds. Valid range: 1-300. Defaults to `30`.

# ❌ Bad: No default information
- `timeout` (Number) Request timeout

Key Takeaways

  • ✅ Provide clear getting started instructions
  • ✅ Document all authentication methods
  • ✅ Show complete, working examples
  • ✅ List all configuration options with defaults
  • ✅ Document environment variables
  • ✅ Include multi-region/multi-environment examples
  • ✅ Explain authentication precedence
  • ✅ Provide troubleshooting guidance
  • ✅ Link to additional resources
  • ✅ Keep examples realistic and testable

What’s Next?

Learn how to create comprehensive guides and examples for common use cases.

Next: Guides & Examples →


Previous: ← Data Source Documentation
Next: Guides & Examples →

Last updated: June 30, 2026

Updated: