resource

package
v0.0.0-...-f062a39 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(region string, config *configuration.Config, err error) error

func GetAvailableServices

func GetAvailableServices() *[]string

func LoadFromFile

func LoadFromFile(r Resource, filename string) error

func LoadResource

func LoadResource(r Resource, config *configuration.Config, region string) error

func LoadResources

func LoadResources(config *configuration.Config, region string, resources ...Resource) error

func SaveToFile

func SaveToFile(r Resource, filename string) error

Types

type Actions

type Actions []string

func (*Actions) UnmarshalJSON

func (a *Actions) UnmarshalJSON(b []byte) error

type Condition

type Condition struct {
	Bool map[string]string `json:",omitempty"`
	Null map[string]string `json:",omitempty"`
}

type Ec2s

type Ec2s []*ec2.Instance

func (*Ec2s) LoadFromAWS

func (e *Ec2s) LoadFromAWS(config *configuration.Config, region string) error

type IAMInfo

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

func (IAMInfo) GetUsers

func (iaminfo IAMInfo) GetUsers() Users

func (IAMInfo) HasRootAccessKeys

func (iaminfo IAMInfo) HasRootAccessKeys() bool

func (*IAMInfo) LoadFromAWS

func (iaminfo *IAMInfo) LoadFromAWS(config *configuration.Config, region string) error

type Images

type Images []*ec2.Image

func (*Images) FindByTags

func (im *Images) FindByTags(tags map[string]string) Images

func (*Images) LoadFromAWS

func (im *Images) LoadFromAWS(config *configuration.Config, region string) error

func (Images) SortByDate

func (im Images) SortByDate()

type KMSKey

type KMSKey struct {
	AliasArn  string
	AliasName string
	Custom    bool
	KeyId     string // the same as TargetKeyId in AliasListEntry
}

type KMSKeyAliases

type KMSKeyAliases []*kms.AliasListEntry

type KMSKeys

type KMSKeys struct {
	Values map[string]*KMSKey
	sync.RWMutex
}

func NewKMSKeys

func NewKMSKeys() *KMSKeys

NewKMSKeys : Initialize KMS Keys struct with map of keys

func (*KMSKeys) FindByKeyArn

func (k *KMSKeys) FindByKeyArn(keyArn string) *KMSKey

func (*KMSKeys) LoadAllFromAWS

func (k *KMSKeys) LoadAllFromAWS(config *configuration.Config) error

LoadAllFromAWS : Load KMS Keys from all regions

func (*KMSKeys) LoadFromAWS

func (k *KMSKeys) LoadFromAWS(config *configuration.Config, region string) error

type KMSKeysListEntries

type KMSKeysListEntries []*kms.KeyListEntry

type Principal

type Principal struct {
	Map      map[string][]string // Values in Map: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html
	Wildcard string              // Values: *
}

Principal : Specifies user, account, service or other

entity that is allowed or denied access to resource

func (*Principal) UnmarshalJSON

func (p *Principal) UnmarshalJSON(b []byte) error

type Resource

type Resource interface {
	LoadFromAWS(config *configuration.Config, region string) error
}

type Resources

type Resources []string

func (*Resources) UnmarshalJSON

func (r *Resources) UnmarshalJSON(b []byte) error

type S3Buckets

type S3Buckets []*S3Bucket

func (*S3Buckets) LoadFromAWS

func (b *S3Buckets) LoadFromAWS(config *configuration.Config, region string) error

func (*S3Buckets) LoadNames

func (b *S3Buckets) LoadNames(config *configuration.Config, region string) error

LoadNames : Get All S3 Bucket names

func (*S3Buckets) LoadRegions

func (b *S3Buckets) LoadRegions(config *configuration.Config, region string) error

type S3Policy

type S3Policy struct {
	Version    string
	Id         string      `json:",omitempty"`
	Statements []Statement `json:"Statement"`
}

func NewS3Policy

func NewS3Policy(s string) (*S3Policy, error)

type SecurityGroups

type SecurityGroups map[string][]*ec2.IpPermission

func (*SecurityGroups) GetIpPermissionsByID

func (s *SecurityGroups) GetIpPermissionsByID(groupID string) []*ec2.IpPermission

func (*SecurityGroups) LoadFromAWS

func (s *SecurityGroups) LoadFromAWS(config *configuration.Config, region string) error

type Snapshots

type Snapshots []*ec2.Snapshot

func (*Snapshots) FindById

func (s *Snapshots) FindById(id string) *ec2.Snapshot

func (*Snapshots) LoadFromAWS

func (s *Snapshots) LoadFromAWS(config *configuration.Config, region string) error

type Statement

type Statement struct {
	Effect    string
	Principal Principal `json:"Principal"`
	Actions   Actions   `json:"Action"`
	Resource  Resources `json:"Resource"`
	Condition Condition `json:",omitempty"`
}

type Users

type Users []*iam.UserDetail

type Volumes

type Volumes []*ec2.Volume

func (*Volumes) FindById

func (v *Volumes) FindById(id string) *ec2.Volume

func (*Volumes) LoadFromAWS

func (v *Volumes) LoadFromAWS(config *configuration.Config, region string) error

Jump to

Keyboard shortcuts

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