aws-sso-login
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAWS SSO Login
AWS SSO 登录
A skill to authenticate to AWS using Single Sign-On (SSO) for a specified profile.
一项针对指定配置文件,使用单点登录(SSO)对AWS进行身份验证的Skill。
Purpose
用途
Perform SSO authentication before executing AWS CLI operations. SSO sessions typically expire after 8-12 hours, requiring re-authentication.
在执行AWS CLI操作前完成SSO身份验证。SSO会话通常会在8-12小时后过期,需要重新验证。
Input Parameters
输入参数
- : AWS CLI profile name configured for SSO (default: defined by project, e.g.,
profile)web-hosting- If the profile name is not known/available from project docs or prior context, ask the user which AWS CLI profile to use before running this skill.
- :为SSO配置的AWS CLI配置文件名称(默认值:由项目定义,例如
profile)web-hosting- 如果无法从项目文档或上下文信息中获取配置文件名称,请在运行此Skill前询问用户要使用哪个AWS CLI配置文件。
Execution Steps
执行步骤
- Execute command with the specified profile
aws sso login - Open browser automatically (or provide a URL to open manually)
- Complete authentication in the browser
- Confirm successful authentication
- 使用指定的配置文件执行命令
aws sso login - 自动打开浏览器(或提供URL供手动打开)
- 在浏览器中完成身份验证
- 确认身份验证成功
Command Example
命令示例
bash
undefinedbash
undefinedLogin with SSO using specified profile
Login with SSO using specified profile
aws sso login --profile <profile-name>
undefinedaws sso login --profile <profile-name>
undefinedProject Configuration
项目配置
- Document the default profile name (e.g., ) in a separate project guide such as
web-hostingor a skill configuration file..github/skills/README.md - Refer to that document when invoking this Skill so the same definition can be reused across repositories without editing the Skill itself.
- 在单独的项目指南(如或Skill配置文件)中记录默认配置文件名称(例如
.github/skills/README.md)。web-hosting - 调用此Skill时参考该文档,这样无需修改Skill本身,就能在多个仓库中复用相同的定义。
Output
输出
After successful authentication:
- SSO session is established and cached locally
- AWS CLI commands can be executed using the specified profile
- Session remains valid for the configured duration (typically 8-12 hours)
身份验证成功后:
- SSO会话已建立并在本地缓存
- 可使用指定的配置文件执行AWS CLI命令
- 会话在配置的时长内保持有效(通常为8-12小时)
Usage Examples
使用示例
After executing this skill, AWS CLI commands with the profile become available:
bash
undefined执行此Skill后,即可使用带该配置文件的AWS CLI命令:
bash
undefinedVerify authentication
Verify authentication
aws sts get-caller-identity --profile <profile-name>
aws sts get-caller-identity --profile <profile-name>
Assume a role (often used after SSO login)
Assume a role (often used after SSO login)
aws sts assume-role --role-arn <role-arn> --role-session-name <session-name> --profile <profile-name>
undefinedaws sts assume-role --role-arn <role-arn> --role-session-name <session-name> --profile <profile-name>
undefinedPrerequisites
前置条件
- AWS CLI v2 installed (SSO support requires v2 or later)
- SSO configuration set up in for the specified profile
~/.aws/config - Web browser available for authentication
- Network access to the SSO authentication endpoint
- 已安装AWS CLI v2版本(SSO支持需要v2或更高版本)
- 已在中为指定配置文件完成SSO配置
~/.aws/config - 具备可用于身份验证的网页浏览器
- 能够访问SSO身份验证端点的网络环境
Notes
注意事项
- SSO sessions expire after a configured duration (typically 8-12 hours)
- When the session expires, re-execute this skill to re-authenticate
- Browser-based authentication is required; this cannot be fully automated
- For headless environments, consider using flag and manually opening the provided URL
--no-browser - This skill should be executed before the skill if role assumption requires SSO authentication
assume-cloudformation-role
- SSO会话会在配置的时长后过期(通常为8-12小时)
- 会话过期后,重新执行此Skill以完成身份验证
- 必须基于浏览器进行身份验证,无法完全自动化
- 对于无界面环境,可考虑使用参数并手动打开提供的URL
--no-browser - 如果角色假设需要SSO身份验证,则应在执行Skill前先执行此Skill
assume-cloudformation-role