跳到正文
cccskills
免费在 GitHub 公开

hf-cloud-aws-context-discovery

Check the AWS profile, region, account ID, and caller identity before starting AWS work. Read local configuration and validate credentials, then flag missing settings, expired access, or possible IAM restrictions associated with SSO authentication.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Discover the user's local AWS context (active profile, region, account ID, caller identity) at the start of any AWS task. Use this skill before any other AWS work — deploying to SageMaker, creating resources, calling AWS APIs, or anything that touches an AWS account. Use it especially when the user has not specified a region or profile explicitly, when they say things like "use my AWS account", "deploy to AWS", "use my profile", or when about to make any AWS CLI or SDK call. Never guess the region or account ID — always use this skill to read it from the local configuration first.

集成工具AWS
查看安装方法

适用场景

  • Check the AWS account and region before deployment
  • Identify the active profile when none was specified
  • Detect expired credentials or missing configuration
  • Check SSO identity before planning IAM role creation

包含的文件(1)

  • SKILL.md3.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

AWS Context Discovery

Before doing any AWS work, read the user's local AWS config. Don't guess the region, and don't ask the user for things their config already answers.

What to discover

Run these at the start of the AWS work and remember the results for the rest of the session.

1. Active profile

AWS_PROFILE env var, else default. If the user mentioned a profile in their prompt, that overrides. If the named profile doesn't exist in ~/.aws/config, surface that clearly.

2. Region

Resolution order — stop at the first one that produces a value:

  1. Region the user explicitly named in this conversation
  2. AWS_REGION env var
  3. AWS_DEFAULT_REGION env var
  4. region field on the active profile in ~/.aws/config
  5. Ask the user — but only after the first four have failed

Do not fall back to us-east-1 or any other hardcoded default.

3. Credentials, account ID, caller ARN

aws sts get-caller-identity --profile <profile> --region <region>

Three purposes in one call: confirms credentials are valid (stop if not), returns the Account ID (needed for ARN construction), returns the Arn of the caller.

4. Identify SSO / assumed-role principals

The Arn field tells you what kind of principal this is. The pattern matters because it determines what IAM operations the caller can do.

ARN patternTypeIAM write capability
arn:aws:iam::<acct>:user/<name>IAM userDepends on attached policies
arn:aws:sts::<acct>:assumed-role/AWSReservedSSO_<...>/<email>SSO assumed-roleTypically none — can't create/modify IAM roles
arn:aws:sts::<acct>:assumed-role/<role>/<session>Regular assumed-roleDepends on the role

If the caller is SSO, surface this immediately before later skills hit iam:CreateRole and fail:

Heads up: you're authenticated via SSO (AWSReservedSSO_<PermissionSet>_...). SSO principals usually can't create IAM roles directly. If we need a SageMaker execution role, I'll look for an existing one first — if none exists, you'll need to ask whoever manages your AWS access to create one.

This is the highest-leverage thing this skill does. Surfacing it now turns a confusing mid-deployment error into a five-second conversation.

Commands to run

# Effective profile and region (faster than parsing config files)
aws configure list

# Validate credentials and get identity
aws sts get-caller-identity
aws sts get-caller-identity --profile <profile-name>  # if a profile was named

aws configure list handles env-var overrides and shows the resolved effective values. Prefer it over parsing ~/.aws/config yourself. If you need to read raw config (e.g. to list profiles), ~/.aws/config and ~/.aws/credentials are plain INI files — read-only.

What to report back

One or two lines, not a wall of text:

Working with profile my-profile in eu-west-1, account 123456789012. You're authenticated via SSO, so we'll need to use an existing IAM role rather than create one.

Don't ask the user to confirm the region you just read from their config — they configured it; that is the confirmation.

If something is wrong (credentials expired, profile doesn't exist, no region anywhere), stop and surface the specific error before continuing.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

hf-cli

免费

Manage Hugging Face Hub through the hf command line tool. Download and upload models or datasets, organize cloud storage, manage authentication and local caches, run scheduled jobs, and deploy or maintain model inference services.

中文简介正在准备中。当前显示英语简介。

  • Download or publish models and datasets
  • Sync training checkpoints to cloud storage
  • Inspect and clean the local cache
huggingface/skills1.1万2026年10月9日 更新

Prepare an isolated Python environment for SageMaker deployments and AWS automation. The skill selects a supported Python version, installs current AWS packages, and checks versions so installation and execution use the same environment.

中文简介正在准备中。当前显示英语简介。

  • Prepare a Python environment for SageMaker deployment
  • Separate AWS automation dependencies from system Python
  • Check installed AWS package versions
huggingface/skills1.1万2026年10月9日 更新

Plan how to serve a model on Amazon SageMaker AI. The skill uses model type, traffic, response time, and cost constraints to recommend a deployment route, check instance quotas, and coordinate specialized setup and deployment skills.

中文简介正在准备中。当前显示英语简介。

  • Plan AWS hosting for a language model
  • Choose a serving route for an embedding model
  • Plan asynchronous inference for image generation
huggingface/skills1.1万2026年10月9日 更新

Prepare SageMaker deployments and training by finding existing execution roles, checking trust settings, and reviewing required permissions. Guides role creation only when necessary and identifies permission issues that require an AWS administrator.

中文简介正在准备中。当前显示英语简介。

  • Check execution roles before deploying a SageMaker endpoint
  • Find an existing role when no ARN is provided
  • Investigate IAM AccessDenied errors
huggingface/skills1.1万2026年10月9日 更新

Deploy SageMaker endpoints, the services that answer model requests, with automatic capacity scaling, CloudWatch alarms, and resource tags. Supports real-time and asynchronous inference, scaling down to zero instances, deployment checks, and resource cleanup.

中文简介正在准备中。当前显示英语简介。

  • Deploying a real-time model endpoint
  • Scaling a sparse workload down to zero instances
  • Running long inference jobs asynchronously
huggingface/skills1.1万2026年10月9日 更新

Choose a serving container for models deployed on SageMaker. Match the model type to a compatible image, retrieve its address from the AWS catalog, and check regional availability, CPU or GPU variants, and required host settings.

中文简介正在准备中。当前显示英语简介。

  • Choose a container for an LLM deployment
  • Select images for embeddings and rerankers
  • Check regional image addresses and GPU compatibility
huggingface/skills1.1万2026年10月9日 更新

查看 huggingface 的全部技能

报告此技能的问题