Skip to content

juliosueirasED/terraform-provider-azuredevops

Repository files navigation

Terraform Provider for AzureDevOps

Table of Contents

About EllisDon-OSS

Placeholder

Features

Features List
  • Query Users and Groups
  • Manage the lifecycle of Variable Group
  • Manage the lifecycle of Task Group
  • Manage the lifecycle of Service Endpoint of any type
  • Manage the lifecycle of Service hook of any type
  • Manage the lifecycle of Release Pipeline
  • Manage the partial section of Release Pipeline
  • Manage the lifecycle of Build Pipeline for both Yaml-based and direct build tasks
  • Manage the lifecycle of Project
  • Inject Single Tasks, or Group of Tasks into Release Pipeline
  • All Resources support import
  • Full Documentation

Requirements

Building The Provider

Requirements

  • You will need Go with GO111MODULE enabled

Build

First build by running the following command

go get github.com/ellisdon-oss/terraform-provider-azuredevops

then copy the terraform-provider-azuredevops binary to your terraform plugin folder or your terraform project folder(plugin folder can be either $HOME/.terraform.d/plugins/ or %APPDATA%\terraform.d\plugins)

Install The Provider

  1. Build the provider or grab the provider binary from the release page
  2. Extra and copy the provider binary to the terraform global folder(Mac/Linux ~/.terraform.d/plugins or Windows %APPDATA%\terraform.d\plugins)

Examples

NOTE: All examples have their full version in examples folder

Creating a Project

resource "azuredevops_project" "default" {
  name       = "a-azuredevops-project"
  visibility = "private"
  capabilities {
    version_control {
      source_control_type = "git"
    }
    process_template {
      template_type_id = "adcc42ab-9882-485e-a3ed-7678f01f66bc"
    }
  }
}

ref: Project

Creating Service Endpoint (Kubernetes)

Code Example
...

resource "azuredevops_service_endpoint" "kubernetes" {
  name       = "kubernetes-example"
  owner      = "Library"
  project_id = azuredevops_project.default.id
  type       = "kubernetes"
  url        = "http://<kube-cluster-url>"

  authorization {
    parameters = {
      apiToken                  = "<kube-token>"
      serviceAccountCertificate = "<kube-cert>"
    }

    scheme = "Token"
  }

  data = {
    acceptUntrustedCerts = "true"
    authorizationType    = "ServiceAccount"
  }
}

ref: Service Endpoint

Creating Service Endpoint (GitHub)

Code Example
...

resource "azuredevops_service_endpoint" "github" {
  name       = "github-example"
  owner      = "Library"
  project_id = azuredevops_project.default.id
  type       = "github"
  url        = "http://github.com"

  # To enable all Pipeline to use this service endpoint
  allow_all_pipelines = true

  authorization {
    scheme = "PersonalAccessToken"
    parameters = {
      accessToken = "<github-token>"
    }
  }

  data = {}
}

ref: Service Endpoint

More examples are in here

Contributing

  1. Fork the repo
  2. Make the changes
  3. Preferably before PR, the commits should be rebase and squash to 1 commit
  4. create a new PR (new features should be in a new features/ branch and patches should be in patches/ branch)

Note: please add yourself into CONTRIBUTORS.md before submitting PR

Todo-List

  • Add Docker Image for provider
  • Full Documentation

License

Mozilla Public License v2.0

About

Terraform Provider for AzureDevOps

Resources

License

Stars

Watchers

Forks

Packages

No packages published