본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)11k · #11766

hf-cloud-aws-context-discovery

하는 일

이 스킬은 AI가 클라우드 작업을 하기 전에 어느 AWS 계정, 프로필, 리전을 써야 하는지 확인합니다. Amazon Web Services에 머신러닝 배포를 설정하는 사람들을 위한 스킬입니다.

사용하는 경우

  • ✓SageMaker 배포나 AWS API 호출 등 AWS 작업을 시작할 때.
  • ✓어느 AWS 프로필이나 리전을 쓸지 아직 말하지 않았을 때.
  • ✓내 AWS 계정을 쓰라고 말해서 에이전트에게 올바른 계정 정보가 필요할 때.

스킬 링크

https://github.com/huggingface/skills/blob/main/skills/hf-cloud-aws-context-discovery/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/huggingface/skills/blob/main/skills/hf-cloud-aws-context-discovery/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 AWS 계정으로 SageMaker 배포를 설정해 주세요. 찾은 프로필과 리전을 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 활성 프로필과 리전 같은 로컬 AWS 설정을 읽고, 간단한 신원 확인을 실행합니다. 리전을 추측하지 않으며, 설정에 리전이 없을 때에만 사용자에게 묻습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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 pattern Type IAM write capability
arn:aws:iam::<acct>:user/<name> IAM user Depends on attached policies
arn:aws:sts::<acct>:assumed-role/AWSReservedSSO_<...>/<email> SSO assumed-role Typically none — can't create/modify IAM roles
arn:aws:sts::<acct>:assumed-role/<role>/<session> Regular assumed-role Depends 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.

자주 묻는 질문

기본 리전으로 대체하나요?

아닙니다. 설정이나 사용자가 말한 리전을 쓰며, 코드에 고정된 기본값을 가정하지 않습니다.

프로필이 없으면 어떻게 되나요?

스킬은 작업을 시작하기 전에 프로필을 고칠 수 있도록 그 사실을 분명히 알립니다.

로그인되어 있는지 확인하나요?

네. 신원 확인으로 작업을 계속하기 전에 자격 증명이 유효한지 확인합니다.

상세 정보

작성자의 원본 설명

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.

repo: huggingface/skills

인기도

GitHub 스타
11k
순위
#11766
라이선스
Apache-2.0
업데이트
2026. 10. 30.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬