diff --git a/spacelift/provider.go b/spacelift/provider.go index f67a3544..21099cf5 100644 --- a/spacelift/provider.go +++ b/spacelift/provider.go @@ -225,7 +225,11 @@ func buildClientFromToken(token string) (*internal.Client, error) { func buildClientFromAPIKeyData(d *schema.ResourceData) (*internal.Client, error) { // Since validation runs first, we can safely assume that the data is there. - endpoint := fmt.Sprintf("%s/graphql", d.Get("api_key_endpoint").(string)) + + // Handle / at api_key_endpoint + endpoint := strings.TrimSuffix(d.Get("api_key_endpoint").(string), "/") + endpoint = fmt.Sprintf("%s/graphql", endpoint) + apiKeyID := d.Get("api_key_id").(string) apiKeySecret := d.Get("api_key_secret").(string)