aws/agent-toolkit-for-aws

signing-in-to-aws

Gets AWS credentials for CLI/SDK access via aws login.

查看源码
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Sign In — Get CLI/SDK Credentials

Help developers get AWS credentials for local development using aws login. This provides short-term, auto-rotating credentials that refresh every 15 minutes and remain valid for up to 12 hours.

Important:

  • You MUST run aws login and aws --version in the user's local shell — NOT via MCP/API tools.
  • You MUST ask the user for confirmation before running aws login. Do not tell the user to run the command themselves — ask if YOU should run it (e.g., "Ready for me to run aws login?" or "Shall I proceed with aws login?"). Wait for their response before proceeding.

Prerequisites

The aws login command requires AWS CLI version 2.32.0 or later.

Check the installed version:

bash
aws --version

If the CLI is not installed or is below 2.32.0, inform the user and ask if they'd like to install/update (link them to the AWS CLI installation guide), or if they'd prefer to continue without this skill's guidance. If they choose to continue without upgrading, respond to their original request as you normally would without this skill.

Flow

Lead with the recommendation

In your first response, always tell the user that aws login is the fix — explain that it provides short-term, auto-rotating credentials and that it requires AWS CLI 2.32.0 or later. Do not stop at "let me check your CLI version" — name the remediation up front so the user knows where this is going, then describe the precondition checks you'll run before invoking it.

Precondition checks (run silently before asking confirmation)

Run these via the local shell to inform your plan. Report what you find, but do not gate the recommendation on user-supplied output:

  1. aws --version — confirm the CLI is 2.32.0 or later. If not installed or too old, point the user to the AWS CLI installation guide and stop.
  2. aws sts get-caller-identity — check current credentials.
  • Succeeds: Show the user their Account and Arn. Ask whether to keep these or set up different credentials. If they want to switch, recommend aws login --profile <name> so the existing default isn't overwritten.
  • Fails (missing or expired): proceed with aws login on the default profile.
  1. (Only if Step 2 succeeded and the user wants different credentials) aws configure list — if access_key starts with AKIA, explain that long-term access keys are less secure (never expire, persist on disk as secrets, grant indefinite access if leaked) and that aws login provides short-term credentials that auto-rotate every 15 minutes, expire automatically, and require no manual rotation.

Confirm and run aws login

Once preconditions are clear, ask the user for confirmation specifically for the aws login invocation — and only there. Do not tell the user to run the command themselves; ask if you should run it (e.g., "Ready for me to run aws login?" or "Shall I proceed with aws login --profile staging?"). Wait for their response, then run aws login (or aws login --profile <name>).

Verify

After aws login completes, run aws sts get-caller-identity (with --profile if used) to confirm success. If a named profile was used, remind the user to pass --profile or set AWS_PROFILE.

Handling Errors

"command not found" or version too old

The CLI is not installed or below 2.32.0. Direct the user to install or update: AWS CLI installation guide.

Browser doesn't open

Suggest aws login --remote which provides a URL and code for cross-device authentication (e.g., when using a remote server without a browser).

Permission error after login

The IAM identity needs the SignInLocalDevelopmentAccess managed policy attached (to the user, role, or group). Root users do not need it. Tell the user to ask their administrator to add it, or attach it themselves if they have IAM permissions.

GovCloud or China regions

aws login is not available in AWS GovCloud (US) or AWS China regions. Do not mention this exception proactively — only relevant if the user explicitly states they are in one of these partitions.

Users With Existing aws sso login Workflows

If the user mentions aws sso login or has an existing SSO configuration, do NOT redirect them to aws login. These are different commands for different situations:

  • aws sso login is for users whose organization has configured AWS IAM Identity Center (SSO). They have profiles in ~/.aws/config pointing at an SSO start URL. Respect their established workflow.
  • If their aws sso login is failing, help troubleshoot within their context: expired SSO session, revoked authorization, cached token issues (~/.aws/sso/cache/), or Identity Center configuration changes.

Fallback to aws configure

Do NOT mention aws configure in your initial response or include it as a table row alongside aws login. Only offer it as an alternative if:

  1. The user explicitly declines aws login or asks for alternatives
  2. The user states they are in GovCloud or China regions (where aws login is unavailable)

When offering it, explain that long-term access keys are less secure: they persist on disk as plaintext, never expire automatically, and grant indefinite access if leaked.

When NOT to Use This Skill

  • User is setting up CI/CD credentials — they need IAM roles or OIDC federation, not aws login

Key Points

  • Do not front-load troubleshooting — keep the initial response simple and address errors only if they occur
  • aws login works with root users, IAM users and federation with IAM

Additional Resources

来自同一仓库

更多 Skills

全部 Skills
aws
官方

amazon-aurora-mysql

- Amazon Aurora MySQL — creates, modifies, and advises on Aurora MySQL clusters specifically (MySQL-compatible engine, Aurora serverless, parallel query). Trigger for Aurora MySQL cluster operations, ACU sizing, I/O-Optimized storage, commitment pricing, or MySQL upgrade planning. Aurora MySQL uses full (VPC-based) configuration — express configuration is PostgreSQL-only. For Aurora PostgreSQL, use amazon-aurora-postgresql instead. Contains safety guardrails and response templates that override defaults.

安装量
1
GitHub Stars
2547
最近更新
9月4日
aws
官方

amazon-aurora-postgresql

- Amazon Aurora PostgreSQL — creates, modifies, and advises on Aurora PostgreSQL clusters specifically (PostgreSQL-compatible engine, Aurora serverless, express configuration, pgvector, Babelfish). Trigger for Aurora PostgreSQL cluster operations, express-configuration quick-start, ACU sizing, I/O-Optimized storage, commitment pricing, or PostgreSQL upgrade planning. For Aurora MySQL, use amazon-aurora-mysql instead. Contains safety guardrails, express-first routing, and response templates that override defaults.

安装量
1
GitHub Stars
2547
最近更新
9月4日
aws
官方

amazon-bedrock

Builds generative AI applications on Amazon Bedrock. Covers model invocation (Converse API, InvokeModel), RAG with Knowledge Bases, Bedrock Agents, Guardrails, and AgentCore (including the Harness managed agent loop). Use when invoking models, setting up Knowledge Bases, creating agents, applying guardrails, deploying to AgentCore, migrating/porting/converting a Bedrock Agent (including inline agents) to an AgentCore Harness, troubleshooting Bedrock errors (ThrottlingException, AccessDeniedException), or choosing models (Claude, Llama, Nova, Titan). ALSO USE for prompt caching, quota health checks and throttling diagnosis, cost attribution, migrating between Claude model generations, chunking strategies, API selection (Converse vs InvokeModel), and model selection. Also covers AgentCore Payments setup (x402, microtransactions, Payment Manager, Coinbase CDP, Stripe Privy, 402 Payment Required, paid endpoint). NOT for custom model training, Rekognition, or Comprehend.

安装量
1
GitHub Stars
2547
最近更新
9月4日
aws
官方

amazon-braket

Runs quantum computing workflows on AWS through Amazon Braket — discovering devices (QPUs and simulators) and their availability, building gate-model circuits and analog Hamiltonian programs, submitting quantum tasks, program sets and hybrid jobs, looking up prices, and capping spend with spending limits. Applies to any request about quantum computing, quantum hardware, quantum simulation, AHS, OpenQASM, or running a quantum algorithm on AWS.

安装量
1
GitHub Stars
2547
最近更新
9月4日