Skills Explorer Add Skills

setting-up-ec2-instance-profiles

An agent skill by aws, from aws/agent-toolkit-for-aws. Tags: cloud, ec2, iam, security, setup.

What it does

Configures EC2 instances to securely call AWS services by creating and attaching IAM roles via instance profiles, eliminating hardcoded credentials. Use when an EC2 instance needs permissions to access AWS services like S3, DynamoDB, SQS, or CloudWatch through temporary credentials.

Install

With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:

npx skills add aws/agent-toolkit-for-aws --skill setting-up-ec2-instance-profiles

Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):

git clone --depth 1 https://github.com/aws/agent-toolkit-for-aws
cp -r agent-toolkit-for-aws/skills/specialized-skills/ec2-skills/setting-up-ec2-instance-profiles ~/.claude/skills/setting-up-ec2-instance-profiles

Safety box score

Grade D, elevated risk: 53 of 100 risk points, rated 2026-10-19. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.

This skill configures EC2 instance profiles by creating/updating IAM roles, attaching policies, and associating the profile to an instance. The main risks are broad AWS-side privilege changes, destructive cleanup commands, and credential/metadata access during verification.

Category levels, from 0 (none) to 3 (high)
CategoryLevelWhy
Code & shell execution2 (moderate)The skill drives real shell/AWS CLI execution such as `aws ec2 describe-instances`, `aws iam create-role`, and `curl` to IMDS; it does not ship an executable script, but it does instruct the agent to run commands.
Network access2 (moderate)It contacts AWS APIs and the instance metadata service, including `http://169.254.169.254/latest/...`, which sends requests off-box and to a raw link-local IP.
Filesystem reach2 (moderate)It explicitly reaches outside the project into the user's home area with `~/.aws/credentials` and other config files when removing hardcoded credentials.
Secrets & credentials2 (moderate)The skill handles credential material directly, including `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `~/.aws/credentials`, and IMDS session tokens.
Privilege & persistence2 (moderate)It requires and exercises powerful AWS permissions like `iam:CreateRole`, `iam:AttachRolePolicy`, `iam:CreateInstanceProfile`, and `ec2:AssociateIamInstanceProfile`.
Instruction hijack surface0 (none)I found no hidden text, remote prompt-following, or instructions to ignore safeguards; the file's directives are operational, not prompt injection.
Irreversible actions3 (high)Its purpose is to change AWS infrastructure and permissions, including associating/disassociating instance profiles and deleting roles/policies during cleanup.
Transparency0 (none)The skill is plain Markdown with readable commands and no binaries, installers, base64 blobs, or decoded-at-runtime code.

Before installing

Rated 2026-10-19 by an automated review of 2 files from the skill's repository.

Source

Repository
aws/agent-toolkit-for-aws (all skills from this repository)
Path
skills/specialized-skills/ec2-skills/setting-up-ec2-instance-profiles/SKILL.md
Branch
main
Updated
2026-09-19