From 52a7080c163b6c0af5e38b6f5bed74ac3627f87a Mon Sep 17 00:00:00 2001 From: David Bloss Date: Mon, 30 Oct 2023 15:56:52 -0500 Subject: [PATCH 1/2] add parent field to exported opslevel_team terraform resource --- src/cmd/terraform.go | 11 ++++++++++- src/submodules/opslevel-go | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/cmd/terraform.go b/src/cmd/terraform.go index d8b77cb8..422f8b90 100644 --- a/src/cmd/terraform.go +++ b/src/cmd/terraform.go @@ -313,6 +313,7 @@ func exportTeams(c *opslevel.Client, config *os.File, shell *os.File) { teamConfig := `resource "opslevel_team" "%s" { name = "%s" manager_email = "%s" + parent = "%s" %s %s } @@ -325,7 +326,15 @@ func exportTeams(c *opslevel.Client, config *os.File, shell *os.File) { if len(aliases) > 0 { aliases = fmt.Sprintf("aliases = [\"%s\"]", aliases) } - config.WriteString(templateConfig(teamConfig, team.Alias, team.Name, team.Manager.Email, aliases, buildMultilineStringArg("responsibilities", team.Responsibilities))) + config.WriteString(templateConfig( + teamConfig, + team.Alias, + team.Name, + team.Manager.Email, + team.ParentTeam.Alias, + aliases, + buildMultilineStringArg("responsibilities", team.Responsibilities), + )) shell.WriteString(fmt.Sprintf("terraform import opslevel_team.%s %s\n", team.Alias, team.Id)) } shell.WriteString("##########\n\n") diff --git a/src/submodules/opslevel-go b/src/submodules/opslevel-go index 8ec23efb..bcceb313 160000 --- a/src/submodules/opslevel-go +++ b/src/submodules/opslevel-go @@ -1 +1 @@ -Subproject commit 8ec23efbea530ebf57b5eba4886162f252328f17 +Subproject commit bcceb313d71041fe7b0ce61d769801b7184a55cb From aa845eea1e1a6bddaa63f47181a4a8b669b537d0 Mon Sep 17 00:00:00 2001 From: David Bloss Date: Mon, 30 Oct 2023 15:57:23 -0500 Subject: [PATCH 2/2] add changie log --- .changes/unreleased/Feature-20231030-155711.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changes/unreleased/Feature-20231030-155711.yaml diff --git a/.changes/unreleased/Feature-20231030-155711.yaml b/.changes/unreleased/Feature-20231030-155711.yaml new file mode 100644 index 00000000..a10dddf5 --- /dev/null +++ b/.changes/unreleased/Feature-20231030-155711.yaml @@ -0,0 +1,3 @@ +kind: Feature +body: add parent field to exported opslevel_team terraform resource +time: 2023-10-30T15:57:11.071803-05:00