resources

package
v0.0.0-...-97238d6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Non-regional AWS resource types, in dependency order

AWS resource types known to this script, in dependency order.

Functions

This section is empty.

Types

type Addresses

type Addresses struct{}

func (Addresses) MarkAndSweep

func (Addresses) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type AutoScalingGroups

type AutoScalingGroups struct{}

func (AutoScalingGroups) MarkAndSweep

func (AutoScalingGroups) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type DHCPOptions

type DHCPOptions struct{}

DHCPOptions: http://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#EC2.DescribeDhcpOptions

func (DHCPOptions) MarkAndSweep

func (DHCPOptions) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type IAMInstanceProfiles

type IAMInstanceProfiles struct{}

IAM Instance Profiles

func (IAMInstanceProfiles) MarkAndSweep

func (IAMInstanceProfiles) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type IAMRoles

type IAMRoles struct{}

func (IAMRoles) MarkAndSweep

func (IAMRoles) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type Instances

type Instances struct{}

func (Instances) MarkAndSweep

func (Instances) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type Interface

type Interface interface {
	// ARN returns the AWS ARN for the resource
	// (c.f. http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). This
	// is only used for uniqueness in the Mark set, but ARNs are
	// intended to be globally unique across regions and accounts, so
	// that works.
	ARN() string

	// ResourceKey() returns a per-resource key, because ARNs might conflict if two objects
	// with the same name are created at different times (e.g. IAM roles)
	ResourceKey() string
}

type InternetGateways

type InternetGateways struct{}

func (InternetGateways) MarkAndSweep

func (InternetGateways) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type LaunchConfigurations

type LaunchConfigurations struct{}

LaunchConfigurations: http://docs.aws.amazon.com/sdk-for-go/api/service/autoscaling/#AutoScaling.DescribeLaunchConfigurations

func (LaunchConfigurations) MarkAndSweep

func (LaunchConfigurations) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type LoadBalancers

type LoadBalancers struct{}

func (LoadBalancers) MarkAndSweep

func (LoadBalancers) MarkAndSweep(sess *session.Session, account string, region string, set *Set) error

type Route53ResourceRecordSets

type Route53ResourceRecordSets struct{}

func (Route53ResourceRecordSets) MarkAndSweep

func (Route53ResourceRecordSets) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type RouteTables

type RouteTables struct{}

func (RouteTables) MarkAndSweep

func (RouteTables) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type SecurityGroups

type SecurityGroups struct{}

SecurityGroups: http://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#EC2.DescribeSecurityGroups

func (SecurityGroups) MarkAndSweep

func (SecurityGroups) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type Set

type Set struct {
	// contains filtered or unexported fields
}

Set keeps track of the first time we saw a particular ARN, and the global TTL. See Mark() for more details.

func LoadSet

func LoadSet(sess *session.Session, p *s3path.Path, ttl time.Duration) (*Set, error)

func (*Set) Mark

func (s *Set) Mark(r Interface) bool

Mark marks a particular resource as currently present, and advises on whether it should be deleted. If Mark(r) returns true, the TTL has expired for r and it should be deleted.

func (*Set) MarkComplete

func (s *Set) MarkComplete() int

MarkComplete figures out which ARNs were in previous passes but not this one, and eliminates them. It should only be run after all resources have been marked.

func (*Set) Save

func (s *Set) Save(sess *session.Session, p *s3path.Path) error

type Subnets

type Subnets struct{}

Subnets: http://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#EC2.DescribeSubnets

func (Subnets) MarkAndSweep

func (Subnets) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type Type

type Type interface {
	// MarkAndSweep queries the resource in a specific region, using
	// the provided session (which has account-number acct), calling
	// res.Mark(<resource>) on each resource and deleting
	// appropriately.
	MarkAndSweep(sess *session.Session, acct string, region string, res *Set) error
}

type VPCs

type VPCs struct{}

func (VPCs) MarkAndSweep

func (VPCs) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

type Volumes

type Volumes struct{}

Volumes: http://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#EC2.DescribeVolumes

func (Volumes) MarkAndSweep

func (Volumes) MarkAndSweep(sess *session.Session, acct string, region string, set *Set) error

Jump to

Keyboard shortcuts

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