config

package
v3.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilterTypeEmpty         FilterType = ""
	FilterTypeExact                    = "exact"
	FilterTypeGlob                     = "glob"
	FilterTypeRegex                    = "regex"
	FilterTypeContains                 = "contains"
	FilterTypeDateOlderThan            = "dateOlderThan"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Filters       Filters       `yaml:"filters"`
	ResourceTypes ResourceTypes `yaml:"resource-types"`
	Presets       []string      `yaml:"presets"`
}

type CustomEndpoints

type CustomEndpoints []*CustomRegion

func (CustomEndpoints) GetRegion

func (endpoints CustomEndpoints) GetRegion(region string) *CustomRegion

GetRegion returns the custom region or nil when no such custom endpoints are defined for this region

func (CustomEndpoints) GetURL

func (endpoints CustomEndpoints) GetURL(region, serviceType string) string

type CustomRegion

type CustomRegion struct {
	Region                string         `yaml:"region"`
	Services              CustomServices `yaml:"services"`
	TLSInsecureSkipVerify bool           `yaml:"tls_insecure_skip_verify"`
}

type CustomService

type CustomService struct {
	Service               string `yaml:"service"`
	URL                   string `yaml:"url"`
	TLSInsecureSkipVerify bool   `yaml:"tls_insecure_skip_verify"`
}

type CustomServices

type CustomServices []*CustomService

func (CustomServices) GetService

func (services CustomServices) GetService(serviceType string) *CustomService

GetService returns the custom region or nil when no such custom endpoints are defined for this region

type DisableDeletionProtection

type DisableDeletionProtection struct {
	RDSInstance         bool `yaml:"RDSInstance"`
	EC2Instance         bool `yaml:"EC2Instance"`
	CloudformationStack bool `yaml:"CloudformationStack"`
	ELBv2               bool `yaml:"ELBv2"`
}

type FeatureFlags

type FeatureFlags struct {
	DisableDeletionProtection  DisableDeletionProtection `yaml:"disable-deletion-protection"`
	ForceDeleteLightsailAddOns bool                      `yaml:"force-delete-lightsail-addons"`
}

type Filter

type Filter struct {
	Property string
	Type     FilterType
	Value    string
	Invert   string
}

func NewExactFilter

func NewExactFilter(value string) Filter

func (Filter) Match

func (f Filter) Match(o string) (bool, error)

func (*Filter) UnmarshalYAML

func (f *Filter) UnmarshalYAML(unmarshal func(interface{}) error) error

type FilterType

type FilterType string

type Filters

type Filters map[string][]Filter

func (Filters) Merge

func (f Filters) Merge(f2 Filters)

type Nuke

type Nuke struct {
	// Deprecated: Use AccountBlocklist instead.
	AccountBlacklist []string                     `yaml:"account-blacklist"`
	AccountBlocklist []string                     `yaml:"account-blocklist"`
	Regions          []string                     `yaml:"regions"`
	Accounts         map[string]Account           `yaml:"accounts"`
	ResourceTypes    ResourceTypes                `yaml:"resource-types"`
	Presets          map[string]PresetDefinitions `yaml:"presets"`
	FeatureFlags     FeatureFlags                 `yaml:"feature-flags"`
	CustomEndpoints  CustomEndpoints              `yaml:"endpoints"`
}

func Load

func Load(path string) (*Nuke, error)

func (*Nuke) Filters

func (c *Nuke) Filters(accountID string) (Filters, error)

func (*Nuke) HasBlocklist

func (c *Nuke) HasBlocklist() bool

func (*Nuke) InBlocklist

func (c *Nuke) InBlocklist(searchID string) bool

func (*Nuke) ResolveBlocklist

func (c *Nuke) ResolveBlocklist() []string

func (*Nuke) ValidateAccount

func (c *Nuke) ValidateAccount(accountID string, aliases []string, requireAlias bool) error

type PresetDefinitions

type PresetDefinitions struct {
	Filters Filters `yaml:"filters"`
}

type ResourceTypes

type ResourceTypes struct {
	Targets      types.Collection `yaml:"targets"`
	Excludes     types.Collection `yaml:"excludes"`
	CloudControl types.Collection `yaml:"cloud-control"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL