This repository has been archived by the owner on Sep 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional
ssl_ca_cert/private_key
- If this property is provided, the templates will generate a self-signed SSL cert for the LB - If this property is omitted, the user must specify `ssl_cert/private_key` as before Signed-off-by: Andrew Crump <[email protected]> [#151161097]
- Loading branch information
1 parent
29c16d8
commit 3d90302
Showing
5 changed files
with
149 additions
and
13 deletions.
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,88 @@ | ||
resource "tls_cert_request" "ssl_csr" { | ||
key_algorithm = "RSA" | ||
private_key_pem = "${tls_private_key.ssl_private_key.private_key_pem}" | ||
|
||
dns_names = [ | ||
"*.apps.${var.env_name}.${var.dns_suffix}", | ||
"*.sys.${var.env_name}.${var.dns_suffix}", | ||
] | ||
|
||
count = "${length(var.ssl_ca_cert) > 0 ? 1 : 0}" | ||
|
||
subject { | ||
common_name = "${var.env_name}.${var.dns_suffix}" | ||
organization = "Pivotal" | ||
organizational_unit = "Cloudfoundry" | ||
country = "US" | ||
province = "CA" | ||
locality = "San Francisco" | ||
} | ||
} | ||
|
||
resource "tls_locally_signed_cert" "ssl_cert" { | ||
cert_request_pem = "${tls_cert_request.ssl_csr.cert_request_pem}" | ||
ca_key_algorithm = "RSA" | ||
ca_private_key_pem = "${var.ssl_ca_private_key}" | ||
ca_cert_pem = "${var.ssl_ca_cert}" | ||
|
||
count = "${length(var.ssl_ca_cert) > 0 ? 1 : 0}" | ||
|
||
validity_period_hours = 8760 # 1year | ||
|
||
allowed_uses = [ | ||
"key_encipherment", | ||
"digital_signature", | ||
"server_auth", | ||
] | ||
} | ||
|
||
resource "tls_private_key" "ssl_private_key" { | ||
algorithm = "RSA" | ||
rsa_bits = "2048" | ||
|
||
count = "${length(var.ssl_ca_cert) > 0 ? 1 : 0}" | ||
} | ||
|
||
resource "tls_cert_request" "isoseg_ssl_csr" { | ||
key_algorithm = "RSA" | ||
private_key_pem = "${tls_private_key.isoseg_ssl_private_key.private_key_pem}" | ||
|
||
dns_names = [ | ||
"*.iso.${var.env_name}.${var.dns_suffix}", | ||
] | ||
|
||
count = "${length(var.isoseg_ssl_ca_cert) > 0 ? 1 : 0}" | ||
|
||
subject { | ||
common_name = "${var.env_name}.${var.dns_suffix}" | ||
organization = "Pivotal" | ||
organizational_unit = "Cloudfoundry" | ||
country = "US" | ||
province = "CA" | ||
locality = "San Francisco" | ||
} | ||
} | ||
|
||
resource "tls_locally_signed_cert" "isoseg_ssl_cert" { | ||
cert_request_pem = "${tls_cert_request.isoseg_ssl_csr.cert_request_pem}" | ||
ca_key_algorithm = "RSA" | ||
ca_private_key_pem = "${var.isoseg_ssl_ca_private_key}" | ||
ca_cert_pem = "${var.isoseg_ssl_ca_cert}" | ||
|
||
count = "${length(var.isoseg_ssl_ca_cert) > 0 ? 1 : 0}" | ||
|
||
validity_period_hours = 8760 # 1year | ||
|
||
allowed_uses = [ | ||
"key_encipherment", | ||
"digital_signature", | ||
"server_auth", | ||
] | ||
} | ||
|
||
resource "tls_private_key" "isoseg_ssl_private_key" { | ||
algorithm = "RSA" | ||
rsa_bits = "2048" | ||
|
||
count = "${length(var.isoseg_ssl_ca_cert) > 0 ? 1 : 0}" | ||
} |
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