aws

package
v0.0.0-...-d535130 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var DefaultAMIUsers = []string{"ec2-user", "ubuntu", "centos", "bitnami", "admin", "root"}
View Source
var ErrFieldNotFound = errors.New("aws struct field not found")
View Source
var ErrTagNotFound = errors.New("aws tag key not found")
View Source
var ParentNotFound = errors.New("empty field to add parent")
View Source
var ResourceTypesPerAPI = map[string][]string{
	"ec2": []string{
		"instance",
		"subnet",
		"vpc",
		"keypair",
		"securitygroup",
		"volume",
		"internetgateway",
		"routetable",
	},
	"iam": []string{
		"user",
		"group",
		"role",
		"policy",
	},
	"s3": []string{
		"bucket",
		"storageobject",
	},
}
View Source
var ServiceNames = []string{}
View Source
var ServicePerAPI = map[string]string{
	"ec2": "infra",
	"iam": "access",
	"s3":  "storage",
}
View Source
var ServicePerResourceType = map[string]string{
	"instance":        "infra",
	"subnet":          "infra",
	"vpc":             "infra",
	"keypair":         "infra",
	"securitygroup":   "infra",
	"volume":          "infra",
	"internetgateway": "infra",
	"routetable":      "infra",
	"user":            "access",
	"group":           "access",
	"role":            "access",
	"policy":          "access",
	"bucket":          "storage",
	"storageobject":   "storage",
}

Functions

func AllRegions

func AllRegions() []string

func InitServices

func InitServices(region string) error

func InitSession

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

func IsValidRegion

func IsValidRegion(given string) bool

Types

type Access

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

func NewAccess

func NewAccess(sess *session.Session) *Access

func (*Access) FetchByType

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

func (*Access) FetchResources

func (s *Access) FetchResources() (*graph.Graph, error)

func (*Access) Name

func (s *Access) Name() string

func (*Access) Provider

func (s *Access) Provider() string

func (*Access) ProviderAPI

func (s *Access) ProviderAPI() string

func (*Access) ProviderRunnableAPI

func (s *Access) ProviderRunnableAPI() interface{}

func (*Access) ResourceTypes

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

type Infra

type Infra struct {
	ec2iface.EC2API
	// contains filtered or unexported fields
}

func NewInfra

func NewInfra(sess *session.Session) *Infra

func (*Infra) FetchByType

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

func (*Infra) FetchResources

func (s *Infra) FetchResources() (*graph.Graph, error)

func (*Infra) Name

func (s *Infra) Name() string

func (*Infra) Provider

func (s *Infra) Provider() string

func (*Infra) ProviderAPI

func (s *Infra) ProviderAPI() string

func (*Infra) ProviderRunnableAPI

func (s *Infra) ProviderRunnableAPI() interface{}

func (*Infra) ResourceTypes

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

type Security

type Security interface {
	stsiface.STSAPI
	GetUserId() (string, error)
	GetAccountId() (string, error)
}
var (
	AccessService, InfraService, StorageService cloud.Service

	SecuAPI Security
)

func NewSecu

func NewSecu(sess *session.Session) Security

type Storage

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

func NewStorage

func NewStorage(sess *session.Session) *Storage

func (*Storage) FetchByType

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

func (*Storage) FetchResources

func (s *Storage) FetchResources() (*graph.Graph, error)

func (*Storage) Name

func (s *Storage) Name() string

func (*Storage) Provider

func (s *Storage) Provider() string

func (*Storage) ProviderAPI

func (s *Storage) ProviderAPI() string

func (*Storage) ProviderRunnableAPI

func (s *Storage) ProviderRunnableAPI() interface{}

func (*Storage) ResourceTypes

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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