mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-20 11:48:24 -06:00
Allows the user to specify the log format version when setting up `s3logging` on the fastly service resource. Requires an update to the vendored `go-fastly` dependency. Also adds an additional acceptance test for the new attribute. ``` $ make testacc TEST=./builtin/providers/fastly TESTARGS='-run=TestAccFastlyServiceV1_s3logging' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/02/06 14:51:55 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/fastly -v -run=TestAccFastlyServiceV1_s3logging -timeout 120m === RUN TestAccFastlyServiceV1_s3logging_basic --- PASS: TestAccFastlyServiceV1_s3logging_basic (36.11s) === RUN TestAccFastlyServiceV1_s3logging_s3_env --- PASS: TestAccFastlyServiceV1_s3logging_s3_env (15.35s) === RUN TestAccFastlyServiceV1_s3logging_formatVersion --- PASS: TestAccFastlyServiceV1_s3logging_formatVersion (15.71s) PASS ok github.com/hashicorp/terraform/builtin/providers/fastly 67.186s ```
18 lines
330 B
Go
18 lines
330 B
Go
package fastly
|
|
|
|
import "fmt"
|
|
|
|
func validateS3FormatVersion(v interface{}, k string) (ws []string, errors []error) {
|
|
value := uint(v.(int))
|
|
validVersions := map[uint]struct{}{
|
|
1: {},
|
|
2: {},
|
|
}
|
|
|
|
if _, ok := validVersions[value]; !ok {
|
|
errors = append(errors, fmt.Errorf(
|
|
"%q must be one of ['1', '2']", k))
|
|
}
|
|
return
|
|
}
|