website: syntax highlighting and hclfmt layout for TLS provider

This commit is contained in:
Martin Atkins 2017-04-07 16:54:00 -07:00
parent af05871e65
commit 853b411840
5 changed files with 57 additions and 58 deletions

View File

@ -26,7 +26,7 @@ Use the navigation to the left to read about the available resources.
## Example Usage ## Example Usage
``` ```hcl
## This example create a self-signed certificate for a development ## This example create a self-signed certificate for a development
## environment. ## environment.
## THIS IS NOT RECOMMENDED FOR PRODUCTION SERVICES. ## THIS IS NOT RECOMMENDED FOR PRODUCTION SERVICES.
@ -34,39 +34,39 @@ Use the navigation to the left to read about the available resources.
## security considerations and other practical tradeoffs. ## security considerations and other practical tradeoffs.
resource "tls_private_key" "example" { resource "tls_private_key" "example" {
algorithm = "ECDSA" algorithm = "ECDSA"
} }
resource "tls_self_signed_cert" "example" { resource "tls_self_signed_cert" "example" {
key_algorithm = "${tls_private_key.example.algorithm}" key_algorithm = "${tls_private_key.example.algorithm}"
private_key_pem = "${tls_private_key.example.private_key_pem}" private_key_pem = "${tls_private_key.example.private_key_pem}"
# Certificate expires after 12 hours. # Certificate expires after 12 hours.
validity_period_hours = 12 validity_period_hours = 12
# Generate a new certificate if Terraform is run within three # Generate a new certificate if Terraform is run within three
# hours of the certificate's expiration time. # hours of the certificate's expiration time.
early_renewal_hours = 3 early_renewal_hours = 3
# Reasonable set of uses for a server SSL certificate. # Reasonable set of uses for a server SSL certificate.
allowed_uses = [ allowed_uses = [
"key_encipherment", "key_encipherment",
"digital_signature", "digital_signature",
"server_auth", "server_auth",
] ]
dns_names = ["example.com", "example.net"] dns_names = ["example.com", "example.net"]
subject { subject {
common_name = "example.com" common_name = "example.com"
organization = "ACME Examples, Inc" organization = "ACME Examples, Inc"
} }
} }
# For example, this can be used to populate an AWS IAM server certificate. # For example, this can be used to populate an AWS IAM server certificate.
resource "aws_iam_server_certificate" "example" { resource "aws_iam_server_certificate" "example" {
name = "example_self_signed_cert" name = "example_self_signed_cert"
certificate_body = "${tls_self_signed_cert.example.cert_pem}" certificate_body = "${tls_self_signed_cert.example.cert_pem}"
private_key = "${tls_private_key.example.private_key_pem}" private_key = "${tls_private_key.example.private_key_pem}"
} }
``` ```

View File

@ -26,15 +26,15 @@ resource form.
## Example Usage ## Example Usage
``` ```hcl
resource "tls_cert_request" "example" { resource "tls_cert_request" "example" {
key_algorithm = "ECDSA" key_algorithm = "ECDSA"
private_key_pem = "${file(\"private_key.pem\")}" private_key_pem = "${file("private_key.pem")}"
subject { subject {
common_name = "example.com" common_name = "example.com"
organization = "ACME Examples, Inc" organization = "ACME Examples, Inc"
} }
} }
``` ```

View File

@ -17,21 +17,20 @@ or when deployed internally to an organization.
## Example Usage ## Example Usage
``` ```hcl
resource "tls_locally_signed_cert" "example" { resource "tls_locally_signed_cert" "example" {
cert_request_pem = "${file(\"cert_request.pem\")}" cert_request_pem = "${file("cert_request.pem")}"
ca_key_algorithm = "ECDSA"
ca_private_key_pem = "${file("ca_private_key.pem")}"
ca_cert_pem = "${file("ca_cert.pem")}"
ca_key_algorithm = "ECDSA" validity_period_hours = 12
ca_private_key_pem = "${file(\"ca_private_key.pem\")}"
ca_cert_pem = "${file(\"ca_cert.pem\")}"
validity_period_hours = 12 allowed_uses = [
"key_encipherment",
allowed_uses = [ "digital_signature",
"key_encipherment", "server_auth",
"digital_signature", ]
"server_auth",
]
} }
``` ```

View File

@ -23,10 +23,10 @@ state and does not create any external managed resources.
## Example Usage ## Example Usage
``` ```hcl
resource "tls_private_key" "example" { resource "tls_private_key" "example" {
algorithm = "ECDSA" algorithm = "ECDSA"
ecdsa_curve = "P384" ecdsa_curve = "P384"
} }
``` ```

View File

@ -27,23 +27,23 @@ Load Balancer*, *Elastic Beanstalk*, *CloudFront* or *OpsWorks*.
## Example Usage ## Example Usage
``` ```hcl
resource "tls_self_signed_cert" "example" { resource "tls_self_signed_cert" "example" {
key_algorithm = "ECDSA" key_algorithm = "ECDSA"
private_key_pem = "${file(\"private_key.pem\")}" private_key_pem = "${file(\"private_key.pem\")}"
subject { subject {
common_name = "example.com" common_name = "example.com"
organization = "ACME Examples, Inc" organization = "ACME Examples, Inc"
} }
validity_period_hours = 12 validity_period_hours = 12
allowed_uses = [ allowed_uses = [
"key_encipherment", "key_encipherment",
"digital_signature", "digital_signature",
"server_auth", "server_auth",
] ]
} }
``` ```