|
|
|
|
@ -18,11 +18,19 @@ import (
|
|
|
|
|
var reShutdownBehavior = regexp.MustCompile("^(stop|terminate)$")
|
|
|
|
|
|
|
|
|
|
type AmiFilterOptions struct {
|
|
|
|
|
Filters map[*string]*string
|
|
|
|
|
Owners []*string
|
|
|
|
|
Filters map[string]string
|
|
|
|
|
Owners []string
|
|
|
|
|
MostRecent bool `mapstructure:"most_recent"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (d *AmiFilterOptions) GetOwners() []*string {
|
|
|
|
|
res := make([]*string, 0, len(d.Owners))
|
|
|
|
|
for _, owner := range d.Owners {
|
|
|
|
|
res = append(res, &owner)
|
|
|
|
|
}
|
|
|
|
|
return res
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (d *AmiFilterOptions) Empty() bool {
|
|
|
|
|
return len(d.Owners) == 0 && len(d.Filters) == 0
|
|
|
|
|
}
|
|
|
|
|
@ -32,7 +40,7 @@ func (d *AmiFilterOptions) NoOwner() bool {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SubnetFilterOptions struct {
|
|
|
|
|
Filters map[*string]*string
|
|
|
|
|
Filters map[string]string
|
|
|
|
|
MostFree bool `mapstructure:"most_free"`
|
|
|
|
|
Random bool `mapstructure:"random"`
|
|
|
|
|
}
|
|
|
|
|
@ -42,7 +50,7 @@ func (d *SubnetFilterOptions) Empty() bool {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type VpcFilterOptions struct {
|
|
|
|
|
Filters map[*string]*string
|
|
|
|
|
Filters map[string]string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (d *VpcFilterOptions) Empty() bool {
|
|
|
|
|
@ -50,7 +58,7 @@ func (d *VpcFilterOptions) Empty() bool {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SecurityGroupFilterOptions struct {
|
|
|
|
|
Filters map[*string]*string
|
|
|
|
|
Filters map[string]string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (d *SecurityGroupFilterOptions) Empty() bool {
|
|
|
|
|
|