github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/tls/r/cert_request.html.md (about)

     1  ---
     2  layout: "tls"
     3  page_title: "TLS: tls_cert_request"
     4  sidebar_current: "docs-tls-data-source-cert-request"
     5  description: |-
     6    Creates a PEM-encoded certificate request.
     7  ---
     8  
     9  # tls\_cert\_request
    10  
    11  Generates a *Certificate Signing Request* (CSR) in PEM format, which is the
    12  typical format used to request a certificate from a certificate authority.
    13  
    14  This resource is intended to be used in conjunction with a Terraform provider
    15  for a particular certificate authority in order to provision a new certificate.
    16  This is a *logical resource*, so it contributes only to the current Terraform
    17  state and does not create any external managed resources.
    18  
    19  ~> **Compatibility Note** From Terraform 0.7.0 to 0.7.4 this resource was
    20  converted to a data source, and the resource form of it was deprecated. This
    21  turned out to be a design error since a cert request includes a random number
    22  in the form of the signature nonce, and so the data source form of this
    23  resource caused non-convergent configuration. The data source form is no longer
    24  supported as of Terraform 0.7.5 and any users should return to using the
    25  resource form.
    26  
    27  ## Example Usage
    28  
    29  ```hcl
    30  resource "tls_cert_request" "example" {
    31    key_algorithm   = "ECDSA"
    32    private_key_pem = "${file("private_key.pem")}"
    33  
    34    subject {
    35      common_name  = "example.com"
    36      organization = "ACME Examples, Inc"
    37    }
    38  }
    39  ```
    40  
    41  ## Argument Reference
    42  
    43  The following arguments are supported:
    44  
    45  * `key_algorithm` - (Required) The name of the algorithm for the key provided
    46  in `private_key_pem`.
    47  
    48  * `private_key_pem` - (Required) PEM-encoded private key data. This can be
    49  read from a separate file using the ``file`` interpolation function. Only
    50  an irreversable secure hash of the private key will be stored in the Terraform
    51  state.
    52  
    53  * `subject` - (Required) The subject for which a certificate is being requested. This is
    54  a nested configuration block whose structure is described below.
    55  
    56  * `dns_names` - (Optional) List of DNS names for which a certificate is being requested.
    57  
    58  * `ip_addresses` - (Optional) List of IP addresses for which a certificate is being requested.
    59  
    60  The nested `subject` block accepts the following arguments, all optional, with their meaning
    61  corresponding to the similarly-named attributes defined in
    62  [RFC5290](https://tools.ietf.org/html/rfc5280#section-4.1.2.4):
    63  
    64  * `common_name` (string)
    65  
    66  * `organization` (string)
    67  
    68  * `organizational_unit` (string)
    69  
    70  * `street_address` (list of strings)
    71  
    72  * `locality` (string)
    73  
    74  * `province` (string)
    75  
    76  * `country` (string)
    77  
    78  * `postal_code` (string)
    79  
    80  * `serial_number` (string)
    81  
    82  ## Attributes Reference
    83  
    84  The following attributes are exported:
    85  
    86  * `cert_request_pem` - The certificate request data in PEM format.