Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy-up-agent-pools #149

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.96.3 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases
hooks:
- id: terraform_fmt
- id: terraform_tflint
- id: terraform_trivy
- id: terraform_validate
- id: tfupdate
23 changes: 0 additions & 23 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

96 changes: 48 additions & 48 deletions flexible-workspaces.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# this file contains workspaces that were imported before this tfc-config-as-code repo has been created.
resource "tfe_workspace" "aws-lambda-example" {
description = "Demo workspace for deploying lambda functions."
allow_destroy_plan = true
auto_apply = true
description = "Demo workspace for deploying lambda functions."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
# global_remote_state = false
Expand Down Expand Up @@ -33,11 +33,11 @@ resource "tfe_variable" "aws-lambda-example-aws_region" {
}

resource "tfe_workspace" "multi-env-provisioning-example-0-test" {
description = "A demo showing how to manage multiple enviroments using one set of terraform code."
allow_destroy_plan = true
auto_apply = true
description = "A demo showing how to manage multiple enviroments using one set of terraform code."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
file_triggers_enabled = false
# global_remote_state = false
name = "multi-env-provisioning-example-0-test"
organization = var.organization
Expand Down Expand Up @@ -65,9 +65,9 @@ resource "tfe_variable" "multi-env-provisioning-example-0-test-aws_region" {
}

resource "tfe_workspace" "multi-env-provisioning-example-1-staging" {
description = "A demo showing how to manage multiple enviroments using one set of terraform code."
allow_destroy_plan = true
auto_apply = true
description = "A demo showing how to manage multiple enviroments using one set of terraform code."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
# global_remote_state = false
Expand Down Expand Up @@ -99,9 +99,9 @@ resource "tfe_variable" "multi-env-provisioning-example-1-staging-aws_region" {
}

resource "tfe_workspace" "multi-env-provisioning-example-2-prod" {
description = "A demo showing how to manage multiple enviroments using one set of terraform code."
allow_destroy_plan = true
auto_apply = true
description = "A demo showing how to manage multiple enviroments using one set of terraform code."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
# global_remote_state = false
Expand Down Expand Up @@ -132,11 +132,11 @@ resource "tfe_variable" "multi-env-provisioning-example-2-prod-aws_region" {
}

resource "tfe_workspace" "terraform-aws-vault-demo" {
description = "A workspace that standup a demo vault instance."
allow_destroy_plan = true
auto_apply = true
description = "A workspace that standup a demo vault instance."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
file_triggers_enabled = false
# global_remote_state = false
name = "terraform-aws-vault-demo"
organization = var.organization
Expand Down Expand Up @@ -191,11 +191,11 @@ resource "tfe_variable" "terraform-aws-vault-demo-aws_region" {
# }

resource "tfe_workspace" "aws-s3-demo" {
description = "A simple demo to show how sentinel policy as code engine can make sure s3 are provisioned securely."
allow_destroy_plan = true
auto_apply = true
description = "A simple demo to show how sentinel policy as code engine can make sure s3 are provisioned securely."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
file_triggers_enabled = false
# global_remote_state = false
name = "aws-s3-demo"
tag_names = ["customerfacing", "aws", "autoinject", "awsconsumer"]
Expand All @@ -222,11 +222,11 @@ resource "tfe_variable" "aws-s3-demo-aws_region" {
}

resource "tfe_workspace" "gcp-playground" {
description = "A simple demo of deploying gcp resources."
allow_destroy_plan = true
auto_apply = true
description = "A simple demo of deploying gcp resources."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
file_triggers_enabled = false
# global_remote_state = false
name = "gcp-playground"
organization = var.organization
Expand Down Expand Up @@ -259,13 +259,13 @@ data "tfe_workspace_ids" "azureconsumer-apps" {
resource "tfe_workspace" "aws-shared-infra" {
description = "My core aws infrustructure that are shared by other workspaces."

allow_destroy_plan = true
auto_apply = true
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
file_triggers_enabled = false
# global_remote_state = false
# remote_state_consumer_ids = values(data.tfe_workspace_ids.awsconsumer-apps.ids)
name = "aws-shared-infra"
name = "aws-shared-infra"
organization = var.organization
queue_all_runs = false
speculative_enabled = true
Expand Down Expand Up @@ -296,11 +296,11 @@ resource "tfe_variable" "aws-shared-infra-aws_region" {
}

resource "tfe_workspace" "azure-shared-infra" {
description = "Core azure infra"
allow_destroy_plan = true
auto_apply = true
description = "Core azure infra"
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
file_triggers_enabled = false
# global_remote_state = true
name = "azure-shared-infra"
organization = var.organization
Expand All @@ -325,17 +325,17 @@ resource "tfe_workspace_settings" "azure-shared-infra" {
}

resource "tfe_workspace" "vault-config-as-code-aws" {
description = "A workspace that's used to manage my own Vault's configuration as code."
allow_destroy_plan = true
auto_apply = true
description = "A workspace that's used to manage my own Vault's configuration as code."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
# global_remote_state = false

name = "vault-config-as-code-aws"

organization = var.organization
queue_all_runs = false
organization = var.organization
queue_all_runs = false
# remote_state_consumer_ids = []
speculative_enabled = true
structured_run_output_enabled = true
Expand All @@ -352,18 +352,18 @@ resource "tfe_workspace" "vault-config-as-code-aws" {
}

resource "tfe_workspace" "vault-config-as-code-local" {
description = "A workspace that's used to manage my own Vault's configuration as code."
allow_destroy_plan = true
auto_apply = true
description = "A workspace that's used to manage my own Vault's configuration as code."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "agent"
# agent_pool_id = tfe_agent_pool.local-agent-pool.id
file_triggers_enabled = false
# global_remote_state = false

name = "vault-config-as-code-local"

organization = var.organization
queue_all_runs = false
organization = var.organization
queue_all_runs = false
# remote_state_consumer_ids = []
speculative_enabled = true
structured_run_output_enabled = true
Expand All @@ -380,17 +380,17 @@ resource "tfe_workspace" "vault-config-as-code-local" {
}

resource "tfe_workspace" "vault-config-as-code-hcp" {
description = "A workspace that's used to manage my own Vault's configuration as code."
allow_destroy_plan = true
auto_apply = true
description = "A workspace that's used to manage my own Vault's configuration as code."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = false
# global_remote_state = false

name = "vault-config-as-code-hcp"

organization = var.organization
queue_all_runs = false
organization = var.organization
queue_all_runs = false
# remote_state_consumer_ids = []
speculative_enabled = true
structured_run_output_enabled = true
Expand Down
62 changes: 31 additions & 31 deletions management-settings.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ resource "tfe_agent_token" "agent-tokens" {
}

resource "tfe_workspace" "tfc-config-as-code" {
description = "Workspace for managing my own TFC orgnisation's configuration as code, using terraform."
allow_destroy_plan = true
auto_apply = true
description = "Workspace for managing my own TFC orgnisation's configuration as code, using terraform."
allow_destroy_plan = true
auto_apply = true
# execution_mode = "remote"
file_triggers_enabled = true
# global_remote_state = false
project_id = tfe_project.projects["Management"].id
name = "tfc-config-as-code"
project_id = tfe_project.projects["Management"].id
name = "tfc-config-as-code"

organization = var.organization
queue_all_runs = false
organization = var.organization
queue_all_runs = false
# remote_state_consumer_ids = []
speculative_enabled = true
structured_run_output_enabled = true
Expand Down Expand Up @@ -101,16 +101,16 @@ resource "tfe_oauth_client" "gitlab-b" {
}

resource "tfe_workspace" "tfc-credential-injector" {
allow_destroy_plan = true
auto_apply = true
description = "A workspace that will inject aws and azure credentials to other workspaces automaticly."
allow_destroy_plan = true
auto_apply = true
description = "A workspace that will inject aws and azure credentials to other workspaces automaticly."
# execution_mode = "remote"
file_triggers_enabled = false
file_triggers_enabled = false
# global_remote_state = false
project_id = tfe_project.projects["Management"].id
name = "tfc-credential-injector"
organization = var.organization
queue_all_runs = true
project_id = tfe_project.projects["Management"].id
name = "tfc-credential-injector"
organization = var.organization
queue_all_runs = true
# remote_state_consumer_ids = []
speculative_enabled = true
structured_run_output_enabled = true
Expand All @@ -125,16 +125,16 @@ resource "tfe_workspace" "tfc-credential-injector" {
}

resource "tfe_workspace" "tfc-notification-configurator" {
allow_destroy_plan = true
auto_apply = true
description = "A workspace that will configure TFC/E notifications based on tag automaticly."
allow_destroy_plan = true
auto_apply = true
description = "A workspace that will configure TFC/E notifications based on tag automaticly."
# execution_mode = "remote"
file_triggers_enabled = false
file_triggers_enabled = false
# global_remote_state = false
project_id = tfe_project.projects["Management"].id
name = "tfc-notification-configurator"
organization = var.organization
queue_all_runs = true
project_id = tfe_project.projects["Management"].id
name = "tfc-notification-configurator"
organization = var.organization
queue_all_runs = true
# remote_state_consumer_ids = []
speculative_enabled = true
structured_run_output_enabled = true
Expand All @@ -149,16 +149,16 @@ resource "tfe_workspace" "tfc-notification-configurator" {
}

resource "tfe_workspace" "tfc-policyset-attacher" {
allow_destroy_plan = true
auto_apply = true
description = "A workspace that will configure TFC/E notifications based on tag automaticly."
allow_destroy_plan = true
auto_apply = true
description = "A workspace that will configure TFC/E notifications based on tag automaticly."

file_triggers_enabled = false
file_triggers_enabled = false
# global_remote_state = false
project_id = tfe_project.projects["Management"].id
name = "tfc-policyset-attacher"
organization = var.organization
queue_all_runs = true
project_id = tfe_project.projects["Management"].id
name = "tfc-policyset-attacher"
organization = var.organization
queue_all_runs = true
# remote_state_consumer_ids = []
speculative_enabled = true
structured_run_output_enabled = true
Expand Down
15 changes: 8 additions & 7 deletions stacks.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# terraform stacks is a new feature introduced

resource "tfe_stack" "test-stack" {
name = "my-stack"
description = "A Terraform Stack using two components with two environments"
project_id = tfe_project.projects["Playground"].id
name = "my-stack"
description = "A Terraform Stack using two components with two environments"
project_id = tfe_project.projects["Playground"].id

vcs_repo {
branch = "main"
Expand All @@ -12,11 +12,12 @@ resource "tfe_stack" "test-stack" {
}
}

resource github_repository "stack-repo" {
name = "stack-repo"
description = "A repository for the stack"
resource "github_repository" "stack-repo" {
name = "stack-repo"
description = "A repository for the stack"
vulnerability_alerts = true
template {
owner = "ausmartway"
owner = "ausmartway"
repository = "terraform-template"
}
visibility = "private"
Expand Down
Loading