Skip to content

Commit

Permalink
Generate endpoint resolution for services without generated clients
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Jun 20, 2024
1 parent 26a2010 commit 5f5ad73
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions internal/generate/servicepackage/endpoint_resolver.go.gtpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ package {{ .ProviderPackage }}

import (
"context"
{{- if .GenerateClient }}
"fmt"
"net"
{{ if .ClientSDKV1 -}}
"net/url"
{{ end }}
{{ end }}

{{ if .GenerateClient }}
{{- if .ClientSDKV1 }}
endpoints_sdkv1 "github.com/aws/aws-sdk-go/aws/endpoints"
{{- end }}
Expand All @@ -23,10 +20,8 @@ import (
{{- end }}
"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-provider-aws/internal/errs"
{{- end }}
)

{{- if .GenerateClient }}
{{ if .ClientSDKV1 }}
var _ endpoints_sdkv1.Resolver = resolverSDKv1{}

Expand Down Expand Up @@ -159,4 +154,3 @@ func withBaseEndpoint(endpoint string) func(*{{ .GoV2Package }}_sdkv2.Options) {
}
}
{{ end }}
{{ end }}
2 changes: 1 addition & 1 deletion internal/generate/servicepackage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func main() {
g.Fatalf("generating file (%s): %s", filename, err)
}

if s.GenerateClient {
if p != "meta" {
g.Infof("Generating internal/service/%s/%s", servicePackage, endpointResolverFilenamne)

d = g.NewGoFileDestination(endpointResolverFilenamne)
Expand Down

0 comments on commit 5f5ad73

Please sign in to comment.