Categorygithub.com/turnerlabs/terraform-provider-harbor
repositorypackage
0.7.0-pre
Repository: https://github.com/turnerlabs/terraform-provider-harbor.git
Documentation: pkg.go.dev

# README

terraform-provider-harbor

A Terraform provider for managing Harbor resources.

Benefits

  • infrastructure as code (versionable and reproducible infrastructure)
  • all of your infrastructure declared in a single place, format, command
  • native integration with the vast landscape of existing terraform providers
  • user doesn't have to understand idiosyncrasies of ShipIt and Trigger, and what types of changes require setting replicas = 0 and triggering
  • HTTPS/TLS setup via IaC
  • AWS Tag integration
  • AWS Route53 integration (outputs managed load balancer information)
  • AWS ACM integration
  • AWS Role integration (coming)
  • works with changes made in GUI or CLI
  • leverages terraform's first class support state synchronization

asciicast

Installation

  • install plugin (depends on terraform v0.10.0 or later)
curl -s get-tf.harbor.turnerlabs.io | sh
  • install harbor-compose which is required for authentication and for deploying your application images and environment variables on to the infrastructure
curl -s get-cli.harbor.turnerlabs.io | sh
  • *note that you can install the pre-release (develop branch) using this command
curl -s beta.get-tf.harbor.turnerlabs.io | sh

Provider Documentation

Usage example

provider "harbor" {
  credentials = "${file("~/.harbor/credentials")}"
}

resource "harbor_shipment" "app" {
  shipment = "my-app"
  group    = "mss"
}

resource "harbor_shipment_env" "dev" {
  shipment    = "${harbor_shipment.app.id}"
  environment = "dev"
  barge       = "digital-sandbox"
  replicas    = 4
  monitored   = false

  container {
    name = "my-app"

    port {
      protocol    = "http"
      public_port = 80
      value       = 5000
      healthcheck = "/health"
    }
  }
}

output "dns_name" {
  value = "${harbor_shipment_env.dev.dns_name}"
}

Other examples