github.com/lymingtonprecision/terraform@v0.9.9-0.20170613092852-62acef9611a9/website/source/docs/providers/rancher/r/registration_token.html.markdown (about) 1 --- 2 layout: "rancher" 3 page_title: "Rancher: rancher_registration_token" 4 sidebar_current: "docs-rancher-resource-registration-token" 5 description: |- 6 Provides a Rancher Registration Token resource. This can be used to create registration tokens for rancher environments and retrieve their information. 7 --- 8 9 # rancher\_registration\_token 10 11 Provides a Rancher Registration Token resource. This can be used to create registration tokens for rancher environments and retrieve their information. 12 13 ## Example Usage 14 15 ```hcl 16 # Create a new Rancher registration token 17 resource "rancher_registration_token" "default" { 18 name = "staging_token" 19 description = "Registration token for the staging environment" 20 environment_id = "${rancher_environment.default.id}" 21 22 host_labels { 23 orchestration = true, 24 etcd = true, 25 compute = true 26 } 27 } 28 ``` 29 30 ## Argument Reference 31 32 The following arguments are supported: 33 34 * `name` - (Required) The name of the registration token. 35 * `description` - (Optional) A registration token description. 36 * `environment_id` - (Required) The ID of the environment to create the token for. 37 * `host_labels` - (Optional) A map of host labels to add to the registration command. 38 39 ## Attributes Reference 40 41 The following attributes are exported: 42 43 * `command` - The command used to start a rancher agent for this environment. 44 * `registration_url` - The URL to use to register new nodes to the environment. 45 * `token` - The token to use to register new nodes to the environment. 46 47 ## Import 48 49 Registration tokens can be imported using the Environment and Registration token 50 IDs in the form `<environment_id>/<registration_token_id>`. 51 52 ``` 53 $ terraform import rancher_registration_token.dev_token 1a5/1c11 54 ``` 55 56 If the credentials for the Rancher provider have access to the global API, then 57 then `environment_id` can be omitted e.g. 58 59 ``` 60 $ terraform import rancher_registration_token.dev_token 1c11 61 ```