azuredevops_check_required_template

Manages a Required Template Check.

Example Usage

Protect a service connection

resource "azuredevops_project" "example" {
  name = "Example Project"
}

resource "azuredevops_serviceendpoint_generic" "example" {
  project_id            = azuredevops_project.example.id
  server_url            = "https://some-server.example.com"
  username              = "username"
  password              = "password"
  service_endpoint_name = "Example Generic"
  description           = "Managed by Terraform"
}

resource "azuredevops_check_required_template" "example" {
  project_id           = azuredevops_project.example.id
  target_resource_id   = azuredevops_serviceendpoint_generic.example.id
  target_resource_type = "endpoint"

  required_template {
    repository_type = "azuregit"
    repository_name = "project/repository"
    repository_ref  = "refs/heads/main"
    template_path   = "template/path.yml"
  }
}

Protect an environment

resource "azuredevops_project" "example" {
  name = "Example Project"
}

resource "azuredevops_environment" "example" {
  project_id = azuredevops_project.example.id
  name       = "Example Environment"
}

resource "azuredevops_check_required_template" "example" {
  project_id           = azuredevops_project.example.id
  target_resource_id   = azuredevops_environment.example.id
  target_resource_type = "environment"

  required_template {
    repository_name = "project/repository"
    repository_ref  = "refs/heads/main"
    template_path   = "template/path.yml"
  }

  required_template {
    repository_name = "project/repository"
    repository_ref  = "refs/heads/main"
    template_path   = "template/alternate-path.yml"
  }
}

Arguments Reference

The following arguments are supported:

A required_template block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following attribute are exported:

Import

Importing this resource is not supported.