Skip to content

Instantly share code, notes, and snippets.

@stvdilln
Created January 31, 2020 15:05
Show Gist options
  • Save stvdilln/5828e65dbb781c60d2bf0b98e8a3ebe4 to your computer and use it in GitHub Desktop.
Save stvdilln/5828e65dbb781c60d2bf0b98e8a3ebe4 to your computer and use it in GitHub Desktop.
Creating the Root CA Certificate with Terraforms PKI
#
# Create a Self Signed Certificate , to use as the Root Certificate Authority
#
resource tls_self_signed_cert ca_cert {
private_key_pem = tls_private_key.ca_key.private_key_pem
key_algorithm = "RSA"
subject {
common_name = "${var.server_cert_domain} Root CA"
organization = "Acme Inc"
organizational_unit = "Development"
street_address = ["1234 Main Street"]
locality = "Beverly Hills"
province = "CA"
country = "USA"
postal_code = "90210"
}
# 175200 = 20 years
validity_period_hours = 175200
allowed_uses = [
"cert_signing",
"crl_signing"
]
is_ca_certificate = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment