Created
February 9, 2017 18:34
-
-
Save vancluever/64391ac2fc7ad86137dbe81c25c10e01 to your computer and use it in GitHub Desktop.
Sample terraform-provider-acme config
This file contains hidden or 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
| variable "email_address" { | |
| type = "string" | |
| } | |
| variable "domain" { | |
| type = "string" | |
| } | |
| resource "tls_private_key" "private_key" { | |
| algorithm = "RSA" | |
| } | |
| # Set up a registration using a private key from tls_private_key | |
| resource "acme_registration" "reg" { | |
| server_url = "https://acme-staging.api.letsencrypt.org/directory" | |
| account_key_pem = "${tls_private_key.private_key.private_key_pem}" | |
| email_address = "${var.email_address}" | |
| } | |
| # Create a certificate | |
| resource "acme_certificate" "certificate" { | |
| server_url = "https://acme-staging.api.letsencrypt.org/directory" | |
| account_key_pem = "${tls_private_key.private_key.private_key_pem}" | |
| common_name = "www.${var.domain}" | |
| subject_alternative_names = ["www2.${var.domain}"] | |
| dns_challenge { | |
| provider = "route53" | |
| } | |
| registration_url = "${acme_registration.reg.id}" | |
| } | |
| output "certificate" { | |
| value = "${acme_certificate.certificate.certificate_pem}" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment