Skip to content

Commit

Permalink
Merge pull request #58 from schubergphilis/fvb/deprecation
Browse files Browse the repository at this point in the history
enhancement: Refactor away deprecation warning & set minimum tfe version to v0.51.0
  • Loading branch information
fatbasstard authored Dec 19, 2023
2 parents 1152b91 + a188138 commit bb67622
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ The above custom role is similar to the "write" pre-existing role, but blocks ac
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.0.0 |
| <a name="requirement_tfe"></a> [tfe](#requirement\_tfe) | >= 0.37.0 |
| <a name="requirement_tfe"></a> [tfe](#requirement\_tfe) | >= 0.51.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.0.0 |
| <a name="provider_tfe"></a> [tfe](#provider\_tfe) | >= 0.37.0 |
| <a name="provider_tfe"></a> [tfe](#provider\_tfe) | >= 0.51.0 |

## Modules

Expand Down Expand Up @@ -86,6 +86,7 @@ The above custom role is similar to the "write" pre-existing role, but blocks ac
| [tfe_variable.tfc_aws_run_role_arn](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/variable) | resource |
| [tfe_variable.tfc_aws_workload_identity_audience](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/variable) | resource |
| [tfe_workspace.default](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/workspace) | resource |
| [tfe_workspace_settings.default](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/workspace_settings) | resource |
| [tfe_team.default](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/team) | data source |

## Inputs
Expand Down
8 changes: 6 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ locals {

resource "tfe_workspace" "default" {
name = var.name
agent_pool_id = var.agent_pool_id
auto_apply = var.auto_apply
execution_mode = var.execution_mode
file_triggers_enabled = var.file_triggers_enabled
global_remote_state = var.global_remote_state
organization = var.terraform_organization
Expand All @@ -36,6 +34,12 @@ resource "tfe_workspace" "default" {
}
}

resource "tfe_workspace_settings" "default" {
agent_pool_id = var.agent_pool_id
execution_mode = var.execution_mode
workspace_id = tfe_workspace.default.id
}

resource "tfe_notification_configuration" "default" {
for_each = length(var.notification_configuration) != 0 ? { for v in var.notification_configuration : v.url => v } : {}

Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ variable "execution_mode" {
type = string
default = "remote"
description = "Which execution mode to use"

validation {
condition = var.execution_mode == "agent" || var.execution_mode == "local" || var.execution_mode == "remote"
error_message = "The execution_mode value must be either \"agent\", \"local\", or \"remote\"."
}
}

variable "file_triggers_enabled" {
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
tfe = {
source = "hashicorp/tfe"
version = ">= 0.37.0"
version = ">= 0.51.0"
}
}
}

0 comments on commit bb67622

Please sign in to comment.