diff --git a/argocd/provider.go b/argocd/provider.go index 40ff2163..bc9c4901 100644 --- a/argocd/provider.go +++ b/argocd/provider.go @@ -89,6 +89,10 @@ func Provider() terraform.ResourceProvider { Type: schema.TypeBool, Optional: true, }, + "grpc_web_root_path": { + Type: schema.TypeString, + Optional: true, + }, "port_forward": { Type: schema.TypeBool, Optional: true, @@ -219,6 +223,9 @@ func initApiClient(d *schema.ResourceData) ( if v, ok := d.GetOk("grpc_web"); ok { opts.GRPCWeb = v.(bool) } + if v, ok := d.GetOk("grpc_web_root_path"); ok { + opts.GRPCWebRootPath = v.(string) + } if v, ok := d.GetOk("port_forward"); ok { opts.PortForward = v.(bool) } diff --git a/docs/index.md b/docs/index.md index 741bdf9b..5da31bca 100644 --- a/docs/index.md +++ b/docs/index.md @@ -21,7 +21,8 @@ provider "argocd" { * `plain_text` - (Optional) Boolean, whether to initiate an unencrypted connection to ArgoCD server. * `context` - (Optional) Kubernetes context to load from an existing `.kube/config` file. Can be set through `ARGOCD_CONTEXT` environment variable. * `user_agent` - (Optional) -* `grpc_web` - (Optional) Whether to use gRPC web proxy client. +* `grpc_web` - (Optional) Whether to use gRPC web proxy client. Useful if Argo CD server is behind proxy which does not support HTTP2. +* `grpc_web_root_path` - (Optional) Use the gRPC web proxy client and set the web root, e.g. `argo-cd`. Useful if the Argo CD server is behind a proxy at a non-root path. * `port_forward` - (Optional) * `port_forward_with_namespace` - (Optional) * `headers` - (Optional) Additional headers to add to each request to the ArgoCD server.