From 497bd83e1eb3d9da49e1b4df1e22a8cfb980380e Mon Sep 17 00:00:00 2001 From: oycyc Date: Thu, 18 Sep 2025 09:39:22 -0400 Subject: [PATCH] feat: allow BitBucket Cloud integration as VCS --- README.md | 1 + main.tf | 8 ++++++++ variables.tf | 10 +++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8b78b7..6351bd5 100644 --- a/README.md +++ b/README.md @@ -360,6 +360,7 @@ If you have many remote repositories that you need to manage via this pattern, y | [before\_init](#input\_before\_init) | List of before-init scripts | `list(string)` | `[]` | no | | [before\_perform](#input\_before\_perform) | List of before-perform scripts | `list(string)` | `[]` | no | | [before\_plan](#input\_before\_plan) | List of before-plan scripts | `list(string)` | `[]` | no | +| [bitbucket\_cloud](#input\_bitbucket\_cloud) | The Bitbucket Cloud integration settings |
object({
namespace = string
id = optional(string)
})
| `null` | no | | [branch](#input\_branch) | Specify which branch to use within the infrastructure repository. | `string` | `"main"` | no | | [common\_config\_file](#input\_common\_config\_file) | Name of the common configuration file for the stack across a root module. | `string` | `"common.yaml"` | no | | [default\_tf\_workspace\_enabled](#input\_default\_tf\_workspace\_enabled) | Enables the use of `default` Terraform workspace instead of managing multiple workspaces within a root module.

NOTE: We encourage the use of Terraform workspaces to manage multiple environments.
However, you will want to disable this behavior if you're utilizing different backends for each instance
of your root modules (we call this "Dynamic Backends"). | `bool` | `false` | no | diff --git a/main.tf b/main.tf index c6c9573..642fb1a 100644 --- a/main.tf +++ b/main.tf @@ -493,6 +493,14 @@ resource "spacelift_stack" "default" { } } + dynamic "bitbucket_cloud" { + for_each = var.bitbucket_cloud != null ? [var.bitbucket_cloud] : [] + content { + namespace = bitbucket_cloud.value["namespace"] + id = try(bitbucket_cloud.value["id"], null) + } + } + dynamic "azure_devops" { for_each = var.azure_devops != null ? [var.azure_devops] : [] content { diff --git a/variables.tf b/variables.tf index 2fbd434..c73887f 100644 --- a/variables.tf +++ b/variables.tf @@ -36,6 +36,15 @@ variable "github_enterprise" { default = null } +variable "bitbucket_cloud" { + type = object({ + namespace = string + id = optional(string) + }) + description = "The Bitbucket Cloud integration settings" + default = null +} + variable "azure_devops" { type = object({ project = string @@ -54,7 +63,6 @@ variable "raw_git" { default = null } - variable "repository" { type = string description = "The name of your infrastructure repo"