| .. | ||
| authentication | ||
| basic | ||
| complete | ||
| data-sources | ||
| .gitignore | ||
| README.md | ||
Terraform Provider Edge Connect Examples
This directory contains example Terraform configurations demonstrating the usage of the Edge Connect Terraform provider.
Available Examples
Authentication Examples (authentication/)
Dedicated examples showing both authentication methods with detailed documentation.
Features:
- Token-based authentication example
- Username/password authentication example
- Validation rules and error messages
- Best practices and recommendations
See: authentication/README.md for detailed authentication documentation.
1. Basic Example (basic/)
The simplest example showing how to create a single application.
Features:
- Provider configuration
- Creating a basic app resource
- Output values
Usage:
cd basic
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your credentials
terraform init
terraform plan
terraform apply
2. Complete Example (complete/)
A comprehensive example demonstrating multiple resources and realistic scenarios.
Features:
- Creating multiple applications
- Creating multiple app instances
- Configuring app instances with JSON config
- Deploying instances across different regions
- Multiple output values
Usage:
cd complete
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your credentials
terraform init
terraform plan
terraform apply
3. Data Sources Example (data-sources/)
Demonstrates using data sources to look up existing resources and use them in configurations.
Features:
- Using
edge-connect_appdata source - Using
edge-connect_app_instancedata source - Creating new resources based on existing data
- Referencing data source attributes
Usage:
cd data-sources
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your credentials and existing resource IDs
terraform init
terraform plan
terraform apply
Provider Configuration
The provider supports two authentication methods:
Option 1: Token-based Authentication
provider "edge-connect" {
endpoint = "https://api.edge-connect.example.com"
token = var.edge_connect_token
}
Option 2: Username/Password Authentication
provider "edge-connect" {
endpoint = "https://api.edge-connect.example.com"
username = var.edge_connect_username
password = var.edge_connect_password
}
Configuration Options
endpoint(required): The Edge Connect API endpoint URLtoken(optional, sensitive): Authentication token for the Edge Connect API. Required if username/password are not provided.username(optional): Username for the Edge Connect API. Required if token is not provided.password(optional, sensitive): Password for the Edge Connect API. Required if token is not provided.
Important: You must use either token authentication OR username/password authentication, but not both.
Resources
edge-connect_app
Manages an Edge Connect application.
Arguments:
name(required): Application nameversion(optional): Application versiondescription(optional): Application description
Attributes:
id: Application identifierstatus: Application status
Example:
resource "edge-connect_app" "example" {
name = "my-app"
version = "1.0.0"
description = "My application"
}
edge-connect_app_instance
Manages an Edge Connect application instance.
Arguments:
name(required): Instance nameapp_id(required): Associated application IDdescription(optional): Instance descriptionconfig(optional): Instance configuration (JSON string)
Attributes:
id: Instance identifierstatus: Instance status
Example:
resource "edge-connect_app_instance" "example" {
name = "my-app-instance"
app_id = edge-connect_app.example.id
config = jsonencode({
environment = "production"
replicas = 3
})
}
Data Sources
edge-connect_app
Retrieves information about an existing application.
Arguments:
id(required): Application identifier
Attributes:
name: Application nameversion: Application versiondescription: Application descriptionstatus: Application status
edge-connect_app_instance
Retrieves information about an existing application instance.
Arguments:
id(required): Instance identifier
Attributes:
name: Instance nameapp_id: Associated application IDdescription: Instance descriptionconfig: Instance configurationstatus: Instance status
Prerequisites
- Terraform >= 1.0
- Valid Edge Connect API credentials
- Access to an Edge Connect API endpoint
Getting Started
- Choose an example that fits your use case
- Navigate to the example directory
- Copy
terraform.tfvars.exampletoterraform.tfvars - Edit
terraform.tfvarswith your actual credentials - Run
terraform initto initialize the provider - Run
terraform planto see what will be created - Run
terraform applyto create the resources
Cleanup
To destroy the resources created by these examples:
terraform destroy
Notes
- Keep your
terraform.tfvarsfile secure as it contains sensitive credentials - The
terraform.tfvarsfile is gitignored by default - Always review the plan output before applying changes
- Some resources may take time to provision
Support
For issues or questions about the provider, please refer to the main provider documentation.