{"id":17808161,"url":"https://github.com/kherge/rs.aws-login","last_synced_at":"2025-03-17T15:30:34.109Z","repository":{"id":39657022,"uuid":"437181523","full_name":"kherge/rs.aws-login","owner":"kherge","description":"A command line utility to simplify logging into AWS services.","archived":false,"fork":false,"pushed_at":"2022-05-29T00:55:56.000Z","size":655,"stargazers_count":13,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T00:51:07.940Z","etag":null,"topics":["aws","cli","command-line"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kherge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-11T03:53:02.000Z","updated_at":"2023-05-22T17:21:07.000Z","dependencies_parsed_at":"2022-09-19T09:10:28.667Z","dependency_job_id":null,"html_url":"https://github.com/kherge/rs.aws-login","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kherge%2Frs.aws-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kherge%2Frs.aws-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kherge%2Frs.aws-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kherge%2Frs.aws-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kherge","download_url":"https://codeload.github.com/kherge/rs.aws-login/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243865485,"owners_count":20360449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cli","command-line"],"created_at":"2024-10-27T15:08:53.593Z","updated_at":"2025-03-17T15:30:33.811Z","avatar_url":"https://github.com/kherge.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"aws-login\n=========\n\nA command line utility to simplify logging into AWS accounts and services.\n\n```\n$ aws-login use\n? Please select a profile to use: ›\n❯ dev-read\n  dev-write\n\n$ echo $AWS_PROFILE\ndev-read\n\n$ aws-login use --profile dev-write\n\n$ echo $AWS_PROFILE\ndev-write\n```\n\nTable of Contents\n-----------------\n\n- [Requirements](#requirements)\n    - [Development](#development)\n- [Installation](#installation)\n    - [macOS](#macos)\n- [Usage](#usage)\n    - [Configuring Docker to use ECR](#configuring-docker-to-use-ecr)\n    - [Configure `kubectl` to use EKS](#configure-kubectl-to-use-eks)\n    - [Log into an AWS account using SSO portal](#log-into-an-aws-account-using-aws-sso-portal)\n    - [Setting up and activating AWS CLI profiles](#setting-up-and-activating-aws-cli-profiles)\n        - [Working with profile templates](#working-with-profile-templates)\n    - [Downloading and installing profile templates](#downloading-and-installing-profile-templates)\n\nRequirements\n------------\n\n- AWS CLI v2\n\n### Development\n\n- Rust 1.57\n\nInstallation\n------------\n\n1. Go to the [Releases] page.\n2. Download a release for your OS.\n3. Unzip the release.\n    - `unzip -j aws-login_linux_amd64.zip`\n4. Make `aws-login` executable.\n    - `chmod 755 aws-login`\n5. Move `aws-login` to somewhere in your `$PATH`.\n6. Run `aws-login shell install -s $SHELL`, where `$SHELL` is your supported shell.\n    - See `aws-login shell --help` for a list of supported shells.\n7. Start a new shell session.\n\n[Releases]: https://github.com/kherge/rs.aws-login/releases/latest\n\n### macOS\n\nOn more recent versions of macOS, Gatekeeper will block your attempt to run the application because it is not signed with an Apple Developer certificate. Please see [this guide](https://github.com/kherge/rs.aws-login/wiki/Running-in-macOS) on how to work around this issue.\n\nUsage\n-----\n\nBefore we dive into using the application, you need to be aware of how profiles work with the AWS CLI. The official AWS CLI supports the use of profiles so that information such as accounts, roles, and preferences are remembered. This saves you from having to provide that information each time you want to do something.\n\nThe `aws-login` utility attempts to take full advantage of AWS CLI profiles. When \"active AWS CLI profile\" is mentioned, it means one of two things:\n\n- The value of the `AWS_PROFILE` environment variable.\n- Or \"default\".\n\nBy default, everything you do with `aws-login` will use the profile found in one of the places mentioned above and in the order they are listed. However, like AWS CLI, you can change the profile you are working with by using the `--profile` option.\n\n### Configuring Docker to use ECR\n\n    aws-login ecr\n\nThis subcommand will configure Docker to use the Elastic Container Registry in the AWS account for your active AWS CLI profile. If the region for your ECR differs from the default region configured for your profile, remember to specify it with the `--region` option.\n\n### Configure `kubectl` to use EKS\n\n    aws-login eks\n\nThis subcommand will prompt you to choose an EKS cluster from a list found in the AWS account for your active AWS CLI profile. Once a selection is made, the configuration for `kubectl` is updated to support connecting to that EKS cluster. Remember to log in before attempting to do so, fresh credentials may be required.\n\n### Log into an RDS Proxy using IAM\n\n    aws-login rds $USERNAME\n\nThis subcommand will prompt you to choose an RDS Proxy from a list found in the AWS account for your active AWS CLI profile. Once a selection is made, the database authentication token will be generated for you to use in your preferred database client.\n\n\u003e It is important to note that generating a token will almost always succeed, even if you do not have permission to access the RDS Proxy endpoint. If authentication fails, you will want to check a few things:\n\u003e\n\u003e 1. Make sure your TLS settings match.\n\u003e 2. Make sure you are using the correct AWS CLI profile.\n\u003e 3. Make sure your role has the IAM `rds-db:connect` permission.\n\n### Log into an AWS account using AWS SSO portal\n\n    aws-login sso\n\nThis subcommand will use the AWS SSO portal settings in your active AWS CLI profile for authentication. If the required settings are missing, you will be prompted to provide them before authentication can proceed.\n\n### Setting up and activating AWS CLI profiles\n\n    aws-login use\n\nThis subcommand will prompt you to selected from a list of existing AWS CLI profiles and available profile templates. If a profile template is selected and a corresponding AWS CLI profile does not already exist, it will be automatically configured using the template. Once a selection has been made, the shell environment is modified to make it the active AWS CLI profile for the duration of the shell session.\n\n#### Working with profile templates\n\nThe `use` subcommand does not simply offer you the ability to select existing AWS CLI profiles, but also offers the ability to use profile templates to configure new AWS CLI profiles. These templates are stored in JSON file called `templates.json` (found in `~/.config/aws-login/` or `%APPDATA\\Roaming\\AWS Login\\`).\n\nThis is what a collection of profile templates looks like:\n\n```json\n{\n    \"base\": {\n        \"enabled\": false,\n        \"settings\": {\n            \"output\": \"json\",\n            \"region\": \"us-east-1\",\n            \"sso_region\": \"us-east-1\",\n            \"sso_start_url\": \"https://my-sso-portal.awsapps.com/start\"\n        }\n    },\n    \"dev-read\": {\n        \"extends\": \"base\",\n        \"settings\": {\n            \"sso_account_id\": 123456789012,\n            \"sso_role_name\": \"ReadOnly\"\n        }\n    },\n    \"dev-write\": {\n        \"extends\": \"dev-read\",\n        \"settings\": {\n            \"sso_role_name\": \"Developer\"\n        }\n    }\n}\n```\n\nThe `base` profile template serves as the foundation for other templates to build upon. It provides some common settings such as where the SSO portal is located. Because this is not a fully configured profile, and is intended to be used by other templates, `enabled` is set to `false` so that it is not listed as an option to select from when `aws-login use` is run.\n\nThe `dev-read` profile template uses the `base` template by specifying it under the `extends` key, and adds its own SSO settings that make it ready to be used for authentication. If `dev-read` provided its own `region`, it would override the `region` set by the base profile.\n\nThe `dev-write` profile template demonstrates that your profile dependency tree can go as deep as you need. In this template, we re-use all of the settings from `dev-read` (and consequently, `base`) but override the `sso_role_name` we want to use.\n\n##### Okay, but why?\n\nHere is an example scenario:\n\nYou are a new hire at a company that hosts all of their services in AWS. As part of the onboarding process, you work on setting up your workstation so that you can use AWS CLI to interact with the cloud environment. Instead of asking around, searching Confluence/Sharepoint/etc, or figuring it out on your own, you install `aws-login` and run the `pull` subcommand with a URL you were provided.\n\nYou now have immediate access to various AWS accounts and services.\n\n### Downloading and installing profile templates\n\n\u003e You may want to familiarize yourself with this first:\n\u003e [Setting up and activating AWS CLI profiles](#setting-up-and-activating-aws-cli-profiles)\n\n    aws-login pull https://www.example.com/path/to/templates.json\n\nThis subcommand will download a remote profile templates file and store a copy for later use. If a local templates file already exists, you will be asked if you would like to merge with the existing file or replace it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkherge%2Frs.aws-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkherge%2Frs.aws-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkherge%2Frs.aws-login/lists"}