helpers

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBucketEncryption added in v0.0.7

func CheckBucketEncryption(bucket string, region string) bool

CheckBucketEncryption check if bucket encryption is set

func CheckCertificateStatus

func CheckCertificateStatus(certificate *acm.DescribeCertificateOutput, region string)

CheckCertificateStatus checking certificate status

func CheckECRRepositoryLifecyclePolicy

func CheckECRRepositoryLifecyclePolicy(repositoryName string, region string) bool

CheckECRRepositoryLifecyclePolicy for a repository in a region

func CheckIfRecoredSetValueInRoute53

func CheckIfRecoredSetValueInRoute53(record string, value string, hostedZoneID string, region string) bool

CheckIfRecoredSetValueInRoute53 Checks if a recored exists in Route53

func CreateLambdaCloudwatchAlarm

func CreateLambdaCloudwatchAlarm(region string, functionName string, metricName string, namespace string, threshold float64, action string) bool

CreateLambdaCloudwatchAlarm will create a new alarm for cloudwatch

func DeleteEcrImages added in v0.0.7

func DeleteEcrImages(repo string, digest []string, region string, apply bool)

DeleteEcrImages delete according to image digest

func DeleteNetworkInterface added in v0.0.6

func DeleteNetworkInterface(region string, networkInterfaceID string, apply bool) bool

DeleteNetworkInterface delete by id

func DeleteRdsSnapshots

func DeleteRdsSnapshots(rdsSnapshots []RdsSnapshotInfo, older int, region string, apply bool, rdsType string, out string)

DeleteRdsSnapshots for deleting snapshots by date

func DeleteUnusedAcmCertificates

func DeleteUnusedAcmCertificates(region string, apply bool)

DeleteUnusedAcmCertificates deletes all unused certificate in a region

func DescribeAcmCertificate

func DescribeAcmCertificate(region string, arnCertificate string) *acm.DescribeCertificateOutput

DescribeAcmCertificate to list certificate metadata

func EcrDescribeImages added in v0.0.7

func EcrDescribeImages(repositoryName string, region string, keep int) ([]*ecr.ImageDetail, int)

EcrDescribeImages get details on images

func GetAcmCertificates

func GetAcmCertificates(region string) []*acm.CertificateSummary

GetAcmCertificates retrieves all certificates

func GetAllAwsAzs

func GetAllAwsAzs(region string) (azs []string, err error)

GetAllAwsAzs retrieval all available azs in a region

func GetAllAwsRegions

func GetAllAwsRegions() ([]string, error)

GetAllAwsRegions will retrieve all aws regions

func GetAllEC2Instances added in v0.0.8

func GetAllEC2Instances(region string, lifeCycle string, state string) []*ec2.Reservation

GetAllEC2Instances get all instances

func GetAllEc2Events

func GetAllEc2Events(region string, out string)

GetAllEc2Events will check for all events

func GetAllElasticNetworkInterfaces added in v0.0.6

func GetAllElasticNetworkInterfaces(region string, filter string) []*ec2.NetworkInterface

GetAllElasticNetworkInterfaces get all NICs

func GetAllLambdaInRegion added in v0.0.10

func GetAllLambdaInRegion(region string, arn string) []*lambda.FunctionConfiguration

GetAllLambdaInRegion List all lambdas in a region

func GetAllRds

func GetAllRds(region string, rdsType string, out string)

GetAllRds from a region

func GetAllRdsDBClusters

func GetAllRdsDBClusters(region string, out string)

GetAllRdsDBClusters get all rds db clusters

func GetAllReservations added in v0.0.8

func GetAllReservations(region string, state string) map[string]int64

GetAllReservations retrieve all reservations

func GetAllS3Buckets added in v0.0.7

func GetAllS3Buckets() []*s3.Bucket

GetAllS3Buckets retrieves all the buckets in a region

func GetAwsServiceCost

func GetAwsServiceCost() *pricing.GetProductsOutput

GetAwsServiceCost use to get a product code for getting price

func GetCloudwatchGroups

func GetCloudwatchGroups(region string) []*cloudwatchlogs.LogGroup

GetCloudwatchGroups getting all cloudwatch groups in a region

func GetDefaultAwsRegion

func GetDefaultAwsRegion() (region string)

GetDefaultAwsRegion resolve default region

func GetDomainHostedZoneID

func GetDomainHostedZoneID(domain string, region string) (domainHostedZoneID string, exists bool)

GetDomainHostedZoneID function get domain name and return its hosted zone id and if exists

func GetECRRepositories

func GetECRRepositories(region string) []*ecr.Repository

GetECRRepositories from aws region

func GetS3BucketLocation added in v0.0.7

func GetS3BucketLocation(bucket string) string

GetS3BucketLocation get a bucket region

func GetS3PublicAccess added in v0.0.14

func GetS3PublicAccess(bucket string, region string)

GetS3PublicAccess get public access to s3 bucket

func InitAwsSession

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

InitAwsSession initialize aws session

func ListCloudwatchAlarms

func ListCloudwatchAlarms(region string) []*cloudwatch.MetricAlarm

ListCloudwatchAlarms list all cloudwatch alarms

func PrintRdsSnapshotInformation

func PrintRdsSnapshotInformation(rdsSnapshotInformation []RdsSnapshotInfo, region string, out string)

PrintRdsSnapshotInformation print the needed snapshot information

func SetCloudwatchGroupsExpiry

func SetCloudwatchGroupsExpiry(region string, retention int64, cloudwatchGroups []*cloudwatchlogs.LogGroup, apply bool, override bool)

SetCloudwatchGroupsExpiry Set expiry on a cloudwatch group

func SetEcrRepoImageScanOnPush

func SetEcrRepoImageScanOnPush(repositoryName string, region string, scanOnPush bool)

SetEcrRepoImageScanOnPush set image scan on push configuration on ecr repository

func SetEcrRepositoryLifecyclePolicy

func SetEcrRepositoryLifecyclePolicy(repositoryName string, days int, region string)

SetEcrRepositoryLifecyclePolicy set the life time policy

func SummariesEC2Instances added in v0.0.13

func SummariesEC2Instances(ec2Slice []*ec2.Reservation) map[string]int64

SummariesEC2Instances summarizes into map instances by type and count them

Types

type Ec2Event

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

Ec2Event struct

type ImageArr added in v0.0.7

type ImageArr []*ecr.ImageDetail

ImageArr array of image details

func (ImageArr) Len added in v0.0.7

func (s ImageArr) Len() int

func (ImageArr) Less added in v0.0.7

func (s ImageArr) Less(i, j int) bool

func (ImageArr) Swap added in v0.0.7

func (s ImageArr) Swap(i, j int)

type RdsSnapshotInfo

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

RdsSnapshotInfo rds snapshot struct

func GetRDSSnapshots

func GetRDSSnapshots(resourceName string, rdsType string, region string, out string) []RdsSnapshotInfo

GetRDSSnapshots get all snapshot for instance(s) or clusters

Jump to

Keyboard shortcuts

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