github.com/koding/terraform@v0.6.4-0.20170608090606-5d7e0339779d/website/source/docs/providers/do/r/certificate.html.markdown (about)

     1  ---
     2  layout: "digitalocean"
     3  page_title: "DigitalOcean: digitalocean_certificate"
     4  sidebar_current: "docs-do-resource-certificate"
     5  description: |-
     6    Provides a DigitalOcean Certificate resource.
     7  ---
     8  
     9  # digitalocean\_certificate
    10  
    11  Provides a DigitalOcean Certificate resource that allows you to manage
    12  certificates for configuring TLS termination in Load Balancers.
    13  Certificates created with this resource can be referenced in your
    14  Load Balancer configuration via their ID.
    15  
    16  ## Example Usage
    17  
    18  ```hcl
    19  # Create a new TLS certificate
    20  resource "digitalocean_certificate" "cert" {
    21    name              = "Terraform Example"
    22    private_key       = "${file("/Users/terraform/certs/privkey.pem")}"
    23    leaf_certificate  = "${file("/Users/terraform/certs/cert.pem")}"
    24    certificate_chain = "${file("/Users/terraform/certs/fullchain.pem")}"
    25  }
    26  
    27  # Create a new Load Balancer with TLS termination
    28  resource "digitalocean_loadbalancer" "public" {
    29    name        = "secure-loadbalancer-1"
    30    region      = "nyc3"
    31    droplet_tag = "backend"
    32  
    33    forwarding_rule {
    34      entry_port      = 443
    35      entry_protocol  = "https"
    36  
    37      target_port     = 80
    38      target_protocol = "http"
    39  
    40      certificate_id  = "${digitalocean_certificate.cert.id}"
    41    }
    42  }
    43  ```
    44  
    45  ## Argument Reference
    46  
    47  The following arguments are supported:
    48  
    49  * `name` - (Required) The name of the certificate for identification.
    50  * `private_key` - (Required) The contents of a PEM-formatted private-key
    51  corresponding to the SSL certificate.
    52  * `leaf_certificate` - (Required) The contents of a PEM-formatted public
    53  TLS certificate.
    54  * `certificate_chain` - (Optional) The full PEM-formatted trust chain
    55  between the certificate authority's certificate and your domain's TLS
    56  certificate.
    57  
    58  ## Attributes Reference
    59  
    60  The following attributes are exported:
    61  
    62  * `id` - The unique ID of the certificate
    63  * `name` - The name of the certificate
    64  * `not_after` - The expiration date of the certificate
    65  * `sha1_fingerprint` - The SHA-1 fingerprint of the certificate