awsservices

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2017 License: Apache-2.0 Imports: 69 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARENT_OF = iota // default
	APPLIES_ON
	DEPENDING_ON
)

Variables

View Source
var APIPerResourceType = map[string]string{
	"instance":            "ec2",
	"subnet":              "ec2",
	"vpc":                 "ec2",
	"keypair":             "ec2",
	"securitygroup":       "ec2",
	"volume":              "ec2",
	"internetgateway":     "ec2",
	"natgateway":          "ec2",
	"routetable":          "ec2",
	"availabilityzone":    "ec2",
	"image":               "ec2",
	"importimagetask":     "ec2",
	"elasticip":           "ec2",
	"snapshot":            "ec2",
	"networkinterface":    "ec2",
	"loadbalancer":        "elbv2",
	"targetgroup":         "elbv2",
	"listener":            "elbv2",
	"database":            "rds",
	"dbsubnetgroup":       "rds",
	"launchconfiguration": "autoscaling",
	"scalinggroup":        "autoscaling",
	"scalingpolicy":       "autoscaling",
	"repository":          "ecr",
	"containercluster":    "ecs",
	"containertask":       "ecs",
	"container":           "ecs",
	"containerinstance":   "ecs",
	"certificate":         "acm",
	"user":                "iam",
	"group":               "iam",
	"role":                "iam",
	"policy":              "iam",
	"accesskey":           "iam",
	"instanceprofile":     "iam",
	"mfadevice":           "iam",
	"bucket":              "s3",
	"s3object":            "s3",
	"subscription":        "sns",
	"topic":               "sns",
	"queue":               "sqs",
	"zone":                "route53",
	"record":              "route53",
	"function":            "lambda",
	"metric":              "cloudwatch",
	"alarm":               "cloudwatch",
	"distribution":        "cloudfront",
	"stack":               "cloudformation",
}
View Source
var (
	AccessService, InfraService, StorageService, MessagingService, DnsService, LambdaService, MonitoringService, CdnService, CloudformationService cloud.Service
)
View Source
var DefaultNetworkMonitor = &NetworkMonitor{requests: make(map[*request.Request]*req)}
View Source
var GlobalServices = []string{
	"access",
	"dns",
	"cdn",
}
View Source
var ResourceTypes = []string{
	"instance",
	"subnet",
	"vpc",
	"keypair",
	"securitygroup",
	"volume",
	"internetgateway",
	"natgateway",
	"routetable",
	"availabilityzone",
	"image",
	"importimagetask",
	"elasticip",
	"snapshot",
	"networkinterface",
	"loadbalancer",
	"targetgroup",
	"listener",
	"database",
	"dbsubnetgroup",
	"launchconfiguration",
	"scalinggroup",
	"scalingpolicy",
	"repository",
	"containercluster",
	"containertask",
	"container",
	"containerinstance",
	"certificate",
	"user",
	"group",
	"role",
	"policy",
	"accesskey",
	"instanceprofile",
	"mfadevice",
	"bucket",
	"s3object",
	"subscription",
	"topic",
	"queue",
	"zone",
	"record",
	"function",
	"metric",
	"alarm",
	"distribution",
	"stack",
}
View Source
var ServiceNames = []string{
	"infra",
	"access",
	"storage",
	"messaging",
	"dns",
	"lambda",
	"monitoring",
	"cdn",
	"cloudformation",
}
View Source
var ServicePerAPI = map[string]string{
	"ec2":                    "infra",
	"elbv2":                  "infra",
	"rds":                    "infra",
	"autoscaling":            "infra",
	"ecr":                    "infra",
	"ecs":                    "infra",
	"applicationautoscaling": "infra",
	"acm":                    "infra",
	"iam":                    "access",
	"sts":                    "access",
	"s3":                     "storage",
	"sns":                    "messaging",
	"sqs":                    "messaging",
	"route53":                "dns",
	"lambda":                 "lambda",
	"cloudwatch":             "monitoring",
	"cloudfront":             "cdn",
	"cloudformation":         "cloudformation",
}
View Source
var ServicePerResourceType = map[string]string{
	"instance":            "infra",
	"subnet":              "infra",
	"vpc":                 "infra",
	"keypair":             "infra",
	"securitygroup":       "infra",
	"volume":              "infra",
	"internetgateway":     "infra",
	"natgateway":          "infra",
	"routetable":          "infra",
	"availabilityzone":    "infra",
	"image":               "infra",
	"importimagetask":     "infra",
	"elasticip":           "infra",
	"snapshot":            "infra",
	"networkinterface":    "infra",
	"loadbalancer":        "infra",
	"targetgroup":         "infra",
	"listener":            "infra",
	"database":            "infra",
	"dbsubnetgroup":       "infra",
	"launchconfiguration": "infra",
	"scalinggroup":        "infra",
	"scalingpolicy":       "infra",
	"repository":          "infra",
	"containercluster":    "infra",
	"containertask":       "infra",
	"container":           "infra",
	"containerinstance":   "infra",
	"certificate":         "infra",
	"user":                "access",
	"group":               "access",
	"role":                "access",
	"policy":              "access",
	"accesskey":           "access",
	"instanceprofile":     "access",
	"mfadevice":           "access",
	"bucket":              "storage",
	"s3object":            "storage",
	"subscription":        "messaging",
	"topic":               "messaging",
	"queue":               "messaging",
	"zone":                "dns",
	"record":              "dns",
	"function":            "lambda",
	"metric":              "monitoring",
	"alarm":               "monitoring",
	"distribution":        "cdn",
	"stack":               "cloudformation",
}

Functions

func GetCloudServicesForAPIs

func GetCloudServicesForAPIs(apis ...string) (services []cloud.Service)

func GetCloudServicesForTypes

func GetCloudServicesForTypes(types ...string) (services []cloud.Service)

func Init

func Init(conf map[string]interface{}, log *logger.Logger, profileSetterCallback func(val string) error, enableNetworkMonitor bool) error

func IsGlobalService

func IsGlobalService(name string) bool

func NewAccess

func NewAccess(sess *session.Session, awsconf config, log *logger.Logger) cloud.Service

func NewCdn

func NewCdn(sess *session.Session, awsconf config, log *logger.Logger) cloud.Service

func NewCloudformation

func NewCloudformation(sess *session.Session, awsconf config, log *logger.Logger) cloud.Service

func NewDns

func NewDns(sess *session.Session, awsconf config, log *logger.Logger) cloud.Service

func NewInfra

func NewInfra(sess *session.Session, awsconf config, log *logger.Logger) cloud.Service

func NewLambda

func NewLambda(sess *session.Session, awsconf config, log *logger.Logger) cloud.Service

func NewMessaging

func NewMessaging(sess *session.Session, awsconf config, log *logger.Logger) cloud.Service

func NewMonitoring

func NewMonitoring(sess *session.Session, awsconf config, log *logger.Logger) cloud.Service

func NewStorage

func NewStorage(sess *session.Session, awsconf config, log *logger.Logger) cloud.Service

func ResolveRegionFromEnv added in v0.1.7

func ResolveRegionFromEnv() (region string)

func ResourceTypesPerServiceName

func ResourceTypesPerServiceName() map[string][]string

Types

type Access

type Access struct {
	iamiface.IAMAPI
	stsiface.STSAPI
	// contains filtered or unexported fields
}

func (*Access) Fetch added in v0.1.3

func (s *Access) Fetch(ctx context.Context) (*graph.Graph, error)

func (*Access) FetchByType

func (s *Access) FetchByType(ctx context.Context, t string) (*graph.Graph, error)

func (*Access) GetIdentity

func (s *Access) GetIdentity() (*Identity, error)

func (*Access) GetUserPolicies

func (s *Access) GetUserPolicies(username string) (*UserPolicies, error)

func (*Access) IsSyncDisabled

func (s *Access) IsSyncDisabled() bool

func (*Access) Name

func (s *Access) Name() string

func (*Access) Region

func (s *Access) Region() string

func (*Access) ResourceTypes

func (s *Access) ResourceTypes() []string

type Cdn

type Cdn struct {
	cloudfrontiface.CloudFrontAPI
	// contains filtered or unexported fields
}

func (*Cdn) Fetch added in v0.1.3

func (s *Cdn) Fetch(ctx context.Context) (*graph.Graph, error)

func (*Cdn) FetchByType

func (s *Cdn) FetchByType(ctx context.Context, t string) (*graph.Graph, error)

func (*Cdn) IsSyncDisabled

func (s *Cdn) IsSyncDisabled() bool

func (*Cdn) Name

func (s *Cdn) Name() string

func (*Cdn) Region

func (s *Cdn) Region() string

func (*Cdn) ResourceTypes

func (s *Cdn) ResourceTypes() []string

type Cloudformation

type Cloudformation struct {
	cloudformationiface.CloudFormationAPI
	// contains filtered or unexported fields
}

func (*Cloudformation) Fetch added in v0.1.3

func (s *Cloudformation) Fetch(ctx context.Context) (*graph.Graph, error)

func (*Cloudformation) FetchByType

func (s *Cloudformation) FetchByType(ctx context.Context, t string) (*graph.Graph, error)

func (*Cloudformation) IsSyncDisabled

func (s *Cloudformation) IsSyncDisabled() bool

func (*Cloudformation) Name

func (s *Cloudformation) Name() string

func (*Cloudformation) Region

func (s *Cloudformation) Region() string

func (*Cloudformation) ResourceTypes

func (s *Cloudformation) ResourceTypes() []string

type Dns

type Dns struct {
	route53iface.Route53API
	// contains filtered or unexported fields
}

func (*Dns) Fetch added in v0.1.3

func (s *Dns) Fetch(ctx context.Context) (*graph.Graph, error)

func (*Dns) FetchByType

func (s *Dns) FetchByType(ctx context.Context, t string) (*graph.Graph, error)

func (*Dns) IsSyncDisabled

func (s *Dns) IsSyncDisabled() bool

func (*Dns) Name

func (s *Dns) Name() string

func (*Dns) Region

func (s *Dns) Region() string

func (*Dns) ResourceTypes

func (s *Dns) ResourceTypes() []string

type Identity

type Identity struct {
	Account, Arn, UserId, ResourceType, ResourcePath, Resource string
}

func (*Identity) IsRoot

func (i *Identity) IsRoot() bool

func (*Identity) IsUserType

func (i *Identity) IsUserType() bool

type Infra

func (*Infra) Fetch added in v0.1.3

func (s *Infra) Fetch(ctx context.Context) (*graph.Graph, error)

func (*Infra) FetchByType

func (s *Infra) FetchByType(ctx context.Context, t string) (*graph.Graph, error)

func (*Infra) IsSyncDisabled

func (s *Infra) IsSyncDisabled() bool

func (*Infra) Name

func (s *Infra) Name() string

func (*Infra) Region

func (s *Infra) Region() string

func (*Infra) ResourceTypes

func (s *Infra) ResourceTypes() []string

type Lambda

type Lambda struct {
	lambdaiface.LambdaAPI
	// contains filtered or unexported fields
}

func (*Lambda) Fetch added in v0.1.3

func (s *Lambda) Fetch(ctx context.Context) (*graph.Graph, error)

func (*Lambda) FetchByType

func (s *Lambda) FetchByType(ctx context.Context, t string) (*graph.Graph, error)

func (*Lambda) IsSyncDisabled

func (s *Lambda) IsSyncDisabled() bool

func (*Lambda) Name

func (s *Lambda) Name() string

func (*Lambda) Region

func (s *Lambda) Region() string

func (*Lambda) ResourceTypes

func (s *Lambda) ResourceTypes() []string

type Messaging

type Messaging struct {
	snsiface.SNSAPI
	sqsiface.SQSAPI
	// contains filtered or unexported fields
}

func (*Messaging) Fetch added in v0.1.3

func (s *Messaging) Fetch(ctx context.Context) (*graph.Graph, error)

func (*Messaging) FetchByType

func (s *Messaging) FetchByType(ctx context.Context, t string) (*graph.Graph, error)

func (*Messaging) IsSyncDisabled

func (s *Messaging) IsSyncDisabled() bool

func (*Messaging) Name

func (s *Messaging) Name() string

func (*Messaging) Region

func (s *Messaging) Region() string

func (*Messaging) ResourceTypes

func (s *Messaging) ResourceTypes() []string

type Monitoring

type Monitoring struct {
	cloudwatchiface.CloudWatchAPI
	// contains filtered or unexported fields
}

func (*Monitoring) Fetch added in v0.1.3

func (s *Monitoring) Fetch(ctx context.Context) (*graph.Graph, error)

func (*Monitoring) FetchByType

func (s *Monitoring) FetchByType(ctx context.Context, t string) (*graph.Graph, error)

func (*Monitoring) IsSyncDisabled

func (s *Monitoring) IsSyncDisabled() bool

func (*Monitoring) Name

func (s *Monitoring) Name() string

func (*Monitoring) Region

func (s *Monitoring) Region() string

func (*Monitoring) ResourceTypes

func (s *Monitoring) ResourceTypes() []string

type NetworkMonitor

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

func (*NetworkMonitor) DisplayStats

func (n *NetworkMonitor) DisplayStats(w io.Writer)

type Storage

type Storage struct {
	s3iface.S3API
	// contains filtered or unexported fields
}

func (*Storage) Fetch added in v0.1.3

func (s *Storage) Fetch(ctx context.Context) (*graph.Graph, error)

func (*Storage) FetchByType

func (s *Storage) FetchByType(ctx context.Context, t string) (*graph.Graph, error)

func (*Storage) IsSyncDisabled

func (s *Storage) IsSyncDisabled() bool

func (*Storage) Name

func (s *Storage) Name() string

func (*Storage) Region

func (s *Storage) Region() string

func (*Storage) ResourceTypes

func (s *Storage) ResourceTypes() []string

type UserPolicies

type UserPolicies struct {
	Username string
	Inlined  []string
	Attached []string
	ByGroup  map[string][]string
}

Jump to

Keyboard shortcuts

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