/terraform-provider-swarm

A Terraform Provider for creating and managing Docker Swarm clusters

Primary LanguageGoGNU Affero General Public License v3.0AGPL-3.0

Terraform Provider for Docker Swarm

Go

terraform-provider-swarm is a Terraform provider for the creation and management of Docker Swarm clusters (an alternative container orchestrator to Kubernetes and Nomad)

Quick Start

Run the following command to build the provider

make install

Sample Configuration

main.tf:

terraform {
    required_providers {
        swarm = {
            source = "aucloud/swarm"
            version = "~> 1.2"
        }
    }
}

provider "swarm" {
  use_local = true
}

resource "swarm_cluster" "local_cluster" {
  nodes {
    hostname = "localhost"
    public_address = "127.0.0.1"
    private_address = "127.0.0.1"
    tags = {
      role = "manager"
    }
  }
}

output "cluster" {
  value = data.swarm_cluster.local_cluster
}

Initialize and apply the Terraform:

terraform init
terraform apply

For a full example see examples/main.tf

License

terraform-provider-swarm is licensed under the terms of the AGPLv3