awsconsole

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

README

awsconsole

This is a simple tool to open AWS Management Console from your terminal by SSO login.

It opens the console with specified AWS Account and IAM Role.

Prerequisites

  • Golang 1.21 or later
  • ~/.aws/config is configured for SSO login

Installation

$ go install github.com/x-color/awsconsole@latest

Usage

First, you need to login AWS by SSO to get your AWS Accounts information.

$ aws sso login

Next, run the following comamnd to generate AWS account list file(~/.aws/cli/awsconsole.json).

$ awsconsole -update

After generating the file, you can open AWS console by the following command. This command opens interactive prompt to select AWS account and IAM role.

$ awsconsole

*If you want to use another profile, you can specify it by AWS_PROFILE environment variable.

Optional setting

You can simplify accessing the AWS Management Console by an alias for awsconsole command in AWS CLI, making it quicker.

If you add the following setting to your ~/.aws/cli/alias,

[toplevel]
console = !f() {
    awsconsole $@
}; f

You can access the AWS Management Console by the following command.

$ aws console

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAccountsRolesFile

func GenerateAccountsRolesFile(profileName string) error

func Jump

func Jump(profileName string) error

Types

type AccountRole

type AccountRole struct {
	AccountID   string `json:"accountID"`
	AccountName string `json:"accountName"`
	RoleName    string `json:"roleName"`
}

func (AccountRole) String

func (a AccountRole) String() string

func (AccountRole) URL

func (a AccountRole) URL(baseURL string) string

type Instance

type Instance struct {
	SsoURL       string        `json:"ssoUrl"`
	AccountRoles []AccountRole `json:"accountRoles"`
}

type Store

type Store struct {
	Instances []Instance `json:"instances"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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