Skip to content

Commit 79d0102

Browse files
fix: lock environment type/id (#28)
1 parent 5c0b8fd commit 79d0102

File tree

12 files changed

+17
-48
lines changed

12 files changed

+17
-48
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,6 @@ Once you are finished with the reference architecture, you can remove all provis
260260
| gar\_repository\_location | Location of the Google Artifact Registry repository, | `string` | n/a | yes |
261261
| project\_id | GCP Project ID to provision resources in. | `string` | n/a | yes |
262262
| region | GCP Region to provision resources in. | `string` | n/a | yes |
263-
| environment | The environment to associate the reference architecture with. | `string` | `null` | no |
264-
| environment\_type | The environment type to associate the reference architecture with. | `string` | `"development"` | no |
265263
| gar\_repository\_id | Google Artifact Registry repository ID. | `string` | `"htc-ref-arch"` | no |
266264
| github\_org\_id | GitHub org id (required for Backstage) | `string` | `null` | no |
267265
| humanitec\_org\_id | Humanitec Organization ID. | `string` | `null` | no |

main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ module "base" {
66
region = var.region
77
humanitec_prefix = var.humanitec_prefix
88
humanitec_org_id = var.humanitec_org_id
9-
environment = var.environment
10-
environment_type = var.environment_type
119

1210
gar_repository_id = var.gar_repository_id
1311
gar_repository_location = var.gar_repository_location

modules/base/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232

3333
| Name | Description | Type | Default | Required |
3434
|------|-------------|------|---------|:--------:|
35-
| environment | The environment to associate the reference architecture with. | `string` | n/a | yes |
36-
| environment\_type | The environment type to associate the reference architecture with. | `string` | n/a | yes |
3735
| project\_id | GCP Project ID to provision resources in. | `string` | n/a | yes |
3836
| region | GCP Region to provision resources in. | `string` | n/a | yes |
3937
| gar\_repository\_id | ID of the Google Artifact Registry repository (not created if empty). | `string` | `null` | no |

modules/base/main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ module "res_defs" {
6464
k8s_loadbalancer = module.k8s.loadbalancer
6565
k8s_region = var.region
6666
k8s_project_id = var.project_id
67-
environment = var.environment
68-
environment_type = var.environment_type
6967
prefix = var.humanitec_prefix
7068
humanitec_cloud_account = module.credentials.humanitec_cloud_account
7169
}

modules/base/terraform.tfvars.example

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11

2-
# The environment to associate the reference architecture with.
3-
environment = ""
4-
5-
# The environment type to associate the reference architecture with.
6-
environment_type = ""
7-
82
# ID of the Google Artifact Registry repository (not created if empty).
93
gar_repository_id = ""
104

modules/base/variables.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ variable "humanitec_org_id" {
2222
# OPTIONAL INPUTS
2323
##########################################
2424

25-
variable "environment" {
26-
type = string
27-
description = "The environment to associate the reference architecture with."
28-
}
29-
30-
variable "environment_type" {
31-
type = string
32-
description = "The environment type to associate the reference architecture with."
33-
}
34-
3525
variable "humanitec_prefix" {
3626
type = string
3727
description = "A prefix that will be attached to all IDs created in Humanitec."

modules/htc_res_defs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434

3535
| Name | Description | Type | Default | Required |
3636
|------|-------------|------|---------|:--------:|
37-
| environment | The environment to use for matching criteria. | `string` | n/a | yes |
38-
| environment\_type | The environment type to use for matching criteria. | `string` | n/a | yes |
3937
| humanitec\_cloud\_account | The ID of the Humanitec Cloud Account. | `string` | n/a | yes |
4038
| k8s\_cluster\_name | The name of the cluster. | `string` | n/a | yes |
4139
| k8s\_loadbalancer | IP address or Host of the load balancer used by the ingress controller. | `string` | n/a | yes |
4240
| k8s\_project\_id | The GCP Project the cluster is in. | `string` | n/a | yes |
4341
| k8s\_region | The region the cluster is in. | `string` | n/a | yes |
42+
| environment | The environment to use for matching criteria. | `string` | `"development"` | no |
43+
| environment\_type | The environment type to use for matching criteria. | `string` | `"development"` | no |
4444
| prefix | A prefix that will be attached to all IDs created in Humanitec. | `string` | `""` | no |
4545
<!-- END_TF_DOCS -->

modules/htc_res_defs/main.tf

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ resource "humanitec_resource_definition_criteria" "k8s_cluster" {
2020
env_id = var.environment
2121
env_type = var.environment_type
2222

23+
force_delete = true
2324
}
2425

2526

@@ -40,6 +41,8 @@ resource "humanitec_resource_definition_criteria" "k8s_namespace" {
4041
resource_definition_id = humanitec_resource_definition.k8s_namespace.id
4142
env_id = var.environment
4243
env_type = var.environment_type
44+
45+
force_delete = true
4346
}
4447

4548

@@ -53,7 +56,10 @@ module "default_postgres" {
5356

5457
resource "humanitec_resource_definition_criteria" "default_postgres" {
5558
resource_definition_id = module.default_postgres.id
56-
env_type = var.environment
59+
env_id = var.environment
60+
env_type = var.environment_type
61+
62+
force_delete = true
5763
}
5864

5965
module "default_mysql" {
@@ -64,5 +70,8 @@ module "default_mysql" {
6470

6571
resource "humanitec_resource_definition_criteria" "default_mysql" {
6672
resource_definition_id = module.default_mysql.id
67-
env_type = var.environment
73+
env_id = var.environment
74+
env_type = var.environment_type
75+
76+
force_delete = true
6877
}

modules/htc_res_defs/terraform.tfvars.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
# The environment to use for matching criteria.
3-
environment = ""
3+
environment = "development"
44

55
# The environment type to use for matching criteria.
6-
environment_type = ""
6+
environment_type = "development"
77

88
# The ID of the Humanitec Cloud Account.
99
humanitec_cloud_account = ""

modules/htc_res_defs/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ variable "k8s_region" {
1818
variable "environment" {
1919
type = string
2020
description = "The environment to use for matching criteria."
21+
default = "development"
2122
}
2223
variable "environment_type" {
2324
type = string
2425
description = "The environment type to use for matching criteria."
26+
default = "development"
2527
}
2628
variable "prefix" {
2729
type = string

0 commit comments

Comments
 (0)