awscred

package module
v0.0.0-...-93506ed Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

AWS Credentials Package

The awscred package is an easy to use CLI for checking what AWS credentials are available in your .aws/credentials file and which of these credentials are valid.

Easily apply and run a command within the context of the desired profile.

Features

  • View available credentials.
  • Remove expired or invalid credentials from both .aws/credentials and .aws/config.
  • Apply a profile and use it to run a command with that profile set.

Installation

go install github.com/mauriceLC92/awscred/cmd/awscred

Usage

awscred print

print

awscred check

check

awscred apply workshop-admin

apply

awscred help

help

License

This package is licensed under the MIT License - see the LICENSE file for details.

Documentation

Index

Constants

View Source
const (
	AWS_CREDENTIALS = "$HOME/.aws/credentials"
	AWS_CONFIG      = "$HOME/.aws/config"

	HELP_PRINT = "print - Display all the credentials found in '.aws/credentials`."
	HELP_CHECK = "check - Checks and displays if the credentials found in '.aws/credentials` are valid or not."
	HELP_CLEAN = "clean - Removes any invalid credentials found from both '.aws/credentials` and '.aws/config`."
	HELP_APPLY = "" /* 133-byte string literal not displayed */
	HELP_HELP  = "help - Display a menu of the commands available and their descriptions. \n"
)

Variables

This section is empty.

Functions

func Apply

func Apply(profileName string)

func CheckCredentials

func CheckCredentials(credentials []Credential)

func Clean

func Clean(credentials []Credential)

func DeleteConfigByProfile

func DeleteConfigByProfile(profileName, filePath string) error

func DeleteCredentialByProfile

func DeleteCredentialByProfile(profileName, filePath string) error

func GenerateHelpMenu

func GenerateHelpMenu() string

func IsValidProfile

func IsValidProfile(profileName string) (err error)

func PrintHelpTo

func PrintHelpTo(w io.Writer, s string)

func PrintTo

func PrintTo(w io.Writer, credentials []Credential)

Types

type Credential

type Credential struct {
	ProfileName string
	AccessKeyId string
	Accesskey   string
}

func Parse

func Parse(filePath string) ([]Credential, error)

func (Credential) String

func (c Credential) String() string

Directories

Path Synopsis
cmd
awscred command

Jump to

Keyboard shortcuts

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