You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/api/hosts/awsec2_host_catalog.gen.go

41 lines
1.0 KiB

// Code generated by "make api"; DO NOT EDIT.
package hosts
import (
"fmt"
"github.com/mitchellh/mapstructure"
)
type AwsEc2HostCatalog struct {
*HostCatalog
// The AWS regions from which this catalog will retrieve the EC2 instances.
Regions []string `json:"regions,omitempty"`
// The access key used for authenticating with AWS when retrieving EC2 instance details.
AccessKey *string `json:"access_key,omitempty"`
// Input only.
SecretKey *string `json:"secret_key,omitempty"`
// This value will never be returned in a response.
Rotate *bool `json:"rotate,omitempty"`
}
func (s HostCatalog) AsAwsEc2HostCatalog() (*AwsEc2HostCatalog, error) {
out := &AwsEc2HostCatalog{
HostCatalog: &s,
}
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
Result: out,
TagName: "json",
})
if err != nil {
return nil, fmt.Errorf("error creating map decoder: %w", err)
}
if err := decoder.Decode(s.Attributes); err != nil {
return nil, fmt.Errorf("error decoding attributes map: %w", err)
}
return out, nil
}