awsprofile

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package awsprofile provides utilities for creating and deleting AWS Profile (i.e., credentials & config files).

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCredentials = errors.New("aws-profile: Invalid AWS Credentials")

ErrInvalidCredentials is returned when given AWS Credentials contains invalid characters.

Functions

func Cleanup

func Cleanup(settings Settings) error

Cleanup cleans up credentials and config files created via Create.

Types

type Credentials

type Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
}

Credentials represents long-term AWS credentials used to create an AWS Profile.

type Profile

type Profile struct {
	// Name is the AWS profile name
	Name string
	// ConfigFilename is the name of the AWS config file
	ConfigFilename string
	// CredentialsFilename is the name of the AWS credentials file
	CredentialsFilename string
}

Profile represents an AWS profile with it's credentials and config filenames.

func Create

func Create(settings Settings, credentials Credentials) (Profile, error)

Create creates an AWS Profile with credentials and config files from given credentials. Created credentials and config files can be clean up with Cleanup.

type Settings

type Settings struct {
	// Basepath is the directory path where AWS profile files will be created
	Basepath string
	// Prefix is prepended to generated filenames for uniqueness
	Prefix string
	// FilePerm specifies the file permissions for created profile files
	FilePerm fs.FileMode
}

Settings contains configuration for AWS profile creation and management.

Directories

Path Synopsis
Package awsprofiletest provides testing utilities for AWS Profiles.
Package awsprofiletest provides testing utilities for AWS Profiles.

Jump to

Keyboard shortcuts

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