Extend Redis and RabbitMQ instance parameters (#431)

* Extend RabbitMQ instance parameters (#409)

* Extend Schema

* initial parameter integration in resource

* datasource, resource and acceptance testing

* add docs, fix map fields edge case

* improve testing

* rename tls_protocols to singular

* revert renaming

* Extend Redis instance parameters (#410)

* Extend Schema

* initial parameter integration in resource

* datasource, resource and acceptance testing

* add docs, fix map fields edge case

* improve testing

* rename tls_protocols to singular

* revert renaming

* initial schema

* resource and datasource

* acceptance testing

* fix linting and testing, generate docs

* improve acceptance testing

---------

Co-authored-by: Diogo Ferrão <diogo.ferrao@freiheit.com>
This commit is contained in:
João Palet 2024-06-25 16:03:59 +01:00 committed by GitHub
parent 923764172d
commit 9f82c3262b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1009 additions and 244 deletions

View file

@ -87,3 +87,22 @@ func BoolValueToPointer(s basetypes.BoolValue) *bool {
value := s.ValueBool()
return &value
}
// StringListToPointer converts basetypes.ListValue to a pointer to a list of strings.
// It returns nil if the value is null or unknown.
func StringListToPointer(list basetypes.ListValue) (*[]string, error) {
if list.IsNull() || list.IsUnknown() {
return nil, nil
}
listStr := []string{}
for i, el := range list.Elements() {
elStr, ok := el.(types.String)
if !ok {
return nil, fmt.Errorf("element %d is not a string", i)
}
listStr = append(listStr, elStr.ValueString())
}
return &listStr, nil
}