|
|
|
|
@ -73,9 +73,12 @@ func (c *AMIConfig) Prepare(ctx *interpolate.Context) []error {
|
|
|
|
|
errs = append(errs, fmt.Errorf("AMIName must be between 3 and 128 characters long"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
amiNameRe := regexp.MustCompile(`^[a-zA-Z().\-/_]+$`)
|
|
|
|
|
amiNameRe := regexp.MustCompile(`^[0-9a-zA-Z().\-/_]+$`)
|
|
|
|
|
if !amiNameRe.MatchString(c.AMIName) {
|
|
|
|
|
errs = append(errs, fmt.Errorf("AMIName should only contain letters, numbers, '(', ')', '.', '-', '/' and '_'"))
|
|
|
|
|
errs = append(errs, fmt.Errorf("AMIName should only contain letters,"+
|
|
|
|
|
" numbers, '(', ')', '.', '-', '/' and '_'. You can use the "+
|
|
|
|
|
"`clean_ami_name` template filter to automatically clean your ami "+
|
|
|
|
|
"name."))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(errs) > 0 {
|
|
|
|
|
|