Skip to content

Commit 56c7962

Browse files
Merge pull request #4 from bethdevopsbunny/environment_var_configurables
Environment var configurables
2 parents 9182939 + 56e810c commit 56c7962

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

load_balancer.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# sets global address name
2-
resource "google_compute_global_address" "default" {
2+
resource "google_compute_global_address" "default" {
33
project = local.deployment_project
44
name = var.application_name
55
}

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ resource "google_cloud_run_service" "default" {
4242
}
4343
env {
4444
name = "ACTIVATION_TIMEOUT"
45-
value = "60"
45+
value = var.maximum_duration
4646
}
4747
env {
4848
name = "JUSTIFICATION_HINT"
49-
value = "Bug or case number"
49+
value = var.justification_hint
5050
}
5151
env {
5252
name = "JUSTIFICATION_PATTERN"
53-
value = ".*"
53+
value = var.justification_pattern
5454
}
5555
env {
5656
name = "IAP_BACKEND_SERVICE_ID"

variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ variable "allow_unauthenticated_invocations" {
5656
default = false
5757
}
5858

59+
variable "maximum_duration" {
60+
type = number
61+
description = "Sets the longest duration that a user can request"
62+
default = 60
63+
}
64+
65+
variable "justification_hint" {
66+
type = string
67+
description = "Hint provided to the user when selecting why they are asking for the role"
68+
default = "Bug or case number"
69+
}
70+
71+
variable "justification_pattern" {
72+
type = string
73+
description = "Regex pattern that justification must match"
74+
default = ".*"
75+
}
76+
5977
## Scope Variables
6078
variable "scope_type" {
6179
type = string

versions.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@ terraform {
1010
source = "hashicorp/google-beta"
1111
version = "~> 4"
1212
}
13+
random = {
14+
source = "hashicorp/random"
15+
version = "~> 3"
16+
}
1317
}
1418
}

0 commit comments

Comments
 (0)