awsdata

package
v0.0.0-...-e2d6844 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: GPL-3.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AssetTypeCloudFrontDistribution is the value used in the AssetType field when fetching CloudFront distributions
	AssetTypeCloudFrontDistribution string = "CloudFront Distribution"

	// ServiceCloudFront is the key for the CloudFront service
	ServiceCloudFront string = "cloudfront"
)
View Source
const (
	// AssetTypeCodeCommitRepository is the value used in the AssetType field when fetching CodeCommit repositories
	AssetTypeCodeCommitRepository string = "CodeCommit Repository"

	// ServiceCodeCommit is the key for the CodeCommit service
	ServiceCodeCommit string = "codecommit"
)
View Source
const (
	// AssetTypeDynamoDBTable is the value used in the AssetType field when fetching DynamoDB tables
	AssetTypeDynamoDBTable string = "DynamoDB Table"

	// ServiceDynamoDB is the key for the DynamoDB service
	ServiceDynamoDB string = "dynamodb"
)
View Source
const (
	// AssetTypeEBSVolume is the value used in the AssetType field when fetching EBS volumes
	AssetTypeEBSVolume string = "EBS Volume"

	// ServiceEBS is the key for the EBS service
	ServiceEBS string = "ebs"
)
View Source
const (
	// AssetTypeEC2Instance is the value used in the AssetType field when fetching EC2 instances
	AssetTypeEC2Instance string = "EC2 Instance"

	// ServiceEC2 is the key for the EC2 service
	ServiceEC2 string = "ec2"
)
View Source
const (
	// AssetTypeECRImage is the value used in the AssetType field when fetching ECR images
	AssetTypeECRImage string = "ECR Image"

	// ServiceECR is the key for the ECR service
	ServiceECR string = "ecr"
)
View Source
const (
	// AssetTypeECSContainer is the value used in the AssetType field when fetching ECS containers
	AssetTypeECSContainer string = "ECS Container"

	// ServiceECS is the key for the ECS service
	ServiceECS string = "ecs"
)
View Source
const (
	// AssetTypeElastiCacheNode is the value used in the AssetType field when fetching ElastiCache nodes
	AssetTypeElastiCacheNode string = "ElastiCache Node"

	// ServiceElastiCache is the key for the ElastiCache service
	ServiceElastiCache string = "elasticache"
)
View Source
const (
	// AssetTypeELB is the value used in the AssetType field when fetching ELBs
	AssetTypeELB string = "ELB"

	// ServiceELB is the key for the ELB service
	ServiceELB string = "elb"
)
View Source
const (
	// AssetTypeALB is the value used in the AssetType field when fetching ALBs
	AssetTypeALB string = "ALB"

	// AssetTypeNLB is the value used in the AssetType field when fetching NLBs
	AssetTypeNLB string = "NLB"

	// AssetTypeGLB is the value used in the AssetType field when fetching GLBs
	AssetTypeGLB string = "GLB"

	// ServiceELBV2 is the key for the ELBV2 service
	ServiceELBV2 string = "elbv2"
)
View Source
const (
	// AssetTypeElasticsearchDomain is the value used in the AssetType field when fetching Elasticsearch domains
	AssetTypeElasticsearchDomain string = "Elasticsearch Domain"

	// ServiceElasticsearchService is the key for the ElasticsearchService service
	ServiceElasticsearchService string = "es"
)
View Source
const (
	// AssetTypeIAMUser is the value used in the AssetType field when fetching IAM users
	AssetTypeIAMUser string = "IAM User"

	// ServiceIAM is the key for the IAM service
	ServiceIAM string = "iam"
)
View Source
const (
	// AssetTypeKMSKey is the value used in the AssetType field when fetching KMS keys
	AssetTypeKMSKey string = "KMS Key"

	// ServiceKMS is the key for the KMS service
	ServiceKMS string = "kms"
)
View Source
const (
	// AssetTypeLambdaFunction is the value used in the AssetType field when fetching Lambda functions
	AssetTypeLambdaFunction string = "Lambda Function"

	// ServiceLambda is the key for the Lambda service
	ServiceLambda string = "lambda"
)
View Source
const (
	// AssetTypeRDSInstance is the value used in the AssetType field when fetching RDS instances
	AssetTypeRDSInstance string = "RDS Instance"

	// ServiceRDS is the key for the RDS service
	ServiceRDS string = "rds"
)
View Source
const (
	// AssetTypeS3Bucket is the value used in the AssetType field when fetching S3 Buckets
	AssetTypeS3Bucket string = "S3 Bucket"

	// ServiceS3 is the key for the S3 service
	ServiceS3 string = "s3"
)
View Source
const (
	// AssetTypeSQSQueue is the value used in the AssetType field when fetching SQS queues
	AssetTypeSQSQueue string = "SQS Queue"

	// ServiceSQS is the key for the SQS service
	ServiceSQS string = "sqs"
)

Variables

View Source
var (
	// ErrNoRegions is logged when no regions are given to the Load method
	ErrNoRegions = errors.New("no regions specified")

	// ErrNoServices is logged when no services are given to the Load method
	ErrNoServices = errors.New("no services specified")
)
View Source
var (
	// DefaultRegion contains the region used by default and in tests
	DefaultRegion = "us-east-1"
)

Functions

This section is empty.

Types

type AWSData

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

AWSData is responsible for concurrently loading data from AWS and storing it based on the regions and services provided

func New

func New(logger *logrus.Logger, clients Clients) *AWSData

New returns a new default AWSData

func (*AWSData) Load

func (d *AWSData) Load(regions, services []string, processRow ProcessRow)

Load concurrently the required data based on the regions and services provided

func (*AWSData) PrintRegions

func (d *AWSData) PrintRegions()

PrintRegions lists all available AWS regions as used by the command line `print-regions` option

type Clients

type Clients interface {
	GetCloudFrontClient(region string) cloudfrontiface.CloudFrontAPI
	GetCodeCommitClient(region string) codecommitiface.CodeCommitAPI
	GetDynamoDBClient(region string) dynamodbiface.DynamoDBAPI
	GetEC2Client(region string) ec2iface.EC2API
	GetECRClient(region string) ecriface.ECRAPI
	GetECSClient(region string) ecsiface.ECSAPI
	GetElastiCacheClient(region string) elasticacheiface.ElastiCacheAPI
	GetElasticsearchServiceClient(region string) elasticsearchserviceiface.ElasticsearchServiceAPI
	GetELBClient(region string) elbiface.ELBAPI
	GetELBV2Client(region string) elbv2iface.ELBV2API
	GetIAMClient(region string) iamiface.IAMAPI
	GetKMSClient(region string) kmsiface.KMSAPI
	GetLambdaClient(region string) lambdaiface.LambdaAPI
	GetRDSClient(region string) rdsiface.RDSAPI
	GetRoute53Client(region string) route53iface.Route53API
	GetS3Client(region string) s3iface.S3API
	GetSQSClient(region string) sqsiface.SQSAPI
}

Clients is an interface for getting new AWS service clients

type DefaultClients

type DefaultClients struct{}

DefaultClients holds the default methods for creating AWS service clients

func (DefaultClients) GetCloudFrontClient

func (c DefaultClients) GetCloudFrontClient(region string) cloudfrontiface.CloudFrontAPI

GetCloudFrontClient returns a new CloudFront client for the given region

func (DefaultClients) GetCodeCommitClient

func (c DefaultClients) GetCodeCommitClient(region string) codecommitiface.CodeCommitAPI

GetCodeCommitClient returns a new CodeCommit client for the given region

func (DefaultClients) GetDynamoDBClient

func (c DefaultClients) GetDynamoDBClient(region string) dynamodbiface.DynamoDBAPI

GetDynamoDBClient returns a new DynamoDB client for the given region

func (DefaultClients) GetEC2Client

func (c DefaultClients) GetEC2Client(region string) ec2iface.EC2API

GetEC2Client returns a new EC2 client for the given region

func (DefaultClients) GetECRClient

func (c DefaultClients) GetECRClient(region string) ecriface.ECRAPI

GetECRClient returns a new ECS client for the given region

func (DefaultClients) GetECSClient

func (c DefaultClients) GetECSClient(region string) ecsiface.ECSAPI

GetECSClient returns a new ECS client for the given region

func (DefaultClients) GetELBClient

func (c DefaultClients) GetELBClient(region string) elbiface.ELBAPI

GetELBClient returns a new ELB client for the given region

func (DefaultClients) GetELBV2Client

func (c DefaultClients) GetELBV2Client(region string) elbv2iface.ELBV2API

GetELBV2Client returns a new ELBV2 client for the given region

func (DefaultClients) GetElastiCacheClient

func (c DefaultClients) GetElastiCacheClient(region string) elasticacheiface.ElastiCacheAPI

GetElastiCacheClient returns a new ElastiCache client for the given region

func (DefaultClients) GetElasticsearchServiceClient

func (c DefaultClients) GetElasticsearchServiceClient(region string) elasticsearchserviceiface.ElasticsearchServiceAPI

GetElasticsearchServiceClient returns a new ElasticsearchService client for the given region

func (DefaultClients) GetIAMClient

func (c DefaultClients) GetIAMClient(region string) iamiface.IAMAPI

GetIAMClient returns a new IAM client for the given region

func (DefaultClients) GetKMSClient

func (c DefaultClients) GetKMSClient(region string) kmsiface.KMSAPI

GetKMSClient returns a new KMS client for the given region

func (DefaultClients) GetLambdaClient

func (c DefaultClients) GetLambdaClient(region string) lambdaiface.LambdaAPI

GetLambdaClient returns a new RDS client for the given region

func (DefaultClients) GetRDSClient

func (c DefaultClients) GetRDSClient(region string) rdsiface.RDSAPI

GetRDSClient returns a new RDS client for the given region

func (DefaultClients) GetRoute53Client

func (c DefaultClients) GetRoute53Client(region string) route53iface.Route53API

GetRoute53Client returns a new Route53 client for the given region

func (DefaultClients) GetS3Client

func (c DefaultClients) GetS3Client(region string) s3iface.S3API

GetS3Client returns a new S3 client for the given region

func (DefaultClients) GetSQSClient

func (c DefaultClients) GetSQSClient(region string) sqsiface.SQSAPI

GetSQSClient returns a new SQS client for the given region

type ProcessRow

type ProcessRow func(inventory.Row) error

ProcessRow takes an inventory row, performs some action, and returns an error

Jump to

Keyboard shortcuts

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