-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add issuing certificate feature (#8)
* Add certificate feature. * add description about Certificates feature * Fixed: name space cannot be specified. * Fixed: Missing Type in Certificate * change to use var.namespace as the default
- Loading branch information
Showing
7 changed files
with
262 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
locals { | ||
name = var.name | ||
namespace = var.namespace | ||
secret_name = var.secret_name | ||
secret_annotations = var.secret_annotations | ||
secret_labels = var.secret_labels | ||
duration = var.duration | ||
renew_before = var.renew_before | ||
organizations = var.organizations | ||
# The use of the common name field has been deprecated sicne 2000 and is | ||
# discouraged from being used | ||
# common_name = var.common_name | ||
is_ca = var.is_ca | ||
private_key_algorithm = var.private_key_algorithm | ||
private_key_encoding = var.private_key_encoding | ||
private_key_size = var.private_key_size | ||
usages = var.usages | ||
dns_names = var.dns_names | ||
uris = var.uris | ||
ip_addresses = var.ip_addresses | ||
issuer_name = var.issuer_name | ||
issuer_kind = var.issuer_kind | ||
issuer_group = var.issuer_group | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
output "map" { | ||
value = { | ||
apiVersion = "cert-manager.io/v1" | ||
kind = "Certificate" | ||
metadata = { | ||
name = var.name | ||
namespace = var.namespace | ||
} | ||
spec = { | ||
secretName = var.secret_name | ||
|
||
secretTemplate = { | ||
annotations = var.secret_annotations | ||
labels = var.secret_labels | ||
} | ||
|
||
duration = var.duration | ||
renewBefore = var.renew_before | ||
subject = { | ||
organizations = var.organizations | ||
} | ||
isCA = var.is_ca | ||
private_key = { | ||
algorithm = var.private_key_algorithm | ||
encoding = var.private_key_encoding | ||
size = var.private_key_size | ||
} | ||
usages = var.usages | ||
dnsNames = var.dns_names | ||
uris = var.uris | ||
ipAddresses = var.ip_addresses | ||
issuerRef = { | ||
name = var.issuer_name | ||
kind = var.issuer_kind | ||
group = var.issuer_group | ||
} | ||
} | ||
} | ||
} | ||
|
||
output "secret_name" { | ||
value = var.secret_name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
variable "name" { | ||
type = string | ||
description = "certificate resource name" | ||
} | ||
|
||
variable "namespace" { | ||
type = string | ||
description = "certificate resource namespace" | ||
default = "cert-manager" | ||
} | ||
|
||
variable "secret_name" { | ||
type = string | ||
description = "certificate secret name" | ||
} | ||
|
||
variable "secret_annotations" { | ||
type = map(string) | ||
description = "certificate secret annotations" | ||
default = {} | ||
} | ||
|
||
variable "secret_labels" { | ||
type = map(string) | ||
description = "certificate secret labels" | ||
default = {} | ||
} | ||
|
||
variable "duration" { | ||
type = string | ||
description = "certificate duration" | ||
default = "2160h" # 90d | ||
} | ||
|
||
variable "renew_before" { | ||
type = string | ||
description = "certificate renew before" | ||
default = "360h" # 15d | ||
} | ||
|
||
variable "organizations" { | ||
type = list(string) | ||
description = "certificate organizations" | ||
default = [] | ||
} | ||
|
||
variable "is_ca" { | ||
type = bool | ||
description = "is CA certificate" | ||
default = false | ||
} | ||
|
||
variable "private_key_algorithm" { | ||
type = string | ||
description = "certificate private key algorithm" | ||
default = "RSA" | ||
} | ||
|
||
variable "private_key_encoding" { | ||
type = string | ||
description = "certificate private key encoding" | ||
default = "PKCS1" | ||
} | ||
|
||
variable "private_key_size" { | ||
type = number | ||
description = "certificate private key size" | ||
default = 2048 | ||
} | ||
|
||
variable "usages" { | ||
type = list(string) | ||
description = "certificate usages" | ||
default = ["server auth", "client auth"] | ||
} | ||
|
||
variable "dns_names" { | ||
type = list(string) | ||
description = "certificate dns names" | ||
} | ||
|
||
variable "uris" { | ||
type = list(string) | ||
description = "certificate uris" | ||
default = [] | ||
} | ||
|
||
variable "ip_addresses" { | ||
type = list(string) | ||
description = "certificate ip addresses" | ||
default = [] | ||
} | ||
|
||
variable "issuer_name" { | ||
type = string | ||
description = "issuer name" | ||
} | ||
|
||
variable "issuer_kind" { | ||
type = string | ||
description = "issuer name" | ||
} | ||
|
||
variable "issuer_group" { | ||
type = string | ||
description = "issuer group" | ||
default = "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters