| .github/workflows | ||
| examples | ||
| internal/provider | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| generate-provider-json.sh | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| Makefile | ||
| README.md | ||
| terraform-registry-manifest.json | ||
Terraform Provider for Edge Connect
This Terraform provider allows you to manage Edge Connect applications and application instances.
Features
- Manage application specifications (
edge-connect_appresource) - Manage application instances (
edge-connect_appinstresource) - Query existing applications and instances (data sources)
- Support for bearer token and basic authentication
- Full CRUD operations for all resources
Requirements
Installation
Using Terraform Registry (Recommended)
terraform {
required_providers {
edge-connect = {
source = "DevFW-CICD/edge-connect"
version = "~> 1.0"
}
}
}
Local Development
- Clone the repository:
git clone ssh://git@edp.buildth.ing/DevFW-CICD/terraform-provider-edge-connect.git
cd terraform-provider-edge-connect
- Build the provider:
go build -o terraform-provider-edge-connect
- Install locally:
mkdir -p ~/.terraform.d/plugins/registry.terraform.io/DevFW-CICD/edge-connect/1.0.0/darwin_arm64
cp terraform-provider-edge-connect ~/.terraform.d/plugins/registry.terraform.io/DevFW-CICD/edge-connect/1.0.0/darwin_arm64/
Note: Adjust the path based on your OS and architecture (e.g., linux_amd64, darwin_amd64, etc.)
Usage
Provider Configuration
As the provider is currently not officially registered for public download, terraform must be configured to use a locally built version.
To generate the binary run go install . from the repository root. This installs the provider binary to $HOME/go/bin and means that terraform init is not necessary.
You will also need a ~/.terraformrc file with the following contents. <home> should refer to your $HOME directory.
provider_installation {
dev_overrides {
"local/edge-connect" = "<home>/go/bin"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
You can then reference the local provider in your .tf files as follows:
provider "edge-connect" {
base_url = "https://edp.buildth.ing"
token = var.edge_connect_token
}
Or using basic authentication:
provider "edge-connect" {
base_url = "https://edp.buildth.ing"
username = var.edge_connect_username
password = var.edge_connect_password
}
Configuration can also be provided via environment variables:
EDGE_CONNECT_BASE_URLEDGE_CONNECT_TOKENEDGE_CONNECT_USERNAMEEDGE_CONNECT_PASSWORD
Creating an Application
resource "edge-connect_app" "example" {
region = "EU"
organization = "myorg"
name = "my-app"
version = "1.0.0"
image_type = "Docker"
image_path = "nginx:latest"
deployment = "kubernetes"
default_flavor = "EU.small"
access_ports = "tcp:80,tcp:443"
}
Creating an Application Instance
resource "edge-connect_appinst" "example" {
region = "EU"
app_organization = edge-connect_app.example.organization
app_name = edge-connect_app.example.name
app_version = edge-connect_app.example.version
cloudlet_organization = "cloudlet-org"
cloudlet_name = "edge-cloudlet-1"
cluster_organization = "cluster-org"
flavor = "EU.medium"
}
Using Data Sources
data "edge-connect_app" "existing" {
region = "EU"
organization = "myorg"
name = "existing-app"
version = "2.0.0"
}
output "app_image" {
value = data.edge-connect_app.existing.image_path
}
Resources
edge-connect_app
Manages an Edge Connect application specification.
Arguments
region(Required, Forces new resource) - The region where the app is deployed (e.g., 'EU')organization(Required, Forces new resource) - The organization that owns the appname(Required, Forces new resource) - The name of the applicationversion(Required, Forces new resource) - The version of the applicationimage_type(Required) - The type of image (e.g., 'Docker')image_path(Required) - The path to the container imagedeployment(Required) - The deployment type (e.g., 'kubernetes')default_flavor(Optional) - The default flavor (e.g., 'EU.small', 'EU.medium', 'EU.big', 'EU.large')deployment_manifest(Optional) - The Kubernetes deployment manifest (YAML)access_ports(Optional) - The access ports in format 'protocol:port' (e.g., 'tcp:80,tcp:443')annotations(Optional) - Annotations for the app
Attributes
id- The unique identifier (format: region/organization/name/version)created_at- The timestamp when the app was createdupdated_at- The timestamp when the app was last updated
edge-connect_appinst
Manages an Edge Connect application instance.
Arguments
region(Required, Forces new resource) - The region where the app instance is deployedapp_organization(Required, Forces new resource) - The organization that owns the appapp_name(Required, Forces new resource) - The name of the applicationapp_version(Required, Forces new resource) - The version of the applicationcloudlet_organization(Required, Forces new resource) - The organization that owns the cloudletcloudlet_name(Required, Forces new resource) - The name of the cloudletcluster_organization(Required, Forces new resource) - The organization that owns the clustercloudlet(Optional) - The cloudlet identifierflavor(Optional) - The flavor for the app instance
Attributes
id- The unique identifierreal_cluster_name- The real cluster namestate- The state of the app instanceruntime_info- Runtime information for the app instanceuri- The URI to access the app instanceliveness- The liveness status of the app instancepower_state- The power state of the app instancecreated_at- The timestamp when the app instance was createdupdated_at- The timestamp when the app instance was last updated
Data Sources
data.edge-connect_app
Fetches information about an existing Edge Connect application.
Arguments
region(Required) - The region where the app is deployedorganization(Required) - The organization that owns the appname(Required) - The name of the applicationversion(Required) - The version of the application
data.edge-connect_appinst
Fetches information about an existing Edge Connect application instance.
Arguments
region(Required) - The region where the app instance is deployedapp_organization(Required) - The organization that owns the appapp_name(Required) - The name of the applicationapp_version(Required) - The version of the applicationcloudlet_organization(Required) - The organization that owns the cloudletcloudlet_name(Required) - The name of the cloudletcluster_organization(Required) - The organization that owns the cluster
Examples
See the examples directory for complete usage examples.
Development
Building
go build -o terraform-provider-edge-connect
Testing
go test ./...
Running Example
cd examples
terraform init
terraform plan
terraform apply
Contributing
Contributions are welcome! Please submit pull requests or open issues on the repository.
License
This provider is distributed under the Mozilla Public License 2.0. See LICENSE for more information.
Support
For issues and questions:
- Open an issue on the repository
- Contact the DevFW-CICD team at https://edp.buildth.ing