Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/turnerlabs/terraform-provider-harbor

A Terraform provider for managing Harbor infrastructure
https://github.com/turnerlabs/terraform-provider-harbor

go harbor iac infrastructure-as-code provider terraform

Last synced: 3 months ago
JSON representation

A Terraform provider for managing Harbor infrastructure

Awesome Lists containing this project

README

        

terraform-provider-harbor
==========================

A [Terraform](https://www.terraform.io/) provider for managing [Harbor](https://github.com/turnerlabs/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](https://asciinema.org/a/IxeoNYl7RmmSTwYMURtODytHO.png)](https://asciinema.org/a/IxeoNYl7RmmSTwYMURtODytHO?autoplay=1)

### Installation

- install plugin (depends on terraform v0.10.0 or later)
```
curl -s get-tf.harbor.turnerlabs.io | sh
```

- install [harbor-compose](https://github.com/turnerlabs/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](wiki)

### Usage example

```hcl
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

- [Log Shipping](examples/log-shipping)
- [DNS and TLS/HTTPS using AWS](examples/dns-ssl)
- [TLS/HTTPS using an IAM certificate](examples/iam-cert)
- [Multiple Environments](examples/multi-environment)
- [ALB Load Balancer](examples/lb-alb)