Skip to content

Commit

Permalink
make docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Apr 12, 2023
1 parent ae06159 commit 1650f7a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docs/resources/tunnel.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ resource "cloudflare_tunnel" "example" {
- `account_id` (String) The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
- `name` (String) A user-friendly name chosen when the tunnel is created. **Modifying this attribute will force creation of a new resource.**
- `secret` (String, Sensitive) 32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. **Modifying this attribute will force creation of a new resource.**
- `config_src` (String, Optional) Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard or using `tunnel_config`, `tunnel_route` or `tunnel_virtual_network` resources. **Modifying this attribute will force creation of a new resource.**

### Optional

- `config_src` (String) Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard or using tunnel_config, tunnel_route or tunnel_virtual_network resources. Available values: `local`, `cloudflare`. **Modifying this attribute will force creation of a new resource.**

### Read-Only

Expand Down
1 change: 1 addition & 0 deletions internal/sdkv2provider/resource_cloudflare_tunnel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func TestAccCloudflareTunnelCreate_Managed(t *testing.T) {
resource.TestCheckResourceAttr(name, "name", rnd),
resource.TestCheckResourceAttr(name, "secret", "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="),
resource.TestMatchResourceAttr(name, "cname", regexp.MustCompile(".*\\.cfargotunnel\\.com")),
resource.TestCheckResourceAttr(name, "config_src", "cloudflare"),
),
},
},
Expand Down
13 changes: 8 additions & 5 deletions internal/sdkv2provider/schema_cloudflare_tunnel.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package sdkv2provider

import (
"fmt"

"github.com/cloudflare/terraform-provider-cloudflare/internal/consts"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
)

func resourceCloudflareTunnelSchema() map[string]*schema.Schema {
Expand All @@ -27,11 +30,11 @@ func resourceCloudflareTunnelSchema() map[string]*schema.Schema {
Description: "32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password.",
},
"config_src": {
Type: schema.TypeString,
Optional: true,
Sensitive: false,
ForceNew: true,
Description: "Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard or using tunnel_config, tunnel_route or tunnel_virtual_network resources.",
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"local", "cloudflare"}, false),
Description: fmt.Sprintf("Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard or using tunnel_config, tunnel_route or tunnel_virtual_network resources. %s", renderAvailableDocumentationValuesStringSlice([]string{"local", "cloudflare"})),
},
"cname": {
Type: schema.TypeString,
Expand Down

0 comments on commit 1650f7a

Please sign in to comment.