Skip to content

Commit

Permalink
Merge pull request #17 from Originate/ck/add-disable-default-workspace
Browse files Browse the repository at this point in the history
feat: Add disable_default_workspace module
  • Loading branch information
chrizkim authored Feb 13, 2023
2 parents 032a5f2 + 74aa3a1 commit efaf12b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions terraform/disable_default_workspace/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "null_resource" "check" {
lifecycle {
precondition {
condition = terraform.workspace != "default"
error_message = "Use of the \"default\" workspace is not allowed"
}
}
}
9 changes: 9 additions & 0 deletions terraform/disable_default_workspace/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.0"

required_providers {
null = {
source = "hashicorp/null"
}
}
}

0 comments on commit efaf12b

Please sign in to comment.