Skip to content

Commit

Permalink
Create OTC module for agencies
Browse files Browse the repository at this point in the history
  • Loading branch information
joecks committed Feb 27, 2024
1 parent 7ac7b1d commit cacc3cd
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
15 changes: 15 additions & 0 deletions otc/agency/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "opentelekomcloud_identity_agency_v3" "agency" {
name = var.name
description = var.description
delegated_domain_name = var.delegated_domain_name

dynamic "project_role" {
for_each = {
for index, p in var.projects : index => p
}
content {
project = project_role.value.project_name
roles = project_role.value.roles
}
}
}
3 changes: 3 additions & 0 deletions otc/agency/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "name" {
value = var.name
}
9 changes: 9 additions & 0 deletions otc/agency/terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = "v1.3.7"
required_providers {
opentelekomcloud = {
source = "opentelekomcloud/opentelekomcloud"
version = ">=1.29.0"
}
}
}
27 changes: 27 additions & 0 deletions otc/agency/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
variable "name" {
type = string
description = "The name agency"
}

variable "description" {
type = string
description = "The description of the agency"
default = "Created by Terraform"
}

variable "delegated_domain_name" {
type = string
description = "The delegation domain (i.e. op_svc_evs, op_svc_cce, ...)"

}

variable "projects" {
type = list(object({
project_name = string
roles = list(string)
}
))
description = "The roles that should be assigned to the projects. "
default = []
}

0 comments on commit cacc3cd

Please sign in to comment.