Adrien Delorme 87ba7258b3
Use packer-sdc in packer + remove mapstructure-to-hcl2 & struct-markdown (#10913)
* start using `go:generate packer-sdc struct-markdown`

* Update Makefile

remove @go install ./cmd/struct-markdown

* run go generate for struct-markdown

* use //go:generate packer-sdc mapstructure-to-hcl2

* run go generate for mapstructure-to-hcl2

* remove struct-markdown and mapstructure-to-hcl2

* vendor vendors
2021-04-16 11:52:03 +02:00

24 lines
637 B
Go

//go:generate packer-sdc struct-markdown
package yandexexport
import (
"fmt"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
)
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"`
}
func (c *ExchangeConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError {
if c.ServiceAccountID == "" {
errs = packersdk.MultiErrorAppend(
errs, fmt.Errorf("service_account_id must be specified"))
}
return errs
}