Skip to content

artbikes/terraform-provider-marathon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marathon Terraform Provider

Install

$ go get github.com/Banno/terraform-provider-marathon

Usage

Provider Configuration

Use a tfvar file or set the ENV variable

$ export TF_VAR_marathon_url="http://marthon.domain.tld:8080"
variable "marathon_url" {}

provider "marathon" {
  url = "${var.marathon_url}"
}

If Marathon endpoint requires basic auth (with TLS, hopefully), optionally include username and password:

$ export TF_VAR_marathon_url="https://marthon.domain.tld:8443"
$ export TF_VAR_marathon_user="username"
$ export TF_VAR_marathon_password="password"
variable "marathon_url" {}
variable "marathon_user" {}
variable "marathon_password" {}

provider "marathon" {
  url = "${var.marathon_url}"
  basic_auth_user = "${var.marathon_user}"
  basic_auth_password = "${var.marathon_password}"
}

Basic Usage

resource "marathon_app" "hello-world" {
  app_id= "/hello-world"
  cmd = "echo 'hello'; sleep 10000"
  cpus = 0.01
  instances = 1
  mem = 16
  ports = [0]
}

Docker Usage

resource "marathon_app" "docker-hello-world" {
  app_id = "/docker-hello-world"
  container {
    docker {
      image = "hello-world"
    }
  }
  cpus = 0.01
  instances = 1
  mem = 16
  ports = [0]
}

Full Example

terraform file

Development

Build

$ go install

Test

$ export MARATHON_URL="http://marthon.domain.tld:8080"
$ ./test.sh

About

a Terraform (http://terraform.io) provider for interacting with Marathon (https://mesosphere.github.io/marathon/)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 94.2%
  • HCL 5.5%
  • Shell 0.3%