Skip to content

Commit

Permalink
Merge pull request #35199 from showwin/f-aws_rds_integration
Browse files Browse the repository at this point in the history
New Resource aws_rds_integration
  • Loading branch information
ewbankkit committed Aug 2, 2024
2 parents 00d5f3b + 6d7e4ed commit 3ef548f
Show file tree
Hide file tree
Showing 56 changed files with 1,700 additions and 1,373 deletions.
3 changes: 3 additions & 0 deletions .changelog/35199.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_rds_integration
```
1 change: 1 addition & 0 deletions .teamcity/scripts/provider_tests/acceptance_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ TF_ACC=1 go test \
./internal/json/... \
./internal/logging/... \
./internal/maps/... \
./internal/namevaluesfilters/... \
./internal/provider/... \
./internal/retry/... \
./internal/sdkv2/... \
Expand Down
1 change: 1 addition & 0 deletions .teamcity/scripts/provider_tests/unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ go test \
./internal/json/... \
./internal/logging/... \
./internal/maps/... \
./internal/namevaluesfilters/... \
./internal/provider/... \
./internal/retry/... \
./internal/sdkv2/... \
Expand Down
12 changes: 8 additions & 4 deletions internal/generate/common/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"bytes"
"fmt"
"go/format"
"maps"
"os"
"path"
"strings"
Expand Down Expand Up @@ -58,7 +59,7 @@ type Destination interface {
CreateDirectories() error
Write() error
WriteBytes(body []byte) error
WriteTemplate(templateName, templateBody string, templateData any) error
WriteTemplate(templateName, templateBody string, templateData any, funcMaps ...template.FuncMap) error
WriteTemplateSet(templates *template.Template, templateData any) error
}

Expand Down Expand Up @@ -129,8 +130,8 @@ func (d *baseDestination) WriteBytes(body []byte) error {
return err
}

func (d *baseDestination) WriteTemplate(templateName, templateBody string, templateData any) error {
body, err := parseTemplate(templateName, templateBody, templateData)
func (d *baseDestination) WriteTemplate(templateName, templateBody string, templateData any, funcMaps ...template.FuncMap) error {
body, err := parseTemplate(templateName, templateBody, templateData, funcMaps...)

if err != nil {
return err
Expand All @@ -144,7 +145,7 @@ func (d *baseDestination) WriteTemplate(templateName, templateBody string, templ
return d.WriteBytes(body)
}

func parseTemplate(templateName, templateBody string, templateData any) ([]byte, error) {
func parseTemplate(templateName, templateBody string, templateData any, funcMaps ...template.FuncMap) ([]byte, error) {
funcMap := template.FuncMap{
// FirstUpper returns a string with the first character as upper case.
"FirstUpper": func(s string) string {
Expand All @@ -157,6 +158,9 @@ func parseTemplate(templateName, templateBody string, templateData any) ([]byte,
// Title returns a string with the first character of each word as upper case.
"Title": cases.Title(language.Und, cases.NoLower).String,
}
for _, v := range funcMaps {
maps.Copy(funcMap, v) // Extras overwrite defaults.
}
tmpl, err := template.New(templateName).Funcs(funcMap).Parse(templateBody)

if err != nil {
Expand Down
24 changes: 0 additions & 24 deletions internal/generate/namevaluesfilters/README.md

This file was deleted.

This file was deleted.

128 changes: 0 additions & 128 deletions internal/generate/namevaluesfilters/generators/servicefilters/main.go

This file was deleted.

Loading

0 comments on commit 3ef548f

Please sign in to comment.