diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2c31daa..9d5833c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: check-symlinks - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.96.1 + rev: v1.96.2 hooks: - id: terraform_fmt @@ -29,7 +29,7 @@ repos: - id: terraform_docs - repo: https://github.com/bridgecrewio/checkov.git - rev: 3.2.269 + rev: 3.2.276 hooks: - id: checkov verbose: true diff --git a/README.md b/README.md index 632949c..5d0d00f 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,7 @@ No resources. |------|-------------|------|---------|:--------:| | [cost\_center](#input\_cost\_center) | The cost center the resources will be billed to, must start with 'x' followed by three or four digits | `string` | n/a | yes | | [data\_classification](#input\_data\_classification) | The data classification of the resources can be public, internal, or confidential | `string` | n/a | yes | -| [email](#input\_email) | The email address of the team responsible for the resources | `string` | n/a | yes | -| [repository](#input\_repository) | The repository name (should be in the format 'owner/repo') containing only lowercase alphanumeric characters or hyphens | `string` | n/a | yes | +| [repository](#input\_repository) | The repository name containing only lowercase alphanumeric characters or hyphens | `string` | n/a | yes | | [team](#input\_team) | The team name (should contain only lowercase alphanumeric characters and hyphens) | `string` | n/a | yes | | [workspace](#input\_workspace) | This is used for tests to set the workspace name. Do not set this variable in any other context | `string` | `null` | no | @@ -86,9 +85,13 @@ No resources. | Name | Description | |------|-------------| +| [cost\_center](#output\_cost\_center) | The cost center the resources will be billed to | +| [data\_classification](#output\_data\_classification) | The data classification of the resources | | [env](#output\_env) | The short name for the environment for example prod, nonprod, sb | | [environment](#output\_environment) | The environment name for example production, non-production, sandbox | | [labels](#output\_labels) | A map of labels to apply to resources | | [region](#output\_region) | The region where resources will be deployed | +| [repository](#output\_repository) | The repository name | +| [team](#output\_team) | The team name | | [zone](#output\_zone) | The zone where resources will be deployed | diff --git a/locals.tf b/locals.tf index 37916c1..7075a88 100644 --- a/locals.tf +++ b/locals.tf @@ -33,7 +33,6 @@ locals { env = local.environment cost-center = var.cost_center data-classification = var.data_classification - email = var.email region = local.region repository = var.repository team = var.team diff --git a/outputs.tf b/outputs.tf index 7f218e6..e4b9f2e 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,6 +1,16 @@ # Terraform Output Values # https://www.terraform.io/language/values/outputs +output "cost_center" { + description = "The cost center the resources will be billed to" + value = var.cost_center +} + +output "data_classification" { + description = "The data classification of the resources" + value = var.data_classification +} + output "env" { description = "The short name for the environment for example prod, nonprod, sb" value = local.env @@ -21,6 +31,16 @@ output "region" { value = local.region } +output "repository" { + description = "The repository name" + value = var.repository +} + +output "team" { + description = "The team name" + value = var.team +} + output "zone" { description = "The zone where resources will be deployed" value = local.zone diff --git a/tests/default.tftest.hcl b/tests/default.tftest.hcl index 7053546..801c995 100644 --- a/tests/default.tftest.hcl +++ b/tests/default.tftest.hcl @@ -384,6 +384,6 @@ variables { cost_center = "mock-cost-center" data_classification = "mock-data-classification" email = "mock-team@osinfra.io" - repository = "mock-owner/mock-repository" + repository = "mock-repository" team = "mock-team" } diff --git a/tests/fixtures/default/main.tf b/tests/fixtures/default/main.tf index cfdd926..3ec7beb 100644 --- a/tests/fixtures/default/main.tf +++ b/tests/fixtures/default/main.tf @@ -3,7 +3,6 @@ module "core_workspace" { cost_center = var.cost_center data_classification = var.data_classification - email = var.email repository = var.repository team = var.team workspace = var.workspace diff --git a/variables.tf b/variables.tf index a29f575..c16e79b 100644 --- a/variables.tf +++ b/variables.tf @@ -21,23 +21,13 @@ variable "data_classification" { } } -variable "email" { - description = "The email address of the team responsible for the resources" - type = string - - validation { - condition = can(regex("^[a-zA-Z0-9._%+-]+@osinfra\\.io$", var.email)) - error_message = "The email address must be a valid osinfra.io email address" - } -} - variable "repository" { - description = "The repository name (should be in the format 'owner/repo') containing only lowercase alphanumeric characters or hyphens" + description = "The repository name containing only lowercase alphanumeric characters or hyphens" type = string validation { - condition = can(regex("^[a-z0-9-]+/[a-z0-9-]+$", var.repository)) - error_message = "The repository name should be in the format 'owner/repo' and contain only lowercase alphanumeric characters or hyphens" + condition = can(regex("^[a-z0-9-]+$", var.repository)) + error_message = "The repository name must consist entirely of lowercase alphanumeric characters or hyphens" } }