Skip to content

Instantly share code, notes, and snippets.

@stvdilln
Created January 31, 2020 15:02
Show Gist options
  • Save stvdilln/a023b31d22909402025d0a3a14a890f5 to your computer and use it in GitHub Desktop.
Save stvdilln/a023b31d22909402025d0a3a14a890f5 to your computer and use it in GitHub Desktop.
Creating a Root Certificate Authority in Vault with Terraform
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