From 53aaff1f2177cc6c47ee4873433644c6fe1dccf9 Mon Sep 17 00:00:00 2001 From: "Jorge E. Gamboa G." Date: Wed, 10 Apr 2024 12:08:07 +0200 Subject: [PATCH] Creating module for the swr --- otc/swr/main.tf | 12 ++++++++++++ otc/swr/terraform.tf | 9 +++++++++ otc/swr/variables.tf | 14 ++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 otc/swr/main.tf create mode 100644 otc/swr/terraform.tf create mode 100644 otc/swr/variables.tf diff --git a/otc/swr/main.tf b/otc/swr/main.tf new file mode 100644 index 00000000..6b44f0d0 --- /dev/null +++ b/otc/swr/main.tf @@ -0,0 +1,12 @@ +resource "opentelekomcloud_swr_organization_v2" "org" { + name = var.name +} + +resource "opentelekomcloud_swr_repository_v2" "repo_1" { + count = length(var.repository) + organization = opentelekomcloud_swr_organization_v2.org.name + name = var.repository[count.index].repository_name + description = var.repository[count.index].repository_description + category = var.repository[count.index].repository_category + is_public = var.repository[count.index].repository_public +} diff --git a/otc/swr/terraform.tf b/otc/swr/terraform.tf new file mode 100644 index 00000000..2e41e43f --- /dev/null +++ b/otc/swr/terraform.tf @@ -0,0 +1,9 @@ +terraform { + required_version = "v1.3.7" + required_providers { + opentelekomcloud = { + source = "opentelekomcloud/opentelekomcloud" + version = "1.36.1" + } + } +} diff --git a/otc/swr/variables.tf b/otc/swr/variables.tf new file mode 100644 index 00000000..28bdde7a --- /dev/null +++ b/otc/swr/variables.tf @@ -0,0 +1,14 @@ +variable "name" { + type = string + description = "Project name." +} + +variable "repository" { + description = "Configuration of the repository settings" + type = list(object({ + repository_name = string + repository_category = string + repository_description = string + repository_public = bool + })) +}