config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DisableDeletionProtection

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

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
const (
	FilterTypeEmpty         FilterType = ""
	FilterTypeExact         FilterType = "exact"
	FilterTypeGlob          FilterType = "glob"
	FilterTypeRegex         FilterType = "regex"
	FilterTypeContains      FilterType = "contains"
	FilterTypeDateOlderThan FilterType = "dateOlderThan"
	FilterTypeSuffix        FilterType = "suffix"
	FilterTypePrefix        FilterType = "prefix"
)

type Filters

type Filters map[string][]Filter

func (Filters) Merge

func (f Filters) Merge(f2 Filters)

type Nuke

type Nuke struct {
	Tenants         map[string]Tenant            `yaml:"tenants"`
	TenantBlocklist []string                     `yaml:"tenant-blocklist"`
	ResourceTypes   ResourceTypes                `yaml:"resource-types"`
	FeatureFlags    FeatureFlags                 `yaml:"feature-flags"`
	Presets         map[string]PresetDefinitions `yaml:"presets"`
}

func Load

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

func (*Nuke) Filters

func (c *Nuke) Filters(tenantId 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) ValidateTenant

func (c *Nuke) ValidateTenant(tenantId string) 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"`
}

type Tenant

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

Jump to

Keyboard shortcuts

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