24 lines
626 B
Go
Raw Normal View History

2020-11-30 13:27:45 +03:00
//go:generate struct-markdown
package yandexexport
import (
"fmt"
2020-12-17 13:29:25 -08:00
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
2020-11-30 13:27:45 +03:00
)
type ExchangeConfig struct {
// Service Account ID with proper permission to modify an instance, create and attach disk and
// make upload to specific Yandex Object Storage paths.
ServiceAccountID string `mapstructure:"service_account_id" required:"true"`
}
2020-12-03 12:27:13 +03:00
func (c *ExchangeConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError {
2020-11-30 13:27:45 +03:00
if c.ServiceAccountID == "" {
2020-12-03 12:27:13 +03:00
errs = packersdk.MultiErrorAppend(
2020-11-30 13:27:45 +03:00
errs, fmt.Errorf("service_account_id must be specified"))
}
return errs
}