Documentation ¶
Index ¶
Constants ¶
const Account registry.Scope = "account"
Account is the resource scope that all resources in AWS Nuke are registered against.
Variables ¶
var MutateOpts = func(opts interface{}, resourceType string) interface{} { o := opts.(*ListerOpts) session, err := o.Region.Session(resourceType) if err != nil { panic(err) } o.Session = session if o.Logger != nil { o.Logger = o.Logger.WithField("resource", resourceType) } else { o.Logger = logrus.WithField("resource", resourceType) } return o }
MutateOpts is a function that will be called for each resource type to mutate the options for the scanner based on whatever criteria you want. However, in this case for the aws-nuke tool, it's mutating the opts to create the proper session for the proper region for the resourceType. For example IAM only happens in the global region, not us-east-2.
Functions ¶
This section is empty.
Types ¶
type ListerOpts ¶
type ListerOpts struct { Region *Region Session *session.Session AccountID *string Logger *logrus.Entry }
ListerOpts are the options for the Lister functions of each individual resource. It is passed in as an interface{} so that each implementing tool can define their own options for the lister. Each resource then asserts the type on the interface{} to get the options it needs.
type Prompt ¶
type Prompt struct { Parameters *libnuke.Parameters Account *awsutil.Account }
Prompt struct provides a way to provide a custom prompt to the libnuke library this allows custom data to be available to the Prompt func when it's executed by the libnuke library
type Region ¶
type Region struct { Name string NewSession SessionFactory ResTypeResolver ResourceTypeResolver // contains filtered or unexported fields }
Region is an AWS Region with an attached SessionFactory
func NewRegion ¶
func NewRegion(name string, typeResolver ResourceTypeResolver, sessionFactory SessionFactory) *Region
NewRegion creates a new Region and returns it.
type ResourceTypeResolver ¶
ResourceTypeResolver returns the service type from the resourceType