generated from terraform-modules/template_aws_submodules
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- change common-services to use cert-manager-issuer which uses the new acmpca-eks-cert-manager module - remove extraneous helm charts for non-issuer ca - add contact_email variable
- Loading branch information
Showing
11 changed files
with
631 additions
and
194 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,5 @@ logs | |
| common/README.md | ||
|
|
||
| OLD/ | ||
| X | ||
| Y | ||
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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| locals { | ||
| _module_version = "2.0.1" | ||
| _module_version = "2.0.3" | ||
| } |
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 |
|---|---|---|
| @@ -1,75 +1,14 @@ | ||
| data "aws_ssm_parameter" "subordinate_ca" { | ||
| name = "/enterprise/pki/ca1" | ||
| } | ||
|
|
||
| locals { | ||
| subordinate_ca_settings = jsondecode(data.aws_ssm_parameter.subordinate_ca.value) | ||
| } | ||
|
|
||
| resource "tls_private_key" "subordinate_ca" { | ||
| algorithm = "RSA" | ||
| rsa_bits = 2048 | ||
| } | ||
| module "subordinate_ca" { | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-certificates//acmpca-eks-cert-manager" | ||
|
|
||
| resource "tls_cert_request" "subordinate_ca" { | ||
| private_key_pem = tls_private_key.subordinate_ca.private_key_pem | ||
| dns_names = local.ca_cert_san | ||
| cluster_name = var.cluster_name | ||
| contact_email = var.contact_email | ||
|
|
||
| subject { | ||
| common_name = local.ca_dns_name | ||
| country = "US" | ||
| organization = "U.S. Census Bureau" | ||
| organizational_unit = format("PKI-EKS %v", var.cluster_name) | ||
| } | ||
| tags = merge( | ||
| local.base_tags, | ||
| local.common_tags, | ||
| var.account_tags, | ||
| var.infrastructure_tags, | ||
| var.application_tags, | ||
| ) | ||
| } | ||
|
|
||
| resource "aws_acmpca_certificate" "subordinate_ca" { | ||
| certificate_authority_arn = local.subordinate_ca_settings.arn | ||
| certificate_signing_request = tls_cert_request.subordinate_ca.cert_request_pem | ||
| signing_algorithm = "SHA384WITHRSA" | ||
| validity { | ||
| type = "DAYS" | ||
| value = 365 | ||
| } | ||
| template_arn = local.subordinate_ca_settings.template_arns["SubordinateCACertificate_PathLen0/V1"] | ||
| lifecycle { | ||
| create_before_destroy = true | ||
| } | ||
| } | ||
|
|
||
| locals { | ||
| subordinate_ca_tls_key = base64encode(tls_private_key.subordinate_ca.private_key_pem) | ||
| subordinate_ca_chain = replace(aws_acmpca_certificate.subordinate_ca.certificate_chain, "/\r/", "") | ||
| subordinate_ca_crt = aws_acmpca_certificate.subordinate_ca.certificate | ||
| subordinate_ca_tls_crt = base64encode(join("\n", [local.subordinate_ca_crt, local.subordinate_ca_chain])) | ||
| } | ||
|
|
||
| ## resource "local_sensitive_file" "subordinate_ca_key" { | ||
| ## filename = "certs/subordinate_ca.key" | ||
| ## file_permission = "0644" | ||
| ## directory_permission = "0755" | ||
| ## content = tls_private_key.subordinate_ca.private_key_pem | ||
| ## } | ||
| ## | ||
| ## resource "local_sensitive_file" "subordinate_ca_csr" { | ||
| ## filename = "certs/subordinate_ca.csr" | ||
| ## file_permission = "0644" | ||
| ## directory_permission = "0755" | ||
| ## content = tls_cert_request.subordinate_ca.cert_request_pem | ||
| ## } | ||
| ## | ||
| ## resource "local_sensitive_file" "subordinate_ca_cert" { | ||
| ## filename = "certs/subordinate_ca.crt" | ||
| ## file_permission = "0644" | ||
| ## directory_permission = "0755" | ||
| ## content = aws_acmpca_certificate.subordinate_ca.certificate | ||
| ## } | ||
| ## | ||
| ## resource "local_sensitive_file" "subordinate_ca_cert_chain" { | ||
| ## filename = "certs/subordinate_ca.bundle.crt" | ||
| ## file_permission = "0644" | ||
| ## directory_permission = "0755" | ||
| ## #content = aws_acmpca_certificate.subordinate_ca.certificate_chain | ||
| ## content = replace(aws_acmpca_certificate.subordinate_ca.certificate_chain,"/\r/","") | ||
| ## } | ||
| ## |
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
14 changes: 14 additions & 0 deletions
14
examples/full-cluster-tf-upgrade/1.25/common-services/cert-manager-issuer.tf
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,14 @@ | ||
| module "subordinate_ca" { | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-certificates//acmpca-eks-cert-manager" | ||
|
|
||
| cluster_name = var.cluster_name | ||
| contact_email = var.contact_email | ||
|
|
||
| tags = merge( | ||
| local.base_tags, | ||
| local.common_tags, | ||
| var.account_tags, | ||
| var.infrastructure_tags, | ||
| var.application_tags, | ||
| ) | ||
| } |
File renamed without changes.
Oops, something went wrong.