Automation & Ops aws-sagemakeraws-iamiam-rolecloud-deploymentaws-clipython

SageMaker IAM Preflight

Find and validate a usable SageMaker execution role before deployment or training.

FollowSkills review · FSRS-2.0
Not recommended
41/ 100 5-point scale 2.1 / 5
Trust7 / 25 · 1.4/5

The skill requires discovery and validation before creation and documents AWS credential inheritance and failure feedback. However, creation lacks explicit user confirmation and rollback, defaults to attaching AmazonSageMakerFullAccess, and the supplemental policy still uses wildcard resources for ECR and CloudWatch, so least-privilege deductions are substantial.

Reliability8 / 20 · 2.0/5

The two Python helpers have coherent parameters, exit codes, failure paths, and native CLI fallback guidance. However, trust validation is only a substring check, partial creation failures leave resources behind, and no key-path tests are present; under static calibration the score stays at or below 10.

Adaptability8 / 15 · 2.7/5

Triggers, inputs, Windows versus Unix guidance, and the SSO scenario are relatively clear. The skill is narrowly limited to SageMaker IAM preflight, gives little explicit non-fit guidance, and provides no Chinese-language or mainland-China reachability support, so points are deducted.

Convention8 / 15 · 2.7/5

The folder contains a SKILL.md, scripts, JSON references, usage guidance, permission notes, limitations, an Apache-2.0 license, and repository CI. It lacks skill-specific versioning, changelog, named maintenance responsibility, and a clear update path, with limited examples and troubleshooting coverage.

Effectiveness6 / 15 · 2.0/5

It can discover and return a usable execution-role ARN or provide actionable SSO escalation guidance, completing the core preflight task. It only checks existence and trust rather than effective permissions; the creation path uses an overly broad policy and lacks confirmation and recovery, so manual review remains necessary.

Verifiability4 / 10 · 2.0/5

The supplied files make the logic and policy templates auditable, and repository CI validates generated artifacts and version bumps. There are no committed tests covering this skill's key paths or third-party execution records, so static evidence supports no more than 5 points.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 86cdeee824b7
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
Before you use it
  • create_role.py attaches AmazonSageMakerFullAccess; perform a manual least-privilege review before execution.
  • Role creation, managed-policy attachment, and inline-policy creation have no transactional rollback; partial failures may leave resources configured.
  • Trust validation uses substring matching and does not strictly verify Principal, Action, or conditions.
  • The skill depends on a working local AWS CLI, credentials, and reachable AWS services; mainland-China network reachability and Chinese-language support are not documented.
Review evidence [1][2][3][4][5][6][7][8][9]
See the full review method →

What does this skill do, and when should you use it?

This skill checks for a usable SageMaker execution role before creating endpoints, models, training jobs, or other role-dependent resources. It validates a user-supplied role first, then discovers existing SageMaker-style roles and ranks them by recent use. Role creation is considered only when discovery finds nothing and the caller has the required IAM permissions. It is a good fit for AWS CLI-based workflows that need to avoid predictable failures from SSO principals without IAM write access.

Runs Python helper scripts to validate a named role or ARN, or discover existing roles matching common SageMaker naming patterns. It ranks candidates by RoleLastUsed and falls back to CreateDate when last-used data is unavailable. It verifies that the role exists and that its trust policy allows sagemaker.amazonaws.com to call sts:AssumeRole, then prints a usable ARN on success. If no role is found, it provides separate paths for users who can create roles and SSO users who must obtain an ARN or permissions from an AWS administrator. It also documents equivalent AWS CLI commands for manual discovery and validation.

  1. A developer is deploying a SageMaker endpoint without an explicit execution-role ARN.
  2. A machine-learning engineer is preparing a SageMaker model or training job and wants a role check before deployment code runs.
  3. An AWS SSO user receives an IAM AccessDenied error and needs to distinguish a missing role from missing creation permissions.
  4. An operations team has several SageMaker roles and wants to prefer the recently used, potentially maintained role.
  5. A user needs the same preflight workflow on Windows PowerShell, macOS, or Linux.

What are this skill's strengths and limitations?

Pros
  • Enforces discovery and validation before role creation.
  • Ranks existing roles by recent use and falls back to creation date when needed.
  • Checks the SageMaker trust relationship that is required for role assumption.
  • Uses Python helpers across Windows, macOS, and Linux and includes a native AWS CLI fallback.
  • Gives concrete remediation guidance for SSO users without IAM write permissions.
Limitations
  • Does not deeply simulate or verify all role permissions.
  • Requires Python, AWS CLI, working credentials, and network access to AWS.
  • The source provides no test suite, version pinning, or standalone package.
  • Role creation remains dependent on the caller having the necessary IAM permissions.

How do you install this skill?

Copy or symlink the hf-cloud-sagemaker-iam-preflight folder from the repository's skills/ directory into a standard Codex .agents/skills location, such as $REPO_ROOT/.agents/skills or $HOME/.agents/skills. The README does not document a standalone installation command for this individual skill.

How do you use this skill?

Run the helpers from the same shell where AWS CLI identity works with aws sts get-caller-identity. Validate a supplied role with python3 scripts/check_role.py "<role-name-or-arn>", or discover roles with python3 scripts/check_role.py. On Windows PowerShell, use python scripts/check_role.py directly. A suitable trigger is: “Before creating this SageMaker training job, use the SageMaker IAM preflight skill to check and validate the execution role.” If discovery finds nothing and the user has IAM permissions, run python3 scripts/create_role.py "<role-name>" "<model-bucket>". For an SSO principal without creation permissions, stop and request an administrator-provided role ARN or the required IAM grants.

How does this skill compare with similar options?

The documented Native AWS CLI equivalent is a manual alternative to the Python helpers: users list candidate roles, inspect trust policies, and compare last-used or creation dates themselves.

FAQ

Does the skill automatically create an IAM role?
Only when no usable role is discovered and the user has IAM creation permissions, using the documented create_role.py helper. It explicitly prohibits blindly calling iam:CreateRole.
Does it verify every SageMaker permission?
No. It verifies role existence and the SageMaker trust policy. Deployment-time errors are expected to identify missing action permissions when deeper analysis is needed.
What should an SSO user do when no role exists?
Stop rather than retrying unrelated IAM operations. Ask an AWS administrator for a SageMaker execution-role ARN or for iam:CreateRole, iam:AttachRolePolicy, and iam:PutRolePolicy.
What is the Windows requirement?
Run the Python helper directly in the PowerShell environment where AWS CLI identity works; do not route it through WSL, Git Bash, or another Bash shim.

More skills from this repository

All from huggingface/skills

Automation & Ops

AWS Context Discovery

Resolve the active AWS environment before any account operation.

Automation & Ops

SageMaker Python Environment Setup

Build an isolated, version-aligned Python environment for SageMaker and AWS automation.

Automation & Ops

SageMaker Production Defaults

Deploy SageMaker real-time or async endpoints with autoscaling, CloudWatch alarms, and consistent tagging built in.

Dev & Engineering

Gradio Interactive App Builder

Build Gradio web interfaces, machine-learning demos, and chat apps in Python.

Dev & Engineering

Hugging Face ZeroGPU Builder

Build dependable Gradio AI demos and GPU workloads on Hugging Face ZeroGPU.

Automation & Ops

SageMaker Deployment Planner

Choose a practical Amazon SageMaker deployment path for your model, traffic pattern, and latency needs.

Dev & Engineering

LoRA Space Demo Builder

Build and publish a tailored Gradio Space for a Hugging Face LoRA.

Dev & Engineering

Hugging Face Spaces Builder

Build, deploy, debug, and maintain machine-learning apps on Hugging Face Spaces.

Data & Analysis

Hugging Face LLM Trainer

Train, fine-tune, and preserve models on Hugging Face cloud GPUs.

Automation & Ops

SageMaker Serving Image Selector

Choose a compatible SageMaker serving container and retrieve the current regional image URI for a Hugging Face model.

Dev & Engineering

Hugging Face Hub CLI Skill

Give agents command-line control over Hugging Face Hub models, datasets, Spaces, jobs, and infrastructure.

Dev & Engineering

Hugging Face API Tool Builder

Turn Hugging Face API calls into reusable, composable command-line tools.

Data & Analysis

Hugging Face Dataset Explorer

Explore, query, and extract Hugging Face datasets through the Dataset Viewer API.

Dev & Engineering

Hugging Face Paper Research Assistant

Read AI papers and retrieve structured metadata from Hugging Face paper pages.

Data & Analysis

TRL Language Model Trainer

Train and fine-tune transformer language models with TRL’s CLI for SFT, preference alignment, and reinforcement learning.

Data & Analysis

Hugging Face Local Evaluator

Run controlled inspect-ai or lighteval evaluations for Hugging Face Hub models on local hardware.

Data & Analysis

Sentence Transformers Training Assistant

Train retrieval, similarity, reranking, and sparse-search models with Sentence Transformers.

Data & Analysis

Transformers.js Inference Skill

Run Hugging Face models directly inside JavaScript applications.

Data & Analysis

Hugging Face Model Memory Estimator

Estimate inference memory without downloading model weights.

Dev & Engineering

Hugging Face Local Model Runner

Choose compatible GGUF quantizations from Hugging Face and run them locally with llama.cpp.

Related skills