From 2068baa611657ec28db621bf53c2da49558e12de Mon Sep 17 00:00:00 2001 From: Sjoerd Tromp Date: Thu, 23 Jan 2025 14:37:42 +0100 Subject: [PATCH 1/5] Add speculative_enabled option --- main.tf | 1 + variables.tf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/main.tf b/main.tf index df48575..9854856 100644 --- a/main.tf +++ b/main.tf @@ -17,6 +17,7 @@ resource "tfe_workspace" "default" { organization = var.terraform_organization project_id = var.project_id queue_all_runs = var.queue_all_runs + speculative_enabled = var.speculative_enabled ssh_key_id = var.ssh_key_id tag_names = var.workspace_tags terraform_version = var.terraform_version diff --git a/variables.tf b/variables.tf index 1d78be1..4aac990 100644 --- a/variables.tf +++ b/variables.tf @@ -167,6 +167,12 @@ variable "sensitive_terraform_variables" { description = "An optional map with sensitive Terraform variables" } +variable "speculative_enabled" { + type = bool + default = true + description = "Enables or disables speculative plans on PR/MR, enabled by default" +} + variable "ssh_key_id" { type = string default = null From 76a79893107eddbbff7ef798acab3b8275159ec9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 Jan 2025 13:38:41 +0000 Subject: [PATCH 2/5] docs(readme): update module usage --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a009738..88c3848 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ No modules. | [sensitive\_env\_variables](#input\_sensitive\_env\_variables) | An optional map with sensitive environment variables | `map(string)` | `{}` | no | | [sensitive\_hcl\_variables](#input\_sensitive\_hcl\_variables) | An optional map with sensitive HCL Terraform variables |
map(object({
sensitive = string
}))
| `{}` | no | | [sensitive\_terraform\_variables](#input\_sensitive\_terraform\_variables) | An optional map with sensitive Terraform variables | `map(string)` | `{}` | no | +| [speculative\_enabled](#input\_speculative\_enabled) | Enables or disables speculative plans on PR/MR, enabled by default | `bool` | `true` | no | | [ssh\_key\_id](#input\_ssh\_key\_id) | The SSH key ID to assign to the workspace | `string` | `null` | no | | [team\_access](#input\_team\_access) | Map of team names and either type of fixed access or custom permissions to assign |
map(object({
access = optional(string, null),
permissions = optional(object({
run_tasks = bool
runs = string
sentinel_mocks = string
state_versions = string
variables = string
workspace_locking = bool
}), null)
}))
| `{}` | no | | [terraform\_version](#input\_terraform\_version) | The version of Terraform to use for this workspace | `string` | `"latest"` | no | From c50518acfaa26c644a474bc138fa0ce1fb0984ca Mon Sep 17 00:00:00 2001 From: Sjoerd Tromp Date: Mon, 27 Jan 2025 15:52:16 +0100 Subject: [PATCH 3/5] Trigger Build From 9e1013dc3476e31c29b837daf63276034f0d0688 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 27 Jan 2025 14:53:07 +0000 Subject: [PATCH 4/5] docs(readme): update module usage --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 88c3848..c01f107 100644 --- a/README.md +++ b/README.md @@ -61,21 +61,21 @@ No modules. | [file\_triggers\_enabled](#input\_file\_triggers\_enabled) | Whether to filter runs based on the changed files in a VCS push | `bool` | `true` | no | | [github\_app\_installation\_id](#input\_github\_app\_installation\_id) | The GitHub App installation ID to use | `string` | `null` | no | | [global\_remote\_state](#input\_global\_remote\_state) | Allow all workspaces in the organization to read the state of this workspace | `bool` | `null` | no | -| [notification\_configuration](#input\_notification\_configuration) | Notification configuration, using name as key and config as value |
map(object({
destination_type = string
enabled = optional(bool, true)
url = string
triggers = optional(list(string), [
"run:created",
"run:planning",
"run:needs_attention",
"run:applying",
"run:completed",
"run:errored",
])
}))
| `{}` | no | +| [notification\_configuration](#input\_notification\_configuration) | Notification configuration, using name as key and config as value |
map(object({
destination_type = string
enabled = optional(bool, true)
url = string
triggers = optional(list(string), [
"run:created",
"run:planning",
"run:needs_attention",
"run:applying",
"run:completed",
"run:errored",
])
}))
| `{}` | no | | [oauth\_token\_id](#input\_oauth\_token\_id) | The OAuth token ID of the VCS provider | `string` | `null` | no | | [project\_id](#input\_project\_id) | ID of the project where the workspace should be created | `string` | `null` | no | | [queue\_all\_runs](#input\_queue\_all\_runs) | When set to false no initial run is queued and all runs triggered by a webhook will not be queued, necessary if you need to set variable sets after creation. | `bool` | `true` | no | | [remote\_state\_consumer\_ids](#input\_remote\_state\_consumer\_ids) | A set of workspace IDs set as explicit remote state consumers for this workspace | `set(string)` | `null` | no | | [repository\_identifier](#input\_repository\_identifier) | The repository identifier to connect the workspace to | `string` | `null` | no | | [sensitive\_env\_variables](#input\_sensitive\_env\_variables) | An optional map with sensitive environment variables | `map(string)` | `{}` | no | -| [sensitive\_hcl\_variables](#input\_sensitive\_hcl\_variables) | An optional map with sensitive HCL Terraform variables |
map(object({
sensitive = string
}))
| `{}` | no | +| [sensitive\_hcl\_variables](#input\_sensitive\_hcl\_variables) | An optional map with sensitive HCL Terraform variables |
map(object({
sensitive = string
}))
| `{}` | no | | [sensitive\_terraform\_variables](#input\_sensitive\_terraform\_variables) | An optional map with sensitive Terraform variables | `map(string)` | `{}` | no | | [speculative\_enabled](#input\_speculative\_enabled) | Enables or disables speculative plans on PR/MR, enabled by default | `bool` | `true` | no | | [ssh\_key\_id](#input\_ssh\_key\_id) | The SSH key ID to assign to the workspace | `string` | `null` | no | -| [team\_access](#input\_team\_access) | Map of team names and either type of fixed access or custom permissions to assign |
map(object({
access = optional(string, null),
permissions = optional(object({
run_tasks = bool
runs = string
sentinel_mocks = string
state_versions = string
variables = string
workspace_locking = bool
}), null)
}))
| `{}` | no | +| [team\_access](#input\_team\_access) | Map of team names and either type of fixed access or custom permissions to assign |
map(object({
access = optional(string, null),
permissions = optional(object({
run_tasks = bool
runs = string
sentinel_mocks = string
state_versions = string
variables = string
workspace_locking = bool
}), null)
}))
| `{}` | no | | [terraform\_version](#input\_terraform\_version) | The version of Terraform to use for this workspace | `string` | `"latest"` | no | | [trigger\_patterns](#input\_trigger\_patterns) | List of glob patterns that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with trigger-prefixes | `list(string)` | `null` | no | -| [trigger\_prefixes](#input\_trigger\_prefixes) | List of repository-root-relative paths which should be tracked for changes | `list(string)` |
[
"modules"
]
| no | +| [trigger\_prefixes](#input\_trigger\_prefixes) | List of repository-root-relative paths which should be tracked for changes | `list(string)` |
[
"modules"
]
| no | | [variable\_set\_ids](#input\_variable\_set\_ids) | Map of variable set ids to attach to the workspace | `map(string)` | `{}` | no | | [working\_directory](#input\_working\_directory) | A relative path that Terraform will execute within | `string` | `"terraform"` | no | | [workspace\_tags](#input\_workspace\_tags) | A list of tag names for this workspace. Note that tags must only contain lowercase letters, numbers, colons, or hyphens | `list(string)` | `null` | no | From cc23e6d14cdf106f4fd99aceb42ad018dd631784 Mon Sep 17 00:00:00 2001 From: Sjoerd Tromp Date: Mon, 27 Jan 2025 15:55:42 +0100 Subject: [PATCH 5/5] Trigger Build