Implement new stackit_image resource and datasource (#609)
* feat: Implement image resource and datasource * feat: Add remaining config options * feat: Make protected field only computed * feat: Update dependency to use IaaS beta API * fix: Minor fix in acc test --------- Co-authored-by: Vicente Pinto <vicente.pinto@freiheit.com>
This commit is contained in:
parent
7fcebacb21
commit
700bdc90d0
15 changed files with 2212 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -272,3 +273,21 @@ func Rrule() *Validator {
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
func FileExists() *Validator {
|
||||
description := "file must exist"
|
||||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(_ context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
_, err := os.Stat(req.ConfigValue.ValueString())
|
||||
if err != nil {
|
||||
resp.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic(
|
||||
req.Path,
|
||||
description,
|
||||
req.ConfigValue.ValueString(),
|
||||
))
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue