setting-up-ec2-instance-profiles

setting-up-ec2-instance-profiles is a skill for Claude Code, Codex from aws/agent-toolkit-for-aws. It costs 63 tokens per session (357 once invoked), scanned C, original, Apache-2.0.

A guide for giving Amazon EC2 instances permission to use AWS services through IAM roles and instance profiles. These provide temporary credentials to the machine instead of storing access keys in application code.

In plain words
What is it for?
Use it to create or reuse a least-privilege role, attach it to an EC2 instance, and troubleshoot missing permissions or credentials.
Why use it?
It removes hardcoded cloud credentials and helps keep permissions limited to the actions an application needs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create or reuse a least-privilege role, attach it to an EC2 instance, and troubleshoot missing permissions or credentials.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aws/agent-toolkit-for-aws/setting-up-ec2-instance-profiles
About the project

Agent Toolkit for AWS is a collection of AWS-supported MCP servers, skills, plugins, commands, and hooks that help AI coding agents build, deploy, and manage applications on AWS. It is used by developers working with AWS services through agents such as Claude Code, Codex, Cursor, and Kiro. The catalogue entries are the toolkit's own agent extensions for AWS development and operations.

aws/agent-toolkit-for-aws · 3,609 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add aws/agent-toolkit-for-aws --skill setting-up-ec2-instance-profiles
Clone the repo
git clone --depth 1 https://github.com/aws/agent-toolkit-for-aws

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for setting-up-ec2-instance-profiles

README.md
[![agentmods](https://agentmods.dev/badge/skills/aws/agent-toolkit-for-aws/setting-up-ec2-instance-profiles/github.svg)](https://agentmods.dev/skills/aws/agent-toolkit-for-aws/setting-up-ec2-instance-profiles)
Your own site
<a href="https://agentmods.dev/skills/aws/agent-toolkit-for-aws/setting-up-ec2-instance-profiles"><img src="https://agentmods.dev/badge/skills/aws/agent-toolkit-for-aws/setting-up-ec2-instance-profiles/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for setting-up-ec2-instance-profiles

Your own site · 80×15
<a href="https://agentmods.dev/skills/aws/agent-toolkit-for-aws/setting-up-ec2-instance-profiles"><img src="https://agentmods.dev/badge/skills/aws/agent-toolkit-for-aws/setting-up-ec2-instance-profiles.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 357 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 41
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.00357
Opus 5.5 $0.00025 $0.00143
Sonnet 5.5 $0.00013 $0.00071
Haiku 4.5 $0.00006 $0.00036

Measured 2mo ago against content hash 358dc23c545a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

setting-up-ec2-instance-profiles scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

Remove credentials from config files, environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`), and `~/.aws/credentials`. The SDK default credential chain will then use the instance profile.
skills/specialized-skills/ec2-skills/setting-up-ec2-instance-profiles/SKILL.md · 42 lines

What it actually says

Setting Up EC2 Instance Profiles

Overview

Domain expertise for granting EC2 instances secure access to AWS services using IAM roles and instance profiles. Covers the full lifecycle: identifying required permissions, creating or reusing IAM roles with least-privilege policies, creating instance profiles, attaching them to EC2 instances, and verifying credential availability.

Configure an EC2 instance profile

To set up an IAM role and instance profile for an EC2 instance, follow the procedure exactly. See EC2 instance profile setup procedure.

Troubleshooting

Instance not found

Verify the instance ID and region are correct. List instances with aws ec2 describe-instances --region <region>.

Instance already has a profile

The procedure handles replacement — it will prompt before disassociating the existing profile.

Credentials not available after attachment

Instance profile propagation can take 30–60 seconds. Applications may need a restart to pick up new credentials.

Access denied errors

Check that the role's policies include the required actions and resource ARNs. Review CloudTrail logs for the specific denied action.

Application still uses hardcoded credentials

Remove credentials from config files, environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY), and ~/.aws/credentials. The SDK default credential chain will then use the instance profile.

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 42 lines · 63 tokens per session scan C 358dc23c545a

Subscribe to this mod's changes

setting-up-ec2-instance-profiles is a skill published in the GitHub repository aws/agent-toolkit-for-aws (3,609 stars, last pushed today), licensed Apache-2.0. It adds 63 tokens to every session and 357 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

setting-up-ec2-instance-profiles compared with skills from other repositories

setting-up-ec2-instance-profiles next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
setting-up-ec2-instance-profilesaws/agent-toolkit-for-awsSkill3.6ktodayApache-2.0C63Claude Code, Codex
gke-compute-classesgoogle/skillsSkill25ktodayApache-2.0A83Claude Code, Codex
cloud-operator-admin-setupgoogle/skillsSkill25ktodayApache-2.0A115Claude Code, Codex
gke-reliabilitygoogle/skillsSkill25ktodayApache-2.0A85Claude Code, Codex
gke-workload-securitygoogle/skillsSkill25ktodayApache-2.0A171Claude Code, Codex
nemo-automodel-launcher-configNVIDIA/skillsSkill4.2k2d agoApache-2.0A30Claude Code
azure-mgmt-botservice-dotnetmicrosoft/skillsSkill3.3k3d agoMITA78Claude Code