common

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvironmentVars

func GetEnvironmentVars() map[string]string

Types

type AMISelection

type AMISelection struct {
	Copy    bool     `yaml:"copy"` // TODO: flag for copying AMIs not implemented yet
	Regions []string `yaml:"regions"`
	Filters []Filter `yaml:"filters"`
}

type Account

type Account struct {
	ID            string                  `yaml:"id"`
	Alias         string                  `yaml:"alias"`
	AssumeRole    string                  `yaml:"assume-role"`
	PostShareTags map[string]string       `yaml:"post-share-tags,omitempty"`
	Regions       []string                `yaml:"regions,omitempty"`
	AMIs          map[string]AMISelection `yaml:"amis,omitempty"`
}

func (*Account) GenerateRoleARN

func (account *Account) GenerateRoleARN()

role ARN format: arn:aws:iam::account-id:role/role-name

type Config

type Config struct {
	SourceAccount  Account   `yaml:"source-account"`
	TargetAccounts []Account `yaml:"target-accounts"`
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

func (*Config) CreateRoleARNs

func (config *Config) CreateRoleARNs()

func (*Config) ScanRegions

func (config *Config) ScanRegions() []string

func (*Config) Validate

func (config *Config) Validate() error

type Filter

type Filter struct {
	Property string `yaml:"property"`
	Value    string `yaml:"value"`
	Invert   bool   `yaml:"invert"`
}

func (Filter) String

func (filter Filter) String() string

type Image

type Image interface {
	Properties() types.Properties
	Date() time.Time
	String() string

	Match(Filter) bool
	AddTags(map[string]string, bool) error
	ShareWithAccount(string, bool) error
	CopyTags(*session.Session, bool) error
	MarshalYAML() (interface{}, error)
}

type Images

type Images []Image

For sorting images images must be sortable (by date) for determining most recent

func ApplyFilters

func ApplyFilters(images Images, filters []Filter) Images

Given a list of images apply a set of filters and pick the latest image

func (Images) Len

func (e Images) Len() int

func (Images) Less

func (e Images) Less(i, j int) bool

func (Images) Swap

func (e Images) Swap(i, j int)

type ShareParams

type ShareParams struct {
	Config         *Config
	NoDryRun       bool
	ShareSnapshots bool
	PlanFile       string
}

Jump to

Keyboard shortcuts

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