Skip to content

Commit

Permalink
Merge branch 'main' into trunk-io/update-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
gberenice authored Jan 9, 2025
2 parents 2cf0f2b + f84d9ac commit 0f677e7
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tf-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Install Aqua
uses: aquaproj/aqua-installer@f13c5d2f0357708d85477aabe50fd3f725528745 # v3.1.0
with:
aqua_version: v2.40.0
aqua_version: v2.41.0

- name: Aqua Install
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,13 @@ This is to support easy local and outside-spacelift operations. Keeping variable
| <a name="input_enabled_root_modules"></a> [enabled_root_modules](#input_enabled_root_modules) | List of root modules where to look for stack config files.<br/>Ignored when all_root_modules_enabled is true.<br/>Example: ["spacelift-automation", "k8s-cluster"] | `list(string)` | `[]` | no |
| <a name="input_github_action_deploy"></a> [github_action_deploy](#input_github_action_deploy) | Indicates whether GitHub users can deploy from the Checks API. | `bool` | `true` | no |
| <a name="input_github_enterprise"></a> [github_enterprise](#input_github_enterprise) | The GitHub VCS settings | <pre>object({<br/> namespace = string<br/> id = optional(string)<br/> })</pre> | `null` | no |
| <a name="input_labels"></a> [labels](#input_labels) | List of labels to apply to the stacks. | `list(string)` | `[]` | no |
| <a name="input_manage_state"></a> [manage_state](#input_manage_state) | Determines if Spacelift should manage state for this stack. | `bool` | `false` | no |
| <a name="input_protect_from_deletion"></a> [protect_from_deletion](#input_protect_from_deletion) | Protect this stack from accidental deletion. If set, attempts to delete this stack will fail. | `bool` | `false` | no |
| <a name="input_repository"></a> [repository](#input_repository) | The name of your infrastructure repo | `string` | n/a | yes |
| <a name="input_root_module_structure"></a> [root_module_structure](#input_root_module_structure) | The root module structure of the Stacks that you're reading in. See README for full details.<br/><br/>MultiInstance - You're using Workspaces or Dynamic Backend configuration to create multiple instances of the same root module code.<br/>SingleInstance - You're using copies of a root module and your directory structure to create multiple instances of the same Terraform code. | `string` | `"MultiInstance"` | no |
| <a name="input_root_modules_path"></a> [root_modules_path](#input_root_modules_path) | The path, relative to the root of the repository, where the root module can be found. | `string` | `"root-modules"` | no |
| <a name="input_runner_image"></a> [runner_image](#input_runner_image) | URL of the Docker image used to process Runs. Defaults to `null` which is Spacelift's standard (Alpine) runner image. | `string` | `"null"` | no |
| <a name="input_runner_image"></a> [runner_image](#input_runner_image) | URL of the Docker image used to process Runs. Defaults to `null` which is Spacelift's standard (Alpine) runner image. | `string` | `null` | no |
| <a name="input_space_id"></a> [space_id](#input_space_id) | Place the created stacks in the specified space_id. | `string` | `"root"` | no |
| <a name="input_terraform_smart_sanitization"></a> [terraform_smart_sanitization](#input_terraform_smart_sanitization) | Indicates whether runs on this will use terraform's sensitive value system to sanitize<br/>the outputs of Terraform state and plans in spacelift instead of sanitizing all fields. | `bool` | `false` | no |
| <a name="input_terraform_version"></a> [terraform_version](#input_terraform_version) | Terraform version to use. | `string` | `"1.7.2"` | no |
Expand Down
2 changes: 2 additions & 0 deletions examples/complete/components/spacelift-automation/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ module "automation" {

aws_integration_id = var.aws_integration_id
aws_integration_enabled = true

labels = var.labels
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ repository = "terraform-spacelift-automation"
root_modules_path = "../../../../examples/complete/components"
all_root_modules_enabled = true
aws_integration_id = "01JEC7ZACVKHTSVY4NF8QNZVVB"
labels = ["nobackend"]
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ variable "github_enterprise" {
description = "The GitHub VCS settings"
}

variable "labels" {
type = list(string)
description = "List of labels to apply to the stacks."
default = []
}

variable "repository" {
type = string
description = "The name of your infrastructure repo"
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ locals {
lookup(local._folder_labels, stack, []),
lookup(local._dependency_labels, stack, []),
try(local.stack_configs[stack].labels, []),
var.labels,
]))
}

Expand Down
13 changes: 13 additions & 0 deletions tests/main.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ variables {
before_init = [
"echo 'Hello'"
]
labels = [
"nobackend"
]
}

#Test that the global labels are created correctly
run "test_labels_are_created_correctly" {
command = plan

assert {
condition = contains(local.labels["root-module-a-test"], "nobackend")
error_message = "Global labels were not created correctly: ${jsonencode(local.labels)}"
}
}

# Test that the root module fileset is created correctly
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ variable "github_action_deploy" {
default = true
}

variable "labels" {
type = list(string)
description = "List of labels to apply to the stacks."
default = []
}

variable "manage_state" {
type = bool
description = "Determines if Spacelift should manage state for this stack."
Expand Down

0 comments on commit 0f677e7

Please sign in to comment.