Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix root token example and add clarification to resource doc #372

Merged
merged 3 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/guides/consul-root-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ The secret ID of this root token can be used to configure the Consul provider.
```
provider "consul" {
address = "example.consul.io:80"
token = hcp_consul_cluster_root_token.example.root_token_secret_id
token = hcp_consul_cluster_root_token.example.secret_id
}
```
```
3 changes: 3 additions & 0 deletions docs/resources/consul_cluster_root_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ page_title: "Resource hcp_consul_cluster_root_token - terraform-provider-hcp"
subcategory: ""
description: |-
The cluster root token resource is the token used to bootstrap the cluster's ACL system. You can also generate this root token from the HCP Consul UI.
Note that creation of this resource will invalidate the default consul_root_token_accessor_id and consul_root_token_secret_id on the target hcp_consul_cluster resource.
---

# hcp_consul_cluster_root_token (Resource)
Expand All @@ -11,6 +12,8 @@ description: |-

The cluster root token resource is the token used to bootstrap the cluster's ACL system. You can also generate this root token from the HCP Consul UI.

_Note that creation of this resource will invalidate the default `consul_root_token_accessor_id` and `consul_root_token_secret_id` on the target `hcp_consul_cluster` resource._

## Example Usage

```terraform
Expand Down
4 changes: 3 additions & 1 deletion internal/provider/resource_consul_cluster_root_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ data:
func resourceConsulClusterRootToken() *schema.Resource {
return &schema.Resource{
Description: "The cluster root token resource is the token used to bootstrap the cluster's ACL system. " +
"You can also generate this root token from the HCP Consul UI.",
"You can also generate this root token from the HCP Consul UI.\n\n" +
"_Note that creation of this resource will invalidate the default `consul_root_token_accessor_id` and " +
"`consul_root_token_secret_id` on the target `hcp_consul_cluster` resource._",
CreateContext: resourceConsulClusterRootTokenCreate,
ReadContext: resourceConsulClusterRootTokenRead,
DeleteContext: resourceConsulClusterRootTokenDelete,
Expand Down
4 changes: 2 additions & 2 deletions templates/guides/consul-root-token.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ The secret ID of this root token can be used to configure the Consul provider.
```
provider "consul" {
address = "example.consul.io:80"
token = hcp_consul_cluster_root_token.example.root_token_secret_id
token = hcp_consul_cluster_root_token.example.secret_id
}
```
```