Skip to content
This repository was archived by the owner on Dec 16, 2020. It is now read-only.

Commit 8529255

Browse files
committed
Set concrete types
1 parent d509b79 commit 8529255

File tree

9 files changed

+89
-6
lines changed

9 files changed

+89
-6
lines changed

examples/k8s-namespace-with-service-account/variables.tf

+3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55

66
variable "name" {
77
description = "Name of the namespace to be created"
8+
type = string
89
}
910

1011
variable "kubectl_config_context_name" {
1112
description = "The config context to use when authenticating to the Kubernetes cluster. If empty, defaults to the current context specified in the kubeconfig file."
13+
type = string
1214
default = ""
1315
}
1416

1517
variable "kubectl_config_path" {
1618
description = "The path to the config file to use for kubectl. If empty, defaults to $HOME/.kube/config"
19+
type = string
1720
default = "~/.kube/config"
1821
}

examples/k8s-tiller-kubergrunt-minikube/variables.tf

+15-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55

66
variable "tiller_namespace" {
77
description = "The namespace to deploy Tiller into."
8+
type = string
89
}
910

1011
variable "resource_namespace" {
1112
description = "The namespace where the Helm chart resources will be deployed into by Tiller."
13+
type = string
1214
}
1315

1416
variable "service_account_name" {
1517
description = "The name of the service account to use for Tiller."
18+
type = string
1619
}
1720

1821
variable "tls_subject" {
@@ -58,61 +61,72 @@ variable "client_tls_subject" {
5861

5962
variable "tiller_version" {
6063
description = "The version of Tiller to deploy."
64+
type = string
6165
default = "v2.11.0"
6266
}
6367

6468
# TLS algorithm configuration
6569

6670
variable "private_key_algorithm" {
6771
description = "The name of the algorithm to use for private keys. Must be one of: RSA or ECDSA."
72+
type = string
6873
default = "ECDSA"
6974
}
7075

7176
variable "private_key_ecdsa_curve" {
7277
description = "The name of the elliptic curve to use. Should only be used if var.private_key_algorithm is ECDSA. Must be one of P224, P256, P384 or P521."
78+
type = string
7379
default = "P256"
7480
}
7581

7682
variable "private_key_rsa_bits" {
7783
description = "The size of the generated RSA key in bits. Should only be used if var.private_key_algorithm is RSA."
78-
default = "2048"
84+
type = number
85+
default = 2048
7986
}
8087

8188
# Kubectl options
8289

8390
variable "kubectl_config_context_name" {
8491
description = "The config context to use when authenticating to the Kubernetes cluster. If empty, defaults to the current context specified in the kubeconfig file."
92+
type = string
8593
default = ""
8694
}
8795

8896
variable "kubectl_config_path" {
8997
description = "The path to the config file to use for kubectl. If empty, defaults to $HOME/.kube/config"
98+
type = string
9099
default = "~/.kube/config"
91100
}
92101

93102
# Helm client config options
94103

95104
variable "configure_helm" {
96105
description = "Whether or not to configure the local helm client to authenticate to the deployed Tiller instance."
106+
type = bool
97107
default = true
98108
}
99109

100110
variable "helm_home" {
101111
description = "The path to the home directory for helm that you wish to use for this deployment."
112+
type = string
102113
default = ""
103114
}
104115

105116
variable "helm_client_rbac_user" {
106117
description = "If set, will setup the local helm client to authenticate using this RBAC user."
118+
type = string
107119
default = ""
108120
}
109121

110122
variable "helm_client_rbac_group" {
111123
description = "If set, will setup the local helm client to authenticate using this RBAC group."
124+
type = string
112125
default = ""
113126
}
114127

115128
variable "helm_client_rbac_service_account" {
116129
description = "If set, will setup the local helm client to authenticate using this ServiceAccount. The ServiceAccount should be encoded as NAMESPACE/NAME."
130+
type = string
117131
default = ""
118132
}

modules/k8s-helm-client-tls-certs/variables.tf

+12-1
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,22 @@ variable "tls_subject" {
1515

1616
variable "ca_tls_certificate_key_pair_secret_namespace" {
1717
description = "Namespace where the CA certificate key pairs are stored."
18+
type = string
1819
}
1920

2021
variable "ca_tls_certificate_key_pair_secret_name" {
2122
description = "Name to use for the Secret resource that stores the CA certificate key pairs."
23+
type = string
2224
}
2325

2426
variable "tls_certificate_key_pair_secret_namespace" {
2527
description = "Namespace where the signed TLS certificate key pairs should be stored."
28+
type = string
2629
}
2730

2831
variable "tls_certificate_key_pair_secret_name" {
2932
description = "Name to use for the Secret resource that stores the signed TLS certificate key pairs."
33+
type = string
3034
}
3135

3236
# ---------------------------------------------------------------------------------------------------------------------
@@ -38,17 +42,20 @@ variable "tls_certificate_key_pair_secret_name" {
3842

3943
variable "private_key_algorithm" {
4044
description = "The name of the algorithm to use for private keys. Must be one of: RSA or ECDSA."
45+
type = string
4146
default = "ECDSA"
4247
}
4348

4449
variable "private_key_ecdsa_curve" {
4550
description = "The name of the elliptic curve to use. Should only be used if var.private_key_algorithm is ECDSA. Must be one of P224, P256, P384 or P521."
51+
type = string
4652
default = "P256"
4753
}
4854

4955
variable "private_key_rsa_bits" {
5056
description = "The size of the generated RSA key in bits. Should only be used if var.private_key_algorithm is RSA."
51-
default = "2048"
57+
type = number
58+
default = 2048
5259
}
5360

5461
variable "tls_certs_allowed_uses" {
@@ -76,6 +83,7 @@ variable "tls_certs_ip_addresses" {
7683

7784
variable "validity_period_hours" {
7885
description = "The number of hours after initial issuing that the certificate will become invalid."
86+
type = number
7987

8088
# 10 years
8189
default = 87660
@@ -85,16 +93,19 @@ variable "validity_period_hours" {
8593

8694
variable "store_in_kubernetes_secret" {
8795
description = "Whether or not to store the generated TLS certificate key pairs in Kubernetes Secret."
96+
type = bool
8897
default = true
8998
}
9099

91100
variable "ca_tls_certificate_key_pair_secret_filename_base" {
92101
description = "Basename used for the TLS certificate files stored in the Secret."
102+
type = string
93103
default = "ca"
94104
}
95105

96106
variable "tls_certificate_key_pair_secret_filename_base" {
97107
description = "Basename to use for the signed TLS certificate files stored in the Secret."
108+
type = string
98109
default = "client"
99110
}
100111

modules/k8s-namespace-roles/variables.tf

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
variable "namespace" {
77
description = "The name of the namespace where the roles should be created."
8+
type = string
89
}
910

1011
# ---------------------------------------------------------------------------------------------------------------------
@@ -26,6 +27,7 @@ variable "annotations" {
2627

2728
variable "create_resources" {
2829
description = "Set to false to have this module create no resources. This weird parameter exists solely because Terraform does not support conditional modules. Therefore, this is a hack to allow you to conditionally decide if the Namespace roles should be created or not."
30+
type = bool
2931
default = true
3032
}
3133

modules/k8s-namespace/variables.tf

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
variable "name" {
77
description = "The name of the namespace to be created."
8+
type = string
89
}
910

1011
# ---------------------------------------------------------------------------------------------------------------------
@@ -26,6 +27,7 @@ variable "annotations" {
2627

2728
variable "create_resources" {
2829
description = "Set to false to have this module create no resources. This weird parameter exists solely because Terraform does not support conditional modules. Therefore, this is a hack to allow you to conditionally decide if the Namespace should be created or not."
30+
type = bool
2931
default = true
3032
}
3133

modules/k8s-service-account/variables.tf

+4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55

66
variable "name" {
77
description = "The name of the service account to be created."
8+
type = string
89
}
910

1011
variable "namespace" {
1112
description = "The namespace where the service account is created."
13+
type = string
1214
}
1315

1416
# ---------------------------------------------------------------------------------------------------------------------
@@ -20,6 +22,7 @@ variable "namespace" {
2022
# See: https://github.com/hashicorp/terraform/issues/17421
2123
variable "num_rbac_roles" {
2224
description = "Number of RBAC roles to bind. This should match the number of items in the list passed to rbac_roles."
25+
type = number
2326
default = 0
2427
}
2528

@@ -49,6 +52,7 @@ variable "annotations" {
4952

5053
variable "automount_service_account_token" {
5154
description = "Whether or not to automatically mount the service account token into the container. This defaults to true."
55+
type = bool
5256
default = true
5357
}
5458

modules/k8s-tiller-tls-certs/variables.tf

+12-1
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,22 @@ variable "signed_tls_subject" {
2121

2222
variable "ca_tls_certificate_key_pair_secret_namespace" {
2323
description = "Namespace where the CA certificate key pairs should be stored."
24+
type = string
2425
}
2526

2627
variable "ca_tls_certificate_key_pair_secret_name" {
2728
description = "Name to use for the Secret resource that stores the CA certificate key pairs."
29+
type = string
2830
}
2931

3032
variable "signed_tls_certificate_key_pair_secret_namespace" {
3133
description = "Namespace where the signed TLS certificate key pairs should be stored."
34+
type = string
3235
}
3336

3437
variable "signed_tls_certificate_key_pair_secret_name" {
3538
description = "Name to use for the Secret resource that stores the signed TLS certificate key pairs."
39+
type = string
3640
}
3741

3842
# ---------------------------------------------------------------------------------------------------------------------
@@ -44,17 +48,20 @@ variable "signed_tls_certificate_key_pair_secret_name" {
4448

4549
variable "private_key_algorithm" {
4650
description = "The name of the algorithm to use for private keys. Must be one of: RSA or ECDSA."
51+
type = string
4752
default = "ECDSA"
4853
}
4954

5055
variable "private_key_ecdsa_curve" {
5156
description = "The name of the elliptic curve to use. Should only be used if var.private_key_algorithm is ECDSA. Must be one of P224, P256, P384 or P521."
57+
type = string
5258
default = "P256"
5359
}
5460

5561
variable "private_key_rsa_bits" {
5662
description = "The size of the generated RSA key in bits. Should only be used if var.private_key_algorithm is RSA."
57-
default = "2048"
63+
type = number
64+
default = 2048
5865
}
5966

6067
variable "ca_tls_certs_allowed_uses" {
@@ -95,6 +102,7 @@ variable "signed_tls_certs_ip_addresses" {
95102

96103
variable "validity_period_hours" {
97104
description = "The number of hours after initial issuing that the certificate will become invalid."
105+
type = number
98106

99107
# 10 years
100108
default = 87660
@@ -104,6 +112,7 @@ variable "validity_period_hours" {
104112

105113
variable "ca_tls_certificate_key_pair_secret_filename_base" {
106114
description = "Basename to use for the TLS certificate files stored in the Secret."
115+
type = string
107116
default = "ca"
108117
}
109118

@@ -121,6 +130,7 @@ variable "ca_tls_certificate_key_pair_secret_annotations" {
121130

122131
variable "signed_tls_certificate_key_pair_secret_filename_base" {
123132
description = "Basename to use for the signed TLS certificate files stored in the Secret."
133+
type = string
124134
default = "tls"
125135
}
126136

@@ -138,6 +148,7 @@ variable "signed_tls_certificate_key_pair_secret_annotations" {
138148

139149
variable "create_resources" {
140150
description = "Set to false to have this module create no resources. This weird parameter exists solely because Terraform does not support conditional modules. Therefore, this is a hack to allow you to conditionally decide if the TLS certs should be created or not."
151+
type = bool
141152
default = true
142153
}
143154

0 commit comments

Comments
 (0)