Skip to content
Skills Library
DevOps & cloud · Automation

aws-readonly-setup

/aws-readonly-setup

Set up a read-only AWS profile (raystack-readonly) for RayStack reviews. Signs in with aws login, creates a role with ReadOnlyAccess, adds the profile and proves it can read but not write. Use when an AWS review needs live access and no read-only profile works, or for "set up read-only AWS access".

Repository
RayStack ↗
Licence
MIT
Last repository change
06.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 06.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Set up a read-only AWS profile (raystack-readonly) for RayStack reviews. Signs in with aws login, creates a role with ReadOnlyAccess, adds the profile and proves it can read but not write. Use when an AWS review needs live access and no read-only profile works, or for "set up read-only AWS access".

Triggers from the description

set up read-only AWS access
Original author description

Set up a read-only AWS profile (raystack-readonly) for RayStack reviews. Signs in with aws login, creates a role with ReadOnlyAccess, adds the profile and proves it can read but not write. Use when an AWS review needs live access and no read-only profile works, or for "set up read-only AWS access".

How it works

  1. 1. Check what exists
  2. 2. Credentials for the one write
  3. 3. Create the role
  4. 4. Add the profile
  5. 5. Prove it
  6. 6. Report
  7. Never
Original SKILL.md headings · 102 lines, 833 words
SKILL.md preview
---
name: aws-readonly-setup
description: Set up a read-only AWS profile (raystack-readonly) for RayStack reviews. Signs in with aws login, creates a role with ReadOnlyAccess, adds the profile and proves it can read but not write. Use when an AWS review needs live access and no read-only profile works, or for "set up read-only AWS access".
---

# AWS read-only setup

Gives the AWS reviews a profile that can only read. It creates no access keys and no users. It
makes one IAM change, a role, and asks before making it. Run it before a review, never inside
one: the review's guard blocks writes on purpose.

## 1. Check what exists

- Run `aws configure list-profiles`. If `raystack-readonly` is there, go to step 5. If the
  proof passes, you're done.
- For each profile, try `aws sts get-caller-identity --profile <p> --query Account`. Note
  which work. Name broken ones in one line each (invalid token, a region that isn't a real
  region such as `ue-east-1`). Don't fix the user's config.
- Ask once through the question tool (AskUserQuestion in Claude Code; plain text only when the
  agent has none), in one call:
  1. Which account the reviews should read. Offer the working profiles, each with the last 4
     digits of its account.
  2. Region. Offer the profile's region when it's a real one, else `us-east-1`.
  3. Consent: "Create IAM role `raystack-readonly` with the AWS-managed `ReadOnlyAccess`
     policy in account ...? This is the only write." No consent: stop and say the reviews will
     work from IaC and exports only.

## 2. Credentials for the one write

- Try the chosen profile. If its keys are invalid, or any IAM call in steps 2 and 3 gets
  `AccessDenied`, sign in through the browser instead.
- First check `raystack-setup` isn't already one of the user's own profiles. If it is, pick an
  unused name such as `raystack-setup-2`, because `aws login` overwrites the profile it writes.
  Tell the user first: "A browser tab will open. Sign in to account ... as someone who can
  create IAM roles, approve, then come back." Then run
  `aws login --profile raystack-setup --region <region>` (AWS CLI 2.32 or later). Confirm
  `aws sts get-caller-identity --profile raystack-setup` shows the chosen account. A different
  account: stop and say so. Signed in as root: stop and ask for an IAM user or SSO role
  instead. CLI too old: say which version is needed.
- Never ask for, print or write an access key.

## 3. Create the role

Pass `--profile <setup profile> --region <region>` on every command here. IAM is global, but the
CLI still errors with `NoRegion` when the profile has none.

- The trust principal is the identity from `get-caller-identity` on the profile used for the
  write. Map it like this:
  - An IAM user ARN: use it as it is.
  - `arn:aws:sts::A:assumed-role/R/S` (including SSO): use the role's real ARN from
    `aws iam get-role --role-name R --query Role.Arn`. It keeps the role's path, which SSO
    roles always have.
- `aws iam create-role --role-name raystack-readonly --max-session-duration 3600 --description "RayStack read-only reviews" --assume-role-policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"<principal>"},"Action":"sts:AssumeRole"}]}'`
- `aws iam attach-role-policy --role-name raystack-readonly --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess`
- `aws iam put-role-policy --role-name raystack-readonly --policy-name raystack-deny-data --policy-document file://<this skill's folder>/deny-data-policy.json`.
  ReadOnlyAccess can read data (S3 objects, SSM SecureStrings, secrets, DynamoDB rows,
  function code). This deny keeps the role to config, metrics and billing, which is all the
  reviews need. CloudWatch Logs stays readable because the bottleneck review queries it; logs
  can hold app data, so say so in the report.
- If the role already exists, check three things:
  - its attached policies are exactly `ReadOnlyAccess`;
  - its inline policies are exactly `raystack-deny-data`, matching this skill's file;
  - its trust policy names only principals in this account, with no `*` and no other account.

  Reuse it only if all three hold. Otherwise stop and report what's on it.

## 4. Add the profile

Append this section to `~/.aws/config`. Never touch `~/.aws/credentials` or any other section.
If the section already exists, leave it as it is.

```
[profile raystack-readonly]
role_arn = arn:aws:iam::<account>:role/raystack-readonly
source_profile = <the profile used in step 2>
region = <region>
```

## 5. Prove it

- `aws sts get-caller-identity --profile raystack-readonly` must show the `raystack-readonly`
  role. New roles can take a few seconds to work, so retry up to 5 times, 5 seconds apart.
- `aws iam simulate-principal-policy --profile raystack-readonly --policy-source-arn <role ARN> --action-names ec2:RunInstances s3:PutObject iam:CreateUser iam:CreateAccessKey s3:GetObject secretsmanager:GetSecretValue ssm:GetParameter kms:Decrypt dynamodb:PartiQLSelect`
  must give `implicitDeny` for the writes and `explicitDeny` for the five data reads. Any `allowed`: stop, report it, and run no review
  with this profile.
- One read: `aws ec2 describe-regions --profile raystack-readonly --query 'length(Regions)'`.

## 6. Report

Give the profile name, the last 4 digits of the account, the region, what you created, and
each proof result. The AWS reviews then use `raystack-readonly`. To undo, the user runs
`aws iam delete-role-policy --role-name raystack-readonly --policy-name raystack-deny-data`,
`aws iam detach-role-policy --role-name raystack-readonly --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess`,
then `aws iam delete-role --role-name raystack-readonly`, then deletes the profile section.

The setup profile keeps a browser-login session (about 12 hours) that `raystack-readonly`
chains through. When it expires, run `aws login --profile raystack-setup` again; the role and
profile stay.

## Never

- Create access keys or IAM users.
- Attach anything other than `ReadOnlyAccess` and the `raystack-deny-data` inline deny.
- Edit other profiles or `~/.aws/credentials`.
- Run this from inside a review.
Files in this package (2)
  • SKILL.md 6 KB
  • deny-data-policy.json 1 KB

Versions

The database has no other skills named aws-readonly-setup.

Database snapshot: 13.11.2026 · package version cf6b23df5d09 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100create-readonly-db-role
    Set up read-only PostgreSQL access for agents. Use only when the user explicitly invokes /create-readonly-db-role.
  • 90raystack
    Entry point for everything in RayStack. Use for "/raystack", "what can RayStack do", development work ("new project", "project new", "project update", "project gaps", "project review", "project migrate", "project refactor", "refactor this", "start a project", "write a PRD",…
  • 90dev
    Entry point for the RayStack development flow. Use for "/dev", "/raystack new project", "/raystack project new", "/raystack project update", "/raystack project gaps", "/raystack project review", "/raystack project migrate", "/raystack project refactor", "start a new project",…
  • 100aws-mcp
    Authenticate a supplied AWS profile with browser sign-in when needed, wait for completion, verify AWS MCP access, and investigate root causes through scoped AWS resource queries. Use when handling AWS MCP connectivity, expired sessions, and read-only AWS troubleshooting.
  • 82aws-access
    Provision an AWS STS session for Claude to use against staging or prod, and reach the deployed environment's data plane from there. Covers (1) the first-time setup walkthrough for a teammate who has never let Claude reach AWS, (2) refreshing an expired session, (3) running…
  • 100hf-cloud-aws-context-discovery
    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…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.