Documentation
¶
Index ¶
- Constants
- Variables
- func SetEnvironmentVariables(stackInfo *schema.ConfigAndStacksInfo, providerName, identityName string) error
- func SetupFiles(providerName, identityName string, creds types.ICredentials) error
- type AWSFileManager
- func (m *AWSFileManager) Cleanup(providerName string) error
- func (m *AWSFileManager) GetConfigPath(providerName string) string
- func (m *AWSFileManager) GetCredentialsPath(providerName string) string
- func (m *AWSFileManager) GetEnvironmentVariables(providerName, identityName string) []schema.EnvironmentVariable
- func (m *AWSFileManager) WriteConfig(providerName, identityName, region, outputFormat string) error
- func (m *AWSFileManager) WriteCredentials(providerName, identityName string, creds *types.AWSCredentials) error
Constants ¶
const ( PermissionRWX = 0o700 PermissionRW = 0o600 )
Variables ¶
var ( ErrGetHomeDir = errors.New("failed to get home directory") ErrCreateCredentialsFile = errors.New("failed to create credentials file") ErrCreateConfigFile = errors.New("failed to create config file") ErrLoadCredentialsFile = errors.New("failed to load credentials file") ErrLoadConfigFile = errors.New("failed to load config file") ErrWriteCredentialsFile = errors.New("failed to write credentials file") ErrWriteConfigFile = errors.New("failed to write config file") ErrSetCredentialsFilePermissions = errors.New("failed to set credentials file permissions") ErrSetConfigFilePermissions = errors.New("failed to set config file permissions") ErrProfileSection = errors.New("failed to get profile section") ErrCleanupAWSFiles = errors.New("failed to cleanup AWS files") )
Functions ¶
func SetEnvironmentVariables ¶
func SetEnvironmentVariables(stackInfo *schema.ConfigAndStacksInfo, providerName, identityName string) error
SetEnvironmentVariables sets the AWS_SHARED_CREDENTIALS_FILE and AWS_CONFIG_FILE environment variables.
func SetupFiles ¶
func SetupFiles(providerName, identityName string, creds types.ICredentials) error
SetupFiles sets up AWS credentials and config files for the given identity.
Types ¶
type AWSFileManager ¶
type AWSFileManager struct {
// contains filtered or unexported fields
}
AWSFileManager provides helpers to manage AWS credentials/config files.
func NewAWSFileManager ¶
func NewAWSFileManager() (*AWSFileManager, error)
NewAWSFileManager creates a new AWS file manager instance.
func (*AWSFileManager) Cleanup ¶
func (m *AWSFileManager) Cleanup(providerName string) error
Cleanup removes AWS files for the provider.
func (*AWSFileManager) GetConfigPath ¶
func (m *AWSFileManager) GetConfigPath(providerName string) string
GetConfigPath returns the path to the config file for the provider.
func (*AWSFileManager) GetCredentialsPath ¶
func (m *AWSFileManager) GetCredentialsPath(providerName string) string
GetCredentialsPath returns the path to the credentials file for the provider.
func (*AWSFileManager) GetEnvironmentVariables ¶
func (m *AWSFileManager) GetEnvironmentVariables(providerName, identityName string) []schema.EnvironmentVariable
GetEnvironmentVariables returns the AWS file environment variables as EnvironmentVariable slice.
func (*AWSFileManager) WriteConfig ¶
func (m *AWSFileManager) WriteConfig(providerName, identityName, region, outputFormat string) error
WriteConfig writes AWS config to the provider-specific file with identity profile.
func (*AWSFileManager) WriteCredentials ¶
func (m *AWSFileManager) WriteCredentials(providerName, identityName string, creds *types.AWSCredentials) error
WriteCredentials writes AWS credentials to the provider-specific file with identity profile.