-
Notifications
You must be signed in to change notification settings - Fork 649
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
Add new resource cloudflare_argo_tunnel
#905
Conversation
} | ||
|
||
func resourceCloudflareArgoTunnelUpdate(d *schema.ResourceData, meta interface{}) error { | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to do something here to stop in place updates from being a possibility. will have a dig around and see what options we have.
} | ||
|
||
func resourceCloudflareArgoTunnelRead(d *schema.ResourceData, meta interface{}) error { | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resource is read only once created so 🤷♂️ nothing to sync
|
||
* `account_id` - (Required) The Cloudflare account ID that you wish to manage the Argo Tunnel on. | ||
* `name` - (Required) A user-friendly name chosen when the tunnel is created. Cannot be empty. | ||
* `secret` - (Required) 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up..I'm not sure how the cloudflare-go library handles this, but the HTTP API does not have the requirement that the secret be a base64 string (it might not even have the requirement that it be 32 bytes or more, but all my scripts use 32 bytes or more so I can't say off the top of my head).
When the secret is auto generated by the cloudflared cli tool, it generates a base64 encoded string, but I think that is just their quick way of generating a random string.
I've used long strings generated with password generators with no problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The requirement is documented (also where I stole this line from) and is enforced by the API schema.
In terms of how cloudflare-go
handles this, it only passes on the string it is sent. It does not check for base64 encoding or the length. Instead, it will error out if the API errors out. Same principle here where we don't actually enforce it and instead offload that to the API itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, interesting. Thanks for the link @jacobbednarz. Looks like a mistake on our side, however I can report that the CF API (at least before christmas, when I last poked it) doesn't error out if you pass an invalid base64 string. Will update our code though to comply with the docs in the event it starts being enforced.
Creates a new resource for managing Argo Tunnels. Closes #603
487c04b
to
0b454b1
Compare
this has been released in v2.18.0 |
Creates a new resource for managing Argo Tunnels.
Depends on cloudflare/cloudflare-go#572 for V4 response structure.
Closes #603