Documentation ¶
Index ¶
- func GetAWSAccountRole(accId string) string
- func GetAuth(accId string) (*aws.Auth, error)
- func Init(configPath ...string)
- func NewASClient(accId, region string) (*autoscaling.AutoScaling, error)
- func NewDynamoDBClient(accId, region string) (*dynamodb.Server, error)
- func NewEC2Client(accId, region string) (*ec2.EC2, error)
- func NewIamClient(accId, region string) (*iam.IAM, error)
- func NewS3Client(accId, region string) (*s3.S3, error)
- func NewSQSClient(accId, region string) (*sqs.SQS, error)
- type AWSAccount
- type AwsMgr
- func (m *AwsMgr) GetAWSAccountRole(accId string) string
- func (m *AwsMgr) GetAWSAccounts() []*AWSAccount
- func (m *AwsMgr) GetAuth(accId string) (*aws.Auth, error)
- func (m *AwsMgr) NewASClient(accId, region string) (*autoscaling.AutoScaling, error)
- func (m *AwsMgr) NewDynamoDBClient(accId, region string) (*dynamodb.Server, error)
- func (m *AwsMgr) NewEC2Client(accId, region string) (*ec2.EC2, error)
- func (m *AwsMgr) NewIamClient(accId, region string) (*iam.IAM, error)
- func (m *AwsMgr) NewS3Client(accId, region string) (*s3.S3, error)
- func (m *AwsMgr) NewSQSClient(accId, region string) (*sqs.SQS, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAWSAccountRole ¶
func Init ¶
func Init(configPath ...string)
Init initialises the package mgr configPath determines where the awsAccounts config is stored in the config service in respect to your service For example hailo/service/foo/awsAccounts.
func NewASClient ¶
func NewASClient(accId, region string) (*autoscaling.AutoScaling, error)
Types ¶
type AWSAccount ¶
type AWSAccount struct { Id string `json:"id"` Regions []string `json:"regions"` SNSRole string `json:"snsRole"` }
AWSAccount holds aws credentials and can be marshlled to/from JSON stored in the config service Params Id - the AWS Account id Regions - the supported regions for this account (currently we support eu-west-1, us-east-1 and ap-northeast-1). You might want to restrict the regions to only the local region depending on your use case SNSRole - the designated role for your service for this account
func GetAWSAccounts ¶
func GetAWSAccounts() []*AWSAccount
func (*AWSAccount) String ¶
func (a *AWSAccount) String() string
type AwsMgr ¶
type AwsMgr struct { sync.RWMutex Accounts []*AWSAccount // contains filtered or unexported fields }
AwsMgr encapsulates an AWS Manager object
func (*AwsMgr) GetAWSAccountRole ¶
Returns the role for a specific account
func (*AwsMgr) GetAWSAccounts ¶
func (m *AwsMgr) GetAWSAccounts() []*AWSAccount
Returns the configured AWS accounts from the config
func (*AwsMgr) NewASClient ¶
func (m *AwsMgr) NewASClient(accId, region string) (*autoscaling.AutoScaling, error)
NewASClient returns a new AutoScaling client
func (*AwsMgr) NewDynamoDBClient ¶
NewDynamoDB returns a new DynamoDB client
func (*AwsMgr) NewEC2Client ¶
NewEC2Client returns a new EC2 client
func (*AwsMgr) NewIamClient ¶
NewIamClient returns a new Iam client
func (*AwsMgr) NewS3Client ¶
NewS3Client returns a new S3 client