Manages a business hours check on a resource within Azure DevOps.
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_business_hours" "example" {
project_id = azuredevops_project.example.id
display_name = "Managed by Terraform"
target_resource_id = azuredevops_serviceendpoint_generic.example.id
target_resource_type = "endpoint"
start_time = "07:00"
end_time = "15:30"
time_zone = "UTC"
monday = true
tuesday = true
timeout = 1440
}
resource "azuredevops_project" "example" {
name = "Example Project"
}
resource "azuredevops_environment" "example" {
project_id = azuredevops_project.example.id
name = "Example Environment"
}
resource "azuredevops_check_business_hours" "example" {
project_id = azuredevops_project.example.id
display_name = "Managed by Terraform"
target_resource_id = azuredevops_environment.example.id
target_resource_type = "environment"
start_time = "07:00"
end_time = "15:30"
time_zone = "UTC"
monday = true
tuesday = true
}
resource "azuredevops_project" "example" {
name = "Example Project"
}
resource "azuredevops_agent_pool" "example" {
name = "example-pool"
}
resource "azuredevops_agent_queue" "example" {
project_id = azuredevops_project.example.id
agent_pool_id = azuredevops_agent_pool.example.id
}
resource "azuredevops_check_business_hours" "example" {
project_id = azuredevops_project.example.id
display_name = "Managed by Terraform"
target_resource_id = azuredevops_agent_queue.example.id
target_resource_type = "queue"
start_time = "07:00"
end_time = "15:30"
time_zone = "UTC"
monday = true
tuesday = true
}
resource "azuredevops_project" "example" {
name = "Example Project"
}
resource "azuredevops_git_repository" "example" {
project_id = azuredevops_project.example.id
name = "Example Empty Git Repository"
initialization {
init_type = "Clean"
}
}
resource "azuredevops_check_business_hours" "example" {
project_id = azuredevops_project.example.id
display_name = "Managed by Terraform"
target_resource_id = "${azuredevops_project.example.id}.${azuredevops_git_repository.example.id}"
target_resource_type = "repository"
start_time = "07:00"
end_time = "15:30"
time_zone = "UTC"
monday = true
tuesday = true
}
resource "azuredevops_project" "example" {
name = "Example Project"
}
resource "azuredevops_variable_group" "example" {
project_id = azuredevops_project.example.id
name = "Example Variable Group"
description = "Example Variable Group Description"
allow_access = true
variable {
name = "key1"
value = "val1"
}
variable {
name = "key2"
secret_value = "val2"
is_secret = true
}
}
resource "azuredevops_check_business_hours" "example" {
project_id = azuredevops_project.example.id
display_name = "Managed by Terraform"
target_resource_id = azuredevops_variable_group.example.id
target_resource_type = "variablegroup"
start_time = "07:00"
end_time = "15:30"
time_zone = "UTC"
monday = true
tuesday = true
}
The following arguments are supported:
project_id
- (Required) The project ID.target_resource_id
- (Required) The ID of the resource being protected by the check.target_resource_type
- (Required) The type of resource being protected by the check. Valid values: endpoint
, environment
, queue
, repository
, securefile
, variablegroup
.display_name
- (Required) The name of the business hours check displayed in the web UI.start_time
- (Required) The beginning of the time period that this check will be allowed to pass, specified as 24-hour time with leading zeros.end_time
- (Required) The end of the time period that this check will be allowed to pass, specified as 24-hour time with leading zeros.time_zone
- (Required) The time zone this check will be evaluated in. See below for supported values.monday
- (Optional) This check will pass on Mondays. Defaults to false
.tuesday
- (Optional) This check will pass on Tuesday. Defaults to false
.wednesday
- (Optional) This check will pass on Wednesdays. Defaults to false
.thursday
- (Optional) This check will pass on Thursdays. Defaults to false
.friday
- (Optional) This check will pass on Fridays. Defaults to false
.saturday
- (Optional) This check will pass on Saturdays. Defaults to false
.sunday
- (Optional) This check will pass on Sundays. Defaults to false
.timeout
- (Optional) The timeout in minutes for the business hours check. Defaults to 1440
.In addition to all arguments above, the following attributes are exported:
id
- The ID of the check.version
- The version of the check.Importing this resource is not supported.