Skip to content

Commit 903fa5f

Browse files
fix(plugin): add X-Ray resource policy to /setup and least-privilege ref to /deploy
The /setup skill's Phase 3 only ran `aws xray update-trace-segment-destination` which fails with AccessDeniedException on fresh accounts. Added the prerequisite `aws logs put-resource-policy` command. Added a "Least-Privilege Deployment" section to the /deploy skill linking to DEPLOYMENT_ROLES.md with the re-bootstrap command for scoped execution policies. Updated CLAUDE.md to reference the abca-plugin and its available skills so Claude Code sessions discover the guided workflows without requiring --plugin-dir. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dbdc126 commit 903fa5f

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
@AGENTS.md
2+
3+
See also [README.md](./README.md) for the Claude Code plugin (`docs/abca-plugin/`), which provides interactive guided workflows for setup, deployment, repository onboarding, task submission, and troubleshooting via `/setup`, `/deploy`, `/onboard-repo`, `/submit-task`, `/status`, and `/troubleshoot` skills. Run Claude Code with `claude --plugin-dir docs/abca-plugin` to activate it.

docs/abca-plugin/skills/deploy/SKILL.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,14 @@ After a successful deploy, remind the user to:
8181
- Store/update the GitHub PAT in Secrets Manager if this is a fresh deployment
8282
- Onboard repositories via Blueprint constructs if needed
8383
- Run a smoke test: `curl -s -H "Authorization: $TOKEN" $API_URL/tasks`
84+
85+
## Least-Privilege Deployment
86+
87+
By default, CDK bootstrap grants `AdministratorAccess` to the CloudFormation execution role. For production or security-sensitive accounts, re-bootstrap with a scoped execution policy:
88+
89+
```bash
90+
cdk bootstrap aws://ACCOUNT/REGION \
91+
--cloudformation-execution-policies "arn:aws:iam::ACCOUNT:policy/IaCRole-ABCA-Policy"
92+
```
93+
94+
See [DEPLOYMENT_ROLES.md](../../design/DEPLOYMENT_ROLES.md) for the complete least-privilege IAM policy, trust policy, runtime role inventory, and iterative tightening recommendations.

docs/abca-plugin/skills/setup/SKILL.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,17 @@ If `mise run install` fails with "yarn: command not found", Corepack wasn't acti
5252

5353
## Phase 3: One-Time AWS Setup
5454

55+
On a fresh AWS account, X-Ray needs a CloudWatch Logs resource policy before it can write spans. Run both commands — the first creates the policy, the second sets the destination:
56+
5557
```bash
58+
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
59+
aws logs put-resource-policy \
60+
--policy-name xray-spans-policy \
61+
--policy-document "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"XRaySpansAccess\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"xray.amazonaws.com\"},\"Action\":[\"logs:PutLogEvents\",\"logs:CreateLogGroup\",\"logs:CreateLogStream\"],\"Resource\":\"*\"}]}"
5662
aws xray update-trace-segment-destination --destination CloudWatchLogs
5763
```
5864

59-
This must be run once per AWS account before first deployment.
65+
These must be run once per AWS account before first deployment. If the `put-resource-policy` step is skipped, the `update-trace-segment-destination` command fails with `AccessDeniedException`.
6066

6167
## Phase 4: First Deployment
6268

0 commit comments

Comments
 (0)