aws

package module
v0.0.0-...-6117b69 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateToEks

func AuthenticateToEks(clusterName string, clusterUrl string, roleArn string, session *session.Session) (*kubernetes.Clientset, error)

func CreateSession

func CreateSession(region string) (*session.Session, error)

func CreateSessionWithoutRegion

func CreateSessionWithoutRegion() (*session.Session, error)

func DeleteDetachedPolicies

func DeleteDetachedPolicies(iamSession *iam.IAM, dryRun bool)

func DeleteEmptyRepositories

func DeleteEmptyRepositories(ecrSession *ecr.ECR, drynRun bool)

func DeleteExpiredBuckets

func DeleteExpiredBuckets(s3session s3.S3, tagName string, dryRun bool)

func DeleteExpiredDocumentDBClusters

func DeleteExpiredDocumentDBClusters(svc rds.RDS, tagName string, dryRun bool)

func DeleteExpiredEKSClusters

func DeleteExpiredEKSClusters(svc eks.EKS, ec2Session ec2.EC2, elbSession elbv2.ELBV2, cloudwatchLogsSession cloudwatchlogs.CloudWatchLogs, rdsSession rds.RDS, tagName string, dryRun bool)

func DeleteExpiredElasticacheDatabases

func DeleteExpiredElasticacheDatabases(svc elasticache.ElastiCache, tagName string, dryRun bool)

func DeleteExpiredIAM

func DeleteExpiredIAM(iamSession *iam.IAM, tagName string, dryRun bool)

func DeleteExpiredKeyPairs

func DeleteExpiredKeyPairs(ec2session *ec2.EC2, tagName string, dryRun bool)

func DeleteExpiredKeys

func DeleteExpiredKeys(svc kms.KMS, tagName string, dryRun bool)

func DeleteExpiredLoadBalancers

func DeleteExpiredLoadBalancers(elbSession elbv2.ELBV2, tagName string, dryRun bool)

func DeleteExpiredLogs

func DeleteExpiredLogs(svc cloudwatchlogs.CloudWatchLogs, tagName string, dryRun bool)

func DeleteExpiredRDSDatabases

func DeleteExpiredRDSDatabases(svc rds.RDS, tagName string, dryRun bool)

func DeleteExpiredRDSSubnetGroups

func DeleteExpiredRDSSubnetGroups(svc rds.RDS, tagName string, dryRun bool)

func DeleteExpiredRoles

func DeleteExpiredRoles(iamSession *iam.IAM, tagName string, dryRun bool)

func DeleteExpiredUsers

func DeleteExpiredUsers(iamSession *iam.IAM, tagName string, dryRun bool)

func DeleteExpiredVPC

func DeleteExpiredVPC(ec2Session ec2.EC2, tagName string, dryRun bool)

func DeleteExpiredVolumes

func DeleteExpiredVolumes(ec2Session ec2.EC2, tagName string, dryRun bool)

func DeleteGroups

func DeleteGroups(iamSession *iam.IAM, dryRun bool)

func DeleteInternetGatewaysByIds

func DeleteInternetGatewaysByIds(ec2Session ec2.EC2, internetGateways []InternetGateway)

func DeleteRDSDatabase

func DeleteRDSDatabase(svc rds.RDS, database rdsDatabase) error

func DeleteRouteTablesByIds

func DeleteRouteTablesByIds(ec2Session ec2.EC2, routeTables []RouteTable)

func DeleteSecurityGroupsByIds

func DeleteSecurityGroupsByIds(ec2Session ec2.EC2, securityGroups []SecurityGroup)

func DeleteSubnetsByIds

func DeleteSubnetsByIds(ec2Session ec2.EC2, subnets []Subnet)

func ElasticacheSession

func ElasticacheSession(sess session.Session, region string) *elasticache.ElastiCache

func GetRDSInstanceInfos

func GetRDSInstanceInfos(svc rds.RDS, databaseIdentifier string) (rdsDatabase, error)

func GetVpcsIdsByClusterNameTag

func GetVpcsIdsByClusterNameTag(ec2Session ec2.EC2, clusterName string) []*string

func HandleRolePolicies

func HandleRolePolicies(iamSession *iam.IAM, roleName string)

func HandleUserPolicies

func HandleUserPolicies(iamSession *iam.IAM, userName string)

func RdsSession

func RdsSession(sess session.Session, region string) *rds.RDS

func RunPlecoAWS

func RunPlecoAWS(cmd *cobra.Command, regions []string, interval int64, dryRun bool, wg *sync.WaitGroup)

func SetInternetGatewaysIdsByVpcId

func SetInternetGatewaysIdsByVpcId(ec2Session ec2.EC2, vpc *VpcInfo, waitGroup *sync.WaitGroup, tagName string)

func SetRouteTablesIdsByVpcId

func SetRouteTablesIdsByVpcId(ec2Session ec2.EC2, vpc *VpcInfo, waitGroup *sync.WaitGroup, tagName string)

func SetSecurityGroupsIdsByVpcId

func SetSecurityGroupsIdsByVpcId(ec2Session ec2.EC2, vpc *VpcInfo, waitGroup *sync.WaitGroup, tagName string)

func SetSubnetsIdsByVpcId

func SetSubnetsIdsByVpcId(ec2Session ec2.EC2, vpc *VpcInfo, waitGroup *sync.WaitGroup, tagName string)

func TagLoadBalancersForDeletion

func TagLoadBalancersForDeletion(lbSession elbv2.ELBV2, tagKey string, loadBalancersList []ElasticLoadBalancer, clusterName string) error

func TagLogsForDeletion

func TagLogsForDeletion(svc cloudwatchlogs.CloudWatchLogs, tagName string, clusterId string) error

func TagVolumesFromEksClusterForDeletion

func TagVolumesFromEksClusterForDeletion(ec2Session ec2.EC2, tagKey string, clusterName string) error

Types

type CompleteKey

type CompleteKey struct {
	KeyId        string
	TTL          int64
	Tag          string
	Status       string
	CreationDate time.Time
	IsProtected  bool
}

type CompleteLogGroup

type CompleteLogGroup struct {
	IsProtected bool
	// contains filtered or unexported fields
}

type EBSVolume

type EBSVolume struct {
	VolumeId    string
	CreatedTime time.Time
	Status      string
	TTL         int64
	IsProtected bool
}

type ElasticLoadBalancer

type ElasticLoadBalancer struct {
	Arn         string
	Name        string
	CreatedTime time.Time
	Status      string
	TTL         int64
	IsProtected bool
}

func ListLoadBalancers

func ListLoadBalancers(lbSession elbv2.ELBV2) ([]ElasticLoadBalancer, error)

func ListTaggedLoadBalancersWithKeyContains

func ListTaggedLoadBalancersWithKeyContains(lbSession elbv2.ELBV2, tagContains string) ([]ElasticLoadBalancer, error)

type InternetGateway

type InternetGateway struct {
	Id           string
	CreationDate time.Time

	IsProtected bool
	// contains filtered or unexported fields
}

type KeyPair

type KeyPair struct {
	KeyName      string
	KeyId        string
	CreationDate time.Time
	Tag          string

	IsProtected bool
	// contains filtered or unexported fields
}

type Policy

type Policy struct {
	Name string
	Arn  string
}

type Role

type Role struct {
	RoleName     string
	CreationDate time.Time

	Tag             string
	InstanceProfile []*iam.InstanceProfile
	IsProtected     bool
	// contains filtered or unexported fields
}

type RouteTable

type RouteTable struct {
	Id           string
	CreationDate time.Time

	Associations []*ec2.RouteTableAssociation
	IsProtected  bool
	// contains filtered or unexported fields
}

type SecurityGroup

type SecurityGroup struct {
	Id           string
	CreationDate time.Time

	IsProtected bool
	// contains filtered or unexported fields
}

type Subnet

type Subnet struct {
	Id           string
	CreationDate time.Time

	IsProtected bool
	// contains filtered or unexported fields
}

type User

type User struct {
	UserName     string
	CreationDate time.Time

	Tag         string
	IsProtected bool
	// contains filtered or unexported fields
}

type VpcInfo

type VpcInfo struct {
	VpcId            *string
	SecurityGroups   []SecurityGroup
	InternetGateways []InternetGateway
	Subnets          []Subnet
	RouteTables      []RouteTable
	Status           string
	TTL              int64
	Tag              string
	CreationDate     time.Time
	IsProtected      bool
}

Jump to

Keyboard shortcuts

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