Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions modules/hierarchy/system/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ resource "opslevel_system" "this" {
owner = local.owner
}

# TODO: This would be a really clean way to ensure service.parent is set via this module
#resource "opslevel_service_relationship" "this" {
# for_each = { for service in var.services : service => service }
# system = opslevel_system.this.id
# service = each.value
#}
resource "opslevel_service_relationship" "this" {
for_each = { for service in var.services : service => service }

system = opslevel_system.this.id
service = each.value
}
4 changes: 4 additions & 0 deletions modules/service/relationship/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "opslevel_service_relationship" "this" {
service = var.service
system = var.system
}
3 changes: 3 additions & 0 deletions modules/service/relationship/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "this" {
value = opslevel_service_relationship.this
}
9 changes: 9 additions & 0 deletions modules/service/relationship/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
variable "service" {
type = string
description = "The id or alias of the service."
}

variable "system" {
type = string
description = "The id or alias of the system."
}
1 change: 1 addition & 0 deletions modules/service/relationship/versions.tf
Loading