Skip to content

Commit

Permalink
Merge pull request #32192 from hashicorp/td-service-package-factories
Browse files Browse the repository at this point in the history
Tech debt: Export a factory function for each service package
  • Loading branch information
ewbankkit committed Jun 23, 2023
2 parents 4d0bdf0 + cb00d3f commit 7c1c5dc
Show file tree
Hide file tree
Showing 206 changed files with 1,220 additions and 611 deletions.
5 changes: 4 additions & 1 deletion internal/generate/servicepackage/file.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
{{ .GoV2Package }}_sdkv2 "github.com/aws/aws-sdk-go-v2/service/{{ .GoV2Package }}"
{{- end }}
{{- end }}
"github.com/hashicorp/terraform-provider-aws/internal/conns"
"github.com/hashicorp/terraform-provider-aws/internal/types"
{{- if ne .ProviderPackage "meta" }}
"github.com/hashicorp/terraform-provider-aws/names"
Expand Down Expand Up @@ -150,4 +151,6 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) (
{{- end }}
{{- end }}

var ServicePackage = &servicePackage{}
func ServicePackage(ctx context.Context) conns.ServicePackage {
return &servicePackage{}
}
4 changes: 2 additions & 2 deletions internal/generate/servicepackages/file.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"golang.org/x/exp/slices"
)

func servicePackages(context.Context) []conns.ServicePackage {
func servicePackages(ctx context.Context) []conns.ServicePackage {
v := []conns.ServicePackage{
{{- range .Services }}
{{ .ProviderPackage }}.ServicePackage,
{{ .ProviderPackage }}.ServicePackage(ctx),
{{- end }}
}

Expand Down
Loading

0 comments on commit 7c1c5dc

Please sign in to comment.