deleter

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2017 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcChunk

func CalcChunk(curr, size, chunk int) int

CalcChunk calculates the ending index of a slice

func InitRequestLogger

func InitRequestLogger(path string) logrus.FieldLogger

InitRequestLogger creates a logrus.FieldLogger that logs to a file at path, or os.Stderr if an error occurs opening the file

func PrintLogFileReport

func PrintLogFileReport(reader io.Reader, lff LogFormatFunc)

PrintLogFileReport prints LogEntry structs with format determined by lff

func SplitHostedZoneID

func SplitHostedZoneID(hzID string) arn.ResourceName

SplitHostedZoneID splits a hosted zones' AWS ID, which might be prefixed with "/hostedzone/", into the actual ID (the suffix)

Types

type AutoScalingGroupDeleter

type AutoScalingGroupDeleter struct {
	Client        autoscalingiface.AutoScalingAPI
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

AutoScalingGroupDeleter represents an AWS autoscaling group

func (*AutoScalingGroupDeleter) AddResourceNames

func (rd *AutoScalingGroupDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds autoscaling group names to ResourceNames

func (*AutoScalingGroupDeleter) DeleteResources

func (rd *AutoScalingGroupDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes autoscaling groups from AWS

func (*AutoScalingGroupDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*AutoScalingGroupDeleter) RequestAutoScalingGroups

func (rd *AutoScalingGroupDeleter) RequestAutoScalingGroups() ([]*autoscaling.Group, error)

RequestAutoScalingGroups requests autoscaling groups from the AWS API and returns autoscaling groups by names

func (*AutoScalingGroupDeleter) String

func (rd *AutoScalingGroupDeleter) String() string

type AutoScalingLaunchConfigurationDeleter

type AutoScalingLaunchConfigurationDeleter struct {
	Client        autoscalingiface.AutoScalingAPI
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

AutoScalingLaunchConfigurationDeleter represents an AWS launch configuration

func (*AutoScalingLaunchConfigurationDeleter) AddResourceNames

func (rd *AutoScalingLaunchConfigurationDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds launch configuration names to ResourceNames

func (*AutoScalingLaunchConfigurationDeleter) DeleteResources

func (rd *AutoScalingLaunchConfigurationDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes a launch configurations from AWS

func (*AutoScalingLaunchConfigurationDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*AutoScalingLaunchConfigurationDeleter) RequestAutoScalingLaunchConfigurations

func (rd *AutoScalingLaunchConfigurationDeleter) RequestAutoScalingLaunchConfigurations() ([]*autoscaling.LaunchConfiguration, error)

RequestAutoScalingLaunchConfigurations requests resources from the AWS API and returns launch configurations by names

func (*AutoScalingLaunchConfigurationDeleter) RequestIAMInstanceProfilesFromLaunchConfigurations

func (rd *AutoScalingLaunchConfigurationDeleter) RequestIAMInstanceProfilesFromLaunchConfigurations() ([]*iam.InstanceProfile, error)

RequestIAMInstanceProfilesFromLaunchConfigurations retrieves instance profiles from launch configuration names

func (*AutoScalingLaunchConfigurationDeleter) String

type DeleteConfig

type DeleteConfig struct {
	DryRun       bool
	IgnoreErrors bool
	Logger       logrus.FieldLogger
}

DeleteConfig holds configuration info for resource deletion

type EC2Client

type EC2Client struct {
	ec2iface.EC2API
}

EC2Client aliases an EC2API so requestEC2* functions can be shared between RequestEC2* functions

type EC2CustomerGatewayDeleter

type EC2CustomerGatewayDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2CustomerGatewayDeleter represents a collection of AWS EC2 customer gateways

func (*EC2CustomerGatewayDeleter) AddResourceNames

func (rd *EC2CustomerGatewayDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 customer gateway names to ResourceNames

func (*EC2CustomerGatewayDeleter) DeleteResources

func (rd *EC2CustomerGatewayDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes customer gateways from AWS

func (*EC2CustomerGatewayDeleter) GetClient

func (rd *EC2CustomerGatewayDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2CustomerGatewayDeleter) RequestEC2CustomerGateways

func (rd *EC2CustomerGatewayDeleter) RequestEC2CustomerGateways() ([]*ec2.CustomerGateway, error)

RequestEC2CustomerGateways requests EC2 customer gateways by names from the AWS API

func (*EC2CustomerGatewayDeleter) String

func (rd *EC2CustomerGatewayDeleter) String() string

type EC2ElasticIPAllocationDeleter

type EC2ElasticIPAllocationDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2ElasticIPAllocationDeleter represents a collection of AWS EC2 elastic IP allocations

func (*EC2ElasticIPAllocationDeleter) AddResourceNames

func (rd *EC2ElasticIPAllocationDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 elastic IP allocation names to ResourceNames

func (*EC2ElasticIPAllocationDeleter) DeleteResources

func (rd *EC2ElasticIPAllocationDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes elastic IP allocations from AWS

func (*EC2ElasticIPAllocationDeleter) GetClient

func (rd *EC2ElasticIPAllocationDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2ElasticIPAllocationDeleter) String

type EC2ElasticIPAssocationDeleter

type EC2ElasticIPAssocationDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2ElasticIPAssocationDeleter represents a collection of AWS EC2 elastic IP associations

func (*EC2ElasticIPAssocationDeleter) AddResourceNames

func (rd *EC2ElasticIPAssocationDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 elastic IP association names to ResourceNames

func (*EC2ElasticIPAssocationDeleter) DeleteResources

func (rd *EC2ElasticIPAssocationDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes elastic IP associations from AWS

func (*EC2ElasticIPAssocationDeleter) GetClient

func (rd *EC2ElasticIPAssocationDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2ElasticIPAssocationDeleter) String

type EC2InstanceDeleter

type EC2InstanceDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2InstanceDeleter represents a collection of AWS EC2 instances

func (*EC2InstanceDeleter) AddResourceNames

func (rd *EC2InstanceDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 instance names to ResourceNames

func (*EC2InstanceDeleter) DeleteResources

func (rd *EC2InstanceDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 instances from AWS

func (*EC2InstanceDeleter) GetClient

func (rd *EC2InstanceDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2InstanceDeleter) RequestEC2Instances

func (rd *EC2InstanceDeleter) RequestEC2Instances() ([]*ec2.Instance, error)

RequestEC2Instances requests EC2 instances by instance names from the AWS API

func (*EC2InstanceDeleter) RequestIAMInstanceProfilesFromInstances

func (rd *EC2InstanceDeleter) RequestIAMInstanceProfilesFromInstances() ([]*iam.InstanceProfile, error)

RequestIAMInstanceProfilesFromInstances retrieves instance profiles from instance ID's

func (*EC2InstanceDeleter) String

func (rd *EC2InstanceDeleter) String() string

type EC2InternetGatewayAttachmentDeleter

type EC2InternetGatewayAttachmentDeleter struct {
	Client              EC2Client
	ResourceType        arn.ResourceType
	InternetGatewayName arn.ResourceName
	AttachmentNames     arn.ResourceNames
}

EC2InternetGatewayAttachmentDeleter represents a collection of AWS EC2 internet gateway attachments

func (*EC2InternetGatewayAttachmentDeleter) AddResourceNames

func (rd *EC2InternetGatewayAttachmentDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 internet gateway attachment names to AttachmentNames

func (*EC2InternetGatewayAttachmentDeleter) DeleteResources

func (rd *EC2InternetGatewayAttachmentDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 internet gateway attachments from AWS

func (*EC2InternetGatewayAttachmentDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2InternetGatewayAttachmentDeleter) String

type EC2InternetGatewayDeleter

type EC2InternetGatewayDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2InternetGatewayDeleter represents a collection of AWS EC2 internet gateways

func (*EC2InternetGatewayDeleter) AddResourceNames

func (rd *EC2InternetGatewayDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 internet gateway names to ResourceNames

func (*EC2InternetGatewayDeleter) DeleteResources

func (rd *EC2InternetGatewayDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 internet gateways from AWS NOTE: must detach all internet gateways from vpc's before deletion

func (*EC2InternetGatewayDeleter) GetClient

func (rd *EC2InternetGatewayDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2InternetGatewayDeleter) RequestEC2InternetGateways

func (rd *EC2InternetGatewayDeleter) RequestEC2InternetGateways() ([]*ec2.InternetGateway, error)

RequestEC2InternetGateways requests EC2 internet gateways by name from the AWS API

func (*EC2InternetGatewayDeleter) String

func (rd *EC2InternetGatewayDeleter) String() string

type EC2NatGatewayDeleter

type EC2NatGatewayDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2NatGatewayDeleter represents a collection of AWS EC2 NAT gateways

func (*EC2NatGatewayDeleter) AddResourceNames

func (rd *EC2NatGatewayDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 NAT gateway names to ResourceNames

func (*EC2NatGatewayDeleter) DeleteResources

func (rd *EC2NatGatewayDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 NAT gateways from AWS

func (*EC2NatGatewayDeleter) GetClient

func (rd *EC2NatGatewayDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2NatGatewayDeleter) RequestEC2NatGateways

func (rd *EC2NatGatewayDeleter) RequestEC2NatGateways() ([]*ec2.NatGateway, error)

RequestEC2NatGateways requests EC2 nat gateways by name from the AWS API

func (*EC2NatGatewayDeleter) String

func (rd *EC2NatGatewayDeleter) String() string

type EC2NetworkACLDeleter

type EC2NetworkACLDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2NetworkACLDeleter represents a collection of AWS EC2 network acl's

func (*EC2NetworkACLDeleter) AddResourceNames

func (rd *EC2NetworkACLDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 network acl names to ResourceNames

func (*EC2NetworkACLDeleter) DeleteResources

func (rd *EC2NetworkACLDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 network acl's from AWS

func (*EC2NetworkACLDeleter) GetClient

func (rd *EC2NetworkACLDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2NetworkACLDeleter) RequestEC2NetworkACLs

func (rd *EC2NetworkACLDeleter) RequestEC2NetworkACLs() ([]*ec2.NetworkAcl, error)

RequestEC2NetworkACLs retrieves network acl's by network acl ID

func (*EC2NetworkACLDeleter) String

func (rd *EC2NetworkACLDeleter) String() string

type EC2NetworkACLEntryDeleter

type EC2NetworkACLEntryDeleter struct {
	Client            EC2Client
	ResourceType      arn.ResourceType
	NetworkACLName    arn.ResourceName
	NetworkACLEntries []*ec2.NetworkAclEntry
}

EC2NetworkACLEntryDeleter represents a collection of AWS EC2 network acl entries

func (*EC2NetworkACLEntryDeleter) DeleteResources

func (rd *EC2NetworkACLEntryDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 network acl entries from AWS

func (*EC2NetworkACLEntryDeleter) GetClient

func (rd *EC2NetworkACLEntryDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2NetworkACLEntryDeleter) String

func (rd *EC2NetworkACLEntryDeleter) String() string

type EC2NetworkInterfaceAttachmentDeleter

type EC2NetworkInterfaceAttachmentDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2NetworkInterfaceAttachmentDeleter represents a collection of AWS EC2 network interface attachments

func (*EC2NetworkInterfaceAttachmentDeleter) AddResourceNames

func (rd *EC2NetworkInterfaceAttachmentDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 network interface attachment names to ResourceNames

func (*EC2NetworkInterfaceAttachmentDeleter) DeleteResources

func (rd *EC2NetworkInterfaceAttachmentDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 network interface attachments from AWS

func (*EC2NetworkInterfaceAttachmentDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2NetworkInterfaceAttachmentDeleter) String

type EC2NetworkInterfaceDeleter

type EC2NetworkInterfaceDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2NetworkInterfaceDeleter represents a collection of AWS EC2 network interfaces

func (*EC2NetworkInterfaceDeleter) AddResourceNames

func (rd *EC2NetworkInterfaceDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 network interface names to ResourceNames

func (*EC2NetworkInterfaceDeleter) DeleteResources

func (rd *EC2NetworkInterfaceDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 network interfaces from AWS

func (*EC2NetworkInterfaceDeleter) GetClient

func (rd *EC2NetworkInterfaceDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2NetworkInterfaceDeleter) RequestEC2EIPAddressessFromNetworkInterfaces

func (rd *EC2NetworkInterfaceDeleter) RequestEC2EIPAddressessFromNetworkInterfaces() ([]*ec2.Address, error)

RequestEC2EIPAddressessFromNetworkInterfaces requests EC2 elastic IP addresses by network interface names from the AWS API

func (*EC2NetworkInterfaceDeleter) RequestEC2NetworkInterfaces

func (rd *EC2NetworkInterfaceDeleter) RequestEC2NetworkInterfaces() ([]*ec2.NetworkInterface, error)

RequestEC2NetworkInterfaces requests EC2 network interfaces by name from the AWS API

func (*EC2NetworkInterfaceDeleter) String

func (rd *EC2NetworkInterfaceDeleter) String() string

type EC2RouteTableAssociationDeleter

type EC2RouteTableAssociationDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2RouteTableAssociationDeleter represents a collection of AWS EC2 route table associations

func (*EC2RouteTableAssociationDeleter) AddResourceNames

func (rd *EC2RouteTableAssociationDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 route table association names to ResourceNames

func (*EC2RouteTableAssociationDeleter) DeleteResources

func (rd *EC2RouteTableAssociationDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 route table associations from AWS

func (*EC2RouteTableAssociationDeleter) GetClient

func (rd *EC2RouteTableAssociationDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2RouteTableAssociationDeleter) String

type EC2RouteTableDeleter

type EC2RouteTableDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2RouteTableDeleter represents a collection of AWS EC2 route tables

func (*EC2RouteTableDeleter) AddResourceNames

func (rd *EC2RouteTableDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 route table names to ResourceNames

func (*EC2RouteTableDeleter) DeleteResources

func (rd *EC2RouteTableDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 route tables from AWS NOTE: can only delete a route table once all subnets have been disassociated, and and all routes have been deleted. Cannot delete the main (default) route table

func (*EC2RouteTableDeleter) GetClient

func (rd *EC2RouteTableDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2RouteTableDeleter) RequestEC2RouteTables

func (rd *EC2RouteTableDeleter) RequestEC2RouteTables() ([]*ec2.RouteTable, error)

RequestEC2RouteTables requests route tables by name from the AWS API

func (*EC2RouteTableDeleter) String

func (rd *EC2RouteTableDeleter) String() string

type EC2RouteTableRouteDeleter

type EC2RouteTableRouteDeleter struct {
	Client       EC2Client
	ResourceType arn.ResourceType
	RouteTable   *ec2.RouteTable
}

EC2RouteTableRouteDeleter represents a collection of AWS EC2 route table routes

func (*EC2RouteTableRouteDeleter) DeleteResources

func (rd *EC2RouteTableRouteDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 route table routes from AWS

func (*EC2RouteTableRouteDeleter) GetClient

func (rd *EC2RouteTableRouteDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2RouteTableRouteDeleter) String

func (rd *EC2RouteTableRouteDeleter) String() string

type EC2SecurityGroupDeleter

type EC2SecurityGroupDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2SecurityGroupDeleter represents a collection of AWS EC2 security groups

func (*EC2SecurityGroupDeleter) AddResourceNames

func (rd *EC2SecurityGroupDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 security group names to ResourceNames

func (*EC2SecurityGroupDeleter) DeleteResources

func (rd *EC2SecurityGroupDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 security groups from AWS NOTE: all security group references must be removed before deleting before deleting a security group

func (*EC2SecurityGroupDeleter) GetClient

func (rd *EC2SecurityGroupDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2SecurityGroupDeleter) RequestEC2SecurityGroups

func (rd *EC2SecurityGroupDeleter) RequestEC2SecurityGroups() ([]*ec2.SecurityGroup, error)

RequestEC2SecurityGroups requests EC2 security groups by name from the AWS API

func (*EC2SecurityGroupDeleter) String

func (rd *EC2SecurityGroupDeleter) String() string

type EC2SecurityGroupEgressRuleDeleter

type EC2SecurityGroupEgressRuleDeleter struct {
	Client         EC2Client
	ResourceType   arn.ResourceType
	SecurityGroups []*ec2.SecurityGroup
}

EC2SecurityGroupEgressRuleDeleter represents a collection of AWS EC2 security group egress rules

func (*EC2SecurityGroupEgressRuleDeleter) DeleteResources

func (rd *EC2SecurityGroupEgressRuleDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 security group egress rules from AWS

func (*EC2SecurityGroupEgressRuleDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2SecurityGroupEgressRuleDeleter) String

type EC2SecurityGroupIngressRuleDeleter

type EC2SecurityGroupIngressRuleDeleter struct {
	Client         EC2Client
	ResourceType   arn.ResourceType
	SecurityGroups []*ec2.SecurityGroup
}

EC2SecurityGroupIngressRuleDeleter represents a collection of AWS EC2 security group ingress rules

func (*EC2SecurityGroupIngressRuleDeleter) DeleteResources

func (rd *EC2SecurityGroupIngressRuleDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 security group ingress rules from AWS NOTE: all security group ingress references must be removed before deleting before deleting a security group ingress

func (*EC2SecurityGroupIngressRuleDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2SecurityGroupIngressRuleDeleter) String

type EC2SubnetDeleter

type EC2SubnetDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2SubnetDeleter represents a collection of AWS EC2 subnets

func (*EC2SubnetDeleter) AddResourceNames

func (rd *EC2SubnetDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 subnet names to ResourceNames

func (*EC2SubnetDeleter) DeleteResources

func (rd *EC2SubnetDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 subnets from AWS NOTE: ensure all network interfaces and network acl's are disassociated

func (*EC2SubnetDeleter) GetClient

func (rd *EC2SubnetDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2SubnetDeleter) RequestEC2Subnets

func (rd *EC2SubnetDeleter) RequestEC2Subnets() ([]*ec2.Subnet, error)

RequestEC2Subnets requests EC2 subnets by subnet name from the AWS API

func (*EC2SubnetDeleter) String

func (rd *EC2SubnetDeleter) String() string

type EC2VPCCIDRBlockAssociationDeleter

type EC2VPCCIDRBlockAssociationDeleter struct {
	Client              EC2Client
	ResourceType        arn.ResourceType
	VPCName             arn.ResourceName
	VPCAssociationNames arn.ResourceNames
}

EC2VPCCIDRBlockAssociationDeleter represents a collection of AWS EC2 VPC CIDR block associations

func (*EC2VPCCIDRBlockAssociationDeleter) AddResourceNames

func (rd *EC2VPCCIDRBlockAssociationDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 VPC CIDR block association names to VPCAssociationNames

func (*EC2VPCCIDRBlockAssociationDeleter) DeleteResources

func (rd *EC2VPCCIDRBlockAssociationDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 VPC CIDR block associations from AWS

func (*EC2VPCCIDRBlockAssociationDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2VPCCIDRBlockAssociationDeleter) String

type EC2VPCDeleter

type EC2VPCDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2VPCDeleter represents a collection of AWS EC2 VPC's

func (*EC2VPCDeleter) AddResourceNames

func (rd *EC2VPCDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 VPC names to ResourceNames

func (*EC2VPCDeleter) DeleteResources

func (rd *EC2VPCDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 VPC's from AWS

func (*EC2VPCDeleter) GetClient

func (rd *EC2VPCDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2VPCDeleter) RequestEC2InstancesFromVPCs

func (rd *EC2VPCDeleter) RequestEC2InstancesFromVPCs() ([]*ec2.Instance, error)

RequestEC2InstancesFromVPCs requests EC2 instance reservations from vpc names from the AWS API

func (*EC2VPCDeleter) RequestEC2InternetGatewaysFromVPCs

func (rd *EC2VPCDeleter) RequestEC2InternetGatewaysFromVPCs() ([]*ec2.InternetGateway, error)

RequestEC2InternetGatewaysFromVPCs requests EC2 internet gateways by vpc names from the AWS API

func (*EC2VPCDeleter) RequestEC2NatGatewaysFromVPCs

func (rd *EC2VPCDeleter) RequestEC2NatGatewaysFromVPCs() ([]*ec2.NatGateway, error)

RequestEC2NatGatewaysFromVPCs requests EC2 nat gateways by vpc names from the AWS API

func (*EC2VPCDeleter) RequestEC2NetworkInterfacesFromVPCs

func (rd *EC2VPCDeleter) RequestEC2NetworkInterfacesFromVPCs() ([]*ec2.NetworkInterface, error)

RequestEC2NetworkInterfacesFromVPCs requests EC2 network interfaces by vpc names from the AWS API

func (*EC2VPCDeleter) RequestEC2RouteTablesFromVPCs

func (rd *EC2VPCDeleter) RequestEC2RouteTablesFromVPCs() ([]*ec2.RouteTable, error)

RequestEC2RouteTablesFromVPCs requests EC2 route tables by vpc names from the AWS API

func (*EC2VPCDeleter) RequestEC2SecurityGroupsFromVPCs

func (rd *EC2VPCDeleter) RequestEC2SecurityGroupsFromVPCs() ([]*ec2.SecurityGroup, error)

RequestEC2SecurityGroupsFromVPCs requests EC2 security groups by vpc names from the AWS API

func (*EC2VPCDeleter) RequestEC2SubnetsFromVPCs

func (rd *EC2VPCDeleter) RequestEC2SubnetsFromVPCs() ([]*ec2.Subnet, error)

RequestEC2SubnetsFromVPCs requests EC2 subnets by vpc names from the AWS API

func (*EC2VPCDeleter) RequestEC2VPCs

func (rd *EC2VPCDeleter) RequestEC2VPCs() ([]*ec2.Vpc, error)

RequestEC2VPCs requests EC2 vpc's by vpc names from the AWS API

func (*EC2VPCDeleter) RequestEC2VPNGatewaysFromVPCs

func (rd *EC2VPCDeleter) RequestEC2VPNGatewaysFromVPCs() ([]*ec2.VpnGateway, error)

RequestEC2VPNGatewaysFromVPCs requests EC2 vpn gateways by vpc names from the AWS API

func (*EC2VPCDeleter) String

func (rd *EC2VPCDeleter) String() string

type EC2VPNConnectionDeleter

type EC2VPNConnectionDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2VPNConnectionDeleter represents a collection of AWS EC2 vpn connections

func (*EC2VPNConnectionDeleter) AddResourceNames

func (rd *EC2VPNConnectionDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 vpn connection names to ResourceNames

func (*EC2VPNConnectionDeleter) DeleteResources

func (rd *EC2VPNConnectionDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 vpn connections from AWS

func (*EC2VPNConnectionDeleter) GetClient

func (rd *EC2VPNConnectionDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2VPNConnectionDeleter) RequestEC2VPNConnections

func (rd *EC2VPNConnectionDeleter) RequestEC2VPNConnections() ([]*ec2.VpnConnection, error)

RequestEC2VPNConnections requests EC2 vpn connections by names from the AWS API

func (*EC2VPNConnectionDeleter) String

func (rd *EC2VPNConnectionDeleter) String() string

type EC2VPNConnectionRouteDeleter

type EC2VPNConnectionRouteDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	VPNConnection *ec2.VpnConnection
}

EC2VPNConnectionRouteDeleter represents a collection of AWS EC2 vpn connection routes

func (*EC2VPNConnectionRouteDeleter) DeleteResources

func (rd *EC2VPNConnectionRouteDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 vpn connection routes from AWS

func (*EC2VPNConnectionRouteDeleter) GetClient

func (rd *EC2VPNConnectionRouteDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2VPNConnectionRouteDeleter) String

func (rd *EC2VPNConnectionRouteDeleter) String() string

type EC2VPNGatewayAttachmentDeleter

type EC2VPNGatewayAttachmentDeleter struct {
	Client       EC2Client
	ResourceType arn.ResourceType
	VPNGateway   *ec2.VpnGateway
}

EC2VPNGatewayAttachmentDeleter represents a collection of AWS EC2 vpn gateway attachments

func (*EC2VPNGatewayAttachmentDeleter) DeleteResources

func (rd *EC2VPNGatewayAttachmentDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 vpn gateway attachments from AWS

func (*EC2VPNGatewayAttachmentDeleter) GetClient

func (rd *EC2VPNGatewayAttachmentDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2VPNGatewayAttachmentDeleter) String

type EC2VPNGatewayDeleter

type EC2VPNGatewayDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2VPNGatewayDeleter represents a collection of AWS EC2 vpn gateways

func (*EC2VPNGatewayDeleter) AddResourceNames

func (rd *EC2VPNGatewayDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 vpn gateway names to ResourceNames

func (*EC2VPNGatewayDeleter) DeleteResources

func (rd *EC2VPNGatewayDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 vpn gateways from AWS

func (*EC2VPNGatewayDeleter) GetClient

func (rd *EC2VPNGatewayDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2VPNGatewayDeleter) RequestEC2VPNConnectionsFromVPNGateways

func (rd *EC2VPNGatewayDeleter) RequestEC2VPNConnectionsFromVPNGateways() ([]*ec2.VpnConnection, error)

RequestEC2VPNConnectionsFromVPNGateways requests EC2 vpn connections by vpn gateway names from the AWS API

func (*EC2VPNGatewayDeleter) RequestEC2VPNGateways

func (rd *EC2VPNGatewayDeleter) RequestEC2VPNGateways() ([]*ec2.VpnGateway, error)

RequestEC2VPNGateways requests EC2 vpn gateways by names from the AWS API

func (*EC2VPNGatewayDeleter) String

func (rd *EC2VPNGatewayDeleter) String() string

type EC2VolumeDeleter

type EC2VolumeDeleter struct {
	Client        EC2Client
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

EC2VolumeDeleter represents a collection of AWS EC2 volumes

func (*EC2VolumeDeleter) AddResourceNames

func (rd *EC2VolumeDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds EC2 volume names to ResourceNames

func (*EC2VolumeDeleter) DeleteResources

func (rd *EC2VolumeDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes EC2 volumes from AWS

func (*EC2VolumeDeleter) GetClient

func (rd *EC2VolumeDeleter) GetClient() *EC2Client

GetClient returns an AWS Client, and initalizes one if one has not been

func (*EC2VolumeDeleter) RequestEC2Volumes

func (rd *EC2VolumeDeleter) RequestEC2Volumes() ([]*ec2.Volume, error)

RequestEC2Volumes requests EC2 volumes by volume names from the AWS API

func (*EC2VolumeDeleter) String

func (rd *EC2VolumeDeleter) String() string

type ElasticLoadBalancingLoadBalancerDeleter

type ElasticLoadBalancingLoadBalancerDeleter struct {
	Client        elbiface.ELBAPI
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

ElasticLoadBalancingLoadBalancerDeleter represents a collection of AWS elastic load balancers

func (*ElasticLoadBalancingLoadBalancerDeleter) AddResourceNames

func (rd *ElasticLoadBalancingLoadBalancerDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds elastic load balancer names to ResourceNames

func (*ElasticLoadBalancingLoadBalancerDeleter) DeleteResources

DeleteResources deletes elastic load balancers from AWS

func (*ElasticLoadBalancingLoadBalancerDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*ElasticLoadBalancingLoadBalancerDeleter) RequestElasticLoadBalancers

func (rd *ElasticLoadBalancingLoadBalancerDeleter) RequestElasticLoadBalancers() ([]*elb.LoadBalancerDescription, error)

RequestElasticLoadBalancers requests elastic load balancers by name from the AWS API

func (*ElasticLoadBalancingLoadBalancerDeleter) String

type IAMInstanceProfileDeleter

type IAMInstanceProfileDeleter struct {
	Client        iamiface.IAMAPI
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

IAMInstanceProfileDeleter represents an AWS instance profile

func (*IAMInstanceProfileDeleter) AddResourceNames

func (rd *IAMInstanceProfileDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds instance profile names to Names

func (*IAMInstanceProfileDeleter) DeleteResources

func (rd *IAMInstanceProfileDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes an instance profiles from AWS NOTE: must delete roles from instance profile before deleting roles. Must be done in this step because of only profiles contain role info, not visa versa.

func (*IAMInstanceProfileDeleter) GetClient

func (rd *IAMInstanceProfileDeleter) GetClient() iamiface.IAMAPI

GetClient returns an AWS Client, and initalizes one if one has not been

func (*IAMInstanceProfileDeleter) RequestIAMInstanceProfiles

func (rd *IAMInstanceProfileDeleter) RequestIAMInstanceProfiles() ([]*iam.InstanceProfile, error)

RequestIAMInstanceProfiles requests IAM instance profiles by name from the AWS API and IAM instance profiles

func (*IAMInstanceProfileDeleter) String

func (rd *IAMInstanceProfileDeleter) String() string

type IAMRoleDeleter

type IAMRoleDeleter struct {
	Client        iamiface.IAMAPI
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

IAMRoleDeleter represents an AWS IAM role

func (*IAMRoleDeleter) AddResourceNames

func (rd *IAMRoleDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds IAM role names to Names

func (*IAMRoleDeleter) DeleteResources

func (rd *IAMRoleDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes IAM roles from AWS

func (*IAMRoleDeleter) GetClient

func (rd *IAMRoleDeleter) GetClient() iamiface.IAMAPI

GetClient returns an AWS Client, and initalizes one if one has not been

func (*IAMRoleDeleter) RequestIAMRoles

func (rd *IAMRoleDeleter) RequestIAMRoles() ([]*iam.Role, error)

RequestIAMRoles requests IAM roles by name from the AWS API and returns IAM roles

func (*IAMRoleDeleter) String

func (rd *IAMRoleDeleter) String() string

type IAMRolePolicyDeleter

type IAMRolePolicyDeleter struct {
	Client       iamiface.IAMAPI
	ResourceType arn.ResourceType
	RoleName     arn.ResourceName
	PolicyNames  arn.ResourceNames
}

IAMRolePolicyDeleter represents an AWS IAM role policy

func (*IAMRolePolicyDeleter) AddResourceNames

func (rd *IAMRolePolicyDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds IAM role policy names to Names

func (*IAMRolePolicyDeleter) DeleteResources

func (rd *IAMRolePolicyDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes IAM role policies from AWS by role name

func (*IAMRolePolicyDeleter) GetClient

func (rd *IAMRolePolicyDeleter) GetClient() iamiface.IAMAPI

GetClient returns an AWS Client, and initalizes one if one has not been

func (*IAMRolePolicyDeleter) RequestIAMRolePoliciesFromRoles

func (rd *IAMRolePolicyDeleter) RequestIAMRolePoliciesFromRoles() (arn.ResourceNames, error)

RequestIAMRolePoliciesFromRoles requests IAM role policies by role name from the AWS API and returns policy names

func (*IAMRolePolicyDeleter) String

func (rd *IAMRolePolicyDeleter) String() string

type LogEntry

type LogEntry struct {
	ResourceType       arn.ResourceType `json:"resource_type"`
	ResourceName       arn.ResourceName `json:"resource_name"`
	AWSErrorCode       string           `json:"aws_err_code,omitempty"`
	AWSErrorMsg        string           `json:"aws_err_msg,omitempty"`
	ErrMsg             string           `json:"err_msg,omitempty"`
	ParentResourceType arn.ResourceType `json:"parent_resource_type,omitempty"`
	ParentResourceName arn.ResourceName `json:"parent_resource_name,omitempty"`
}

LogEntry maps potential log entry fields to a Go struct. Add fields here when creating fields in ResourceDeleter.DeleteResources implementations

type LogFormatFunc

type LogFormatFunc func(*LogEntry) string

LogFormatFunc formats LogEntry structs into a string

type ResourceDeleter

type ResourceDeleter interface {
	// Adds resource names to the ResourceDeleter
	AddResourceNames(...arn.ResourceName)
	// Delete resources using DeleteConfig info
	DeleteResources(*DeleteConfig) error
}

A ResourceDeleter is any type that can delete itself from AWS and describe itself using an AWS request

func InitResourceDeleter

func InitResourceDeleter(t arn.ResourceType) ResourceDeleter

InitResourceDeleter creates a ResourceDeleter using a type defined in the `deleter` package

type Route53HostedZoneDeleter

type Route53HostedZoneDeleter struct {
	Client        route53iface.Route53API
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

Route53HostedZoneDeleter represents an AWS route53 hosted zone

func (*Route53HostedZoneDeleter) AddResourceNames

func (rd *Route53HostedZoneDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds route53 hosted zone names to Names

func (*Route53HostedZoneDeleter) DeletePrivateRoute53HostedZones

func (rd *Route53HostedZoneDeleter) DeletePrivateRoute53HostedZones(cfg *DeleteConfig) error

DeletePrivateRoute53HostedZones deletes only private hosted zones

func (*Route53HostedZoneDeleter) DeleteResources

func (rd *Route53HostedZoneDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes hosted zones from AWS NOTE: must delete all non-default resource record sets before deleting a hosted zone. Will receive HostedZoneNotEmpty otherwise

func (*Route53HostedZoneDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*Route53HostedZoneDeleter) RequestAllRoute53HostedZones

func (rd *Route53HostedZoneDeleter) RequestAllRoute53HostedZones() ([]*route53.HostedZone, error)

RequestAllRoute53HostedZones retrieves a list of all hosted zones

func (*Route53HostedZoneDeleter) RequestRoute53HostedZones

func (rd *Route53HostedZoneDeleter) RequestRoute53HostedZones() ([]*route53.HostedZone, error)

RequestRoute53HostedZones requests resources from the AWS API and returns route53 hosted zones by names

func (*Route53HostedZoneDeleter) String

func (rd *Route53HostedZoneDeleter) String() string

type Route53ResourceRecordSetDeleter

type Route53ResourceRecordSetDeleter struct {
	Client        route53iface.Route53API
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

Route53ResourceRecordSetDeleter represents an AWS route53 resource record set

func (*Route53ResourceRecordSetDeleter) AddResourceNames

func (rd *Route53ResourceRecordSetDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds route53 resource record set names to Names

func (*Route53ResourceRecordSetDeleter) DeleteResources

func (rd *Route53ResourceRecordSetDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes route53 resource record sets from AWS

func (*Route53ResourceRecordSetDeleter) GetClient

GetClient returns an AWS Client, and initalizes one if one has not been

func (*Route53ResourceRecordSetDeleter) RequestRoute53ResourceRecordSets

func (rd *Route53ResourceRecordSetDeleter) RequestRoute53ResourceRecordSets() (map[arn.ResourceName][]*route53.ResourceRecordSet, error)

RequestRoute53ResourceRecordSets requests route53 resource record sets by hosted zone names from the AWS API and returns a map of hosted zones to resource record sets

func (*Route53ResourceRecordSetDeleter) String

type S3BucketDeleter

type S3BucketDeleter struct {
	Client        s3iface.S3API
	ResourceType  arn.ResourceType
	ResourceNames arn.ResourceNames
}

S3BucketDeleter represents a collection of AWS S3 buckets

func (*S3BucketDeleter) AddResourceNames

func (rd *S3BucketDeleter) AddResourceNames(ns ...arn.ResourceName)

AddResourceNames adds S3 bucket names to ResourceNames

func (*S3BucketDeleter) DeleteResources

func (rd *S3BucketDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes S3 buckets from AWS

func (*S3BucketDeleter) GetClient

func (rd *S3BucketDeleter) GetClient() s3iface.S3API

GetClient returns an AWS Client, and initalizes one if one has not been

func (*S3BucketDeleter) String

func (rd *S3BucketDeleter) String() string

type S3ObjectDeleter

type S3ObjectDeleter struct {
	Client            s3iface.S3API
	ResourceType      arn.ResourceType
	BucketName        arn.ResourceName
	ObjectIdentifiers []*s3.ObjectIdentifier
}

S3ObjectDeleter represents a collection of AWS S3 objects

func (*S3ObjectDeleter) AddResourceNames

func (rd *S3ObjectDeleter) AddResourceNames(keys ...arn.ResourceName)

AddResourceNames adds S3 object names to ResourceNames

func (*S3ObjectDeleter) DeleteResources

func (rd *S3ObjectDeleter) DeleteResources(cfg *DeleteConfig) error

DeleteResources deletes S3 objects from AWS

func (*S3ObjectDeleter) GetClient

func (rd *S3ObjectDeleter) GetClient() s3iface.S3API

GetClient returns an AWS Client, and initalizes one if one has not been

func (*S3ObjectDeleter) RequestS3ObjectsFromBucket

func (rd *S3ObjectDeleter) RequestS3ObjectsFromBucket() ([]*s3.Object, error)

RequestS3ObjectsFromBucket requests S3 objects by bucket name from the AWS API

func (*S3ObjectDeleter) String

func (rd *S3ObjectDeleter) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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