awsconfig

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2016 License: MIT Imports: 9 Imported by: 4

README

aws-sdk-go-config


import "github.com/tkuchiki/aws-sdk-go-config"

Usage

const (
	// DefaultProfile is default profile name
	DefaultProfile = "default"
)
func GetSharedConfigFile
func GetSharedConfigFile() string

GetSharedConfigFile returns the path to the shared config file

func GetProfile
func GetProfile() string

GetProfile returns the profile

func GetProfiles
func GetProfiles(configFile ...string) []string

GetProfiles returns the shared config file section names

func GetRegion
func GetRegion() string

GetRegion returns the region

func GetRegionFromConfigFile
func GetRegionFromConfigFile(configFile, profile string) (string, error)

GetRegionFromConfigFile returns the region from the shared config file

func GetRegionFromInstanceIdentityDocument
func GetRegionFromInstanceIdentityDocument() string

GetRegionFromInstanceIdentityDocument returns the region from the Instance Metadata

func GetSharedCredentialsFile
func GetSharedCredentialsFile() string

GetSharedCredentialsFile returns the path to the shared credentials file

func NewConfig
func NewConfig(opt Option) (*aws.Config, error)

NewConfig returns the *aws.Config

func NewCredentials
func NewCredentials(opt Option) *credentials.Credentials

NewCredentials returns the *credentials.Credentials

func NewSession
func NewSession(arg ...interface{}) (*session.Session, error)

NewSession returns the *session.Session.

The argument arg Option or *aws.Config

type Option
type Option struct {
	// AWS Access Key ID
	AccessKey string
	// AWS Access Secret Access Key
	SecretKey string
	// AWS Profile
	Profile string
	// Path to the shared config file
	Config string
	// Path to the shared credentials file
	Credentials string
	// AWS Session Token
	Token string
	// AWS Region
	Region string
}

Option is AWS Config options

Documentation

Index

Constants

View Source
const (
	// DefaultProfile is default profile name
	DefaultProfile = "default"
)

Variables

This section is empty.

Functions

func GetProfile

func GetProfile() string

GetProfile returns the profile

func GetProfiles

func GetProfiles(configFile ...string) []string

GetProfiles returns the shared config file section names

func GetRegion

func GetRegion() string

GetRegion returns the region

func GetRegionFromConfigFile

func GetRegionFromConfigFile(configFile, profile string) (string, error)

GetRegionFromConfigFile returns the region from the shared config file

func GetRegionFromInstanceIdentityDocument

func GetRegionFromInstanceIdentityDocument() string

GetRegionFromInstanceIdentityDocument returns the region from the Instance Metadata

func GetSharedConfigFile

func GetSharedConfigFile() string

GetSharedConfigFile returns the path to the shared config file

func GetSharedCredentialsFile

func GetSharedCredentialsFile() string

GetSharedCredentialsFile returns the path to the shared credentials file

func NewConfig

func NewConfig(opt Option) (*aws.Config, error)

NewConfig returns the *aws.Config

func NewCredentials

func NewCredentials(opt Option) *credentials.Credentials

NewCredentials returns the *credentials.Credentials

func NewSession

func NewSession(arg ...interface{}) (*session.Session, error)

NewSession returns the *session.Session.

The argument arg Option or *aws.Config

Types

type Option

type Option struct {
	// AWS Access Key ID
	AccessKey string
	// AWS Access Secret Access Key
	SecretKey string
	// AWS Profile
	Profile string
	// Path to the shared config file
	Config string
	// Path to the shared credentials file
	Credentials string
	// AWS Session Token
	Token string
	// AWS Region
	Region string
}

Option is AWS Config options

Jump to

Keyboard shortcuts

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