github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/rancher/r/certificate.html.markdown (about) 1 --- 2 layout: "rancher" 3 page_title: "Rancher: rancher_certificate" 4 sidebar_current: "docs-rancher-resource-certificate" 5 description: |- 6 Provides a Rancher Certificate resource. This can be used to create certificates for rancher environments and retrieve their information. 7 --- 8 9 # rancher\_certificate 10 11 Provides a Rancher Certificate resource. This can be used to create certificates for rancher environments and retrieve their information. 12 13 ## Example Usage 14 15 ```hcl 16 # Create a new Rancher Certificate 17 resource rancher_certificate "foo" { 18 name = "foo" 19 description = "my foo certificate" 20 environment_id = "${rancher_environment.test.id}" 21 cert = "${file("server.crt")}" 22 key = "${file("server.key")}" 23 } 24 ``` 25 26 ## Argument Reference 27 28 The following arguments are supported: 29 30 * `name` - (Required) The name of the registry credential. 31 * `description` - (Optional) A registry credential description. 32 * `environment_id` - (Required) The ID of the environment to create the certificate for. 33 * `cert` - (Required) The certificate content. 34 * `cert_chain` - (Optional) The certificate chain. 35 * `key` - (Required) The certificate key. 36 37 ## Attributes Reference 38 39 The following attributes are exported: 40 41 * `cn` - The certificate CN. 42 * `algorithm` - The certificate algorithm. 43 * `cert_fingerprint` - The certificate fingerprint. 44 * `expires_at` - The certificate expiration date. 45 * `issued_at` - The certificate creation date. 46 * `issuer` - The certificate issuer. 47 * `key_size` - The certificate key size. 48 * `serial_number` - The certificate serial number. 49 * `subject_alternative_names` - The list of certificate Subject Alternative Names. 50 * `version` - The certificate version. 51 52 ## Import 53 54 Registry credentials can be imported using the Registry and credentials 55 IDs in the format `<environment_id>/<certificate_id>` 56 57 ``` 58 $ terraform import rancher_certificate.mycert 1sp31/1c605 59 ``` 60 61 If the credentials for the Rancher provider have access to the global API, 62 then `environment_id` can be omitted e.g. 63 64 ``` 65 $ terraform import rancher_certificate.mycert 1c605 66 ```