Skip to content

Commit f7ec515

Browse files
committed
Add new documentation and journal entries for Claude Code integration with AWS Bedrock
- Created two new How-To guides for using Claude Code with AWS Bedrock, detailing setup and troubleshooting steps. - Updated the May 16 journal entry to include references to the new guides and organized sections for better clarity. - Added a new entry for ChatGPT project instructions related to Diataxis format in Logseq, enhancing documentation for AI coding practices.
1 parent 30f5a0a commit f7ec515

6 files changed

Lines changed: 1184 additions & 1 deletion

.repomix/bundles.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
"pages/Logseq___Proj___LsqMCP___PRD.md",
1010
"pages/Logseq___MCP___Server___Survey___Report.md"
1111
]
12+
},
13+
"logseq-diataxis-620": {
14+
"name": "logseq-diataxis",
15+
"created": "2025-05-16T13:22:29.447Z",
16+
"lastUsed": "2025-05-16T13:22:42.736Z",
17+
"tags": [],
18+
"files": [
19+
".cursor/rules/diataxis-how-to.mdc",
20+
".cursor/rules/diataxis-reference.mdc",
21+
".cursor/rules/diataxis-tutorial.mdc",
22+
".cursor/rules/logseq-cursor-rules/logseq-flavored-markdown.mdc",
23+
".cursor/rules/logseq-cursor-rules/logseq-overview.mdc",
24+
".cursor/rules/logseq-cursor-rules/logseq-ai-model-reference.mdc"
25+
]
1226
}
1327
}
1428
}

journals/2025_05_16.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
## #Automation
1+
## [[AI Coding]]
2+
- #Filed
3+
- [[Anthropic/App/Claude Code/How To/Get Started with AWS Bedrock]]
4+
- [[Anthropic/App/Claude Code/How To/Bootstrap Claude Code with Mise + UV-Powered Okta Role Assumption]]
5+
- ## #Logseq
6+
- #Filed
7+
- [[ChatGPT/Project/Instruction/Diataxis Logseq]]
8+
- ## #Automation
29
- #Filed
310
- [[Git Hooks]]
411
- [[Py/Lib/pre-commit]]
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
tags:: [[Claude Code]], [[Mise]], [[AWS/Bedrock]], [[Okta]], [[Diataxis/How To]]
2+
3+
- # How To Bootstrap [[Claude Code]] with [[mise]] + [[uv]] -Powered #Okta [[AWS/IAM/Role]] Assumption
4+
- ## Overview
5+
- Pin Node LTS, Claude Code, **aws_okta_keyman**, and UV in **mise**; add a `claude` task whose scoped env-vars point the CLI at Bedrock. `aws_okta_keyman` fetches STS creds (installed via mise’s Python/UV pipeline), and `AWS_PROFILE` makes Claude pick them up automatically—no extra role-switch inside the REPL.
6+
- ## Time Estimate
7+
- 10 minutes
8+
- ## Prerequisites
9+
- [[mise]] v2024.10+ on `PATH`
10+
- Okta-backed IAM role with `bedrock:InvokeModel`
11+
- AWS CLI v2
12+
- Bedrock access to *Claude 3.7 Sonnet* in your target Region
13+
- ## Steps
14+
- ### 1 Edit the global mise config
15+
- Append to *~/.config/mise/config.toml* (keep `[settings] experimental = true`):
16+
- ~~~toml
17+
[tools] # language & CLI pinning
18+
node = "lts"
19+
uv = "latest" # UV installer/runtime
20+
"npm:@anthropic-ai/claude-code" = "latest"
21+
"pipx:aws-okta-keyman" = "latest" # pipx uses UV under the hood
22+
23+
[tasks.bedrock-login] # STS helper (optional)
24+
run = "uvx aws_okta_keyman --role arn:aws:iam::<acct>:role/BedrockInvokeRole --profile bedrock"
25+
26+
[tasks.claude] # main entry point
27+
run = "claude $@" # forward args
28+
29+
[tasks.claude.env] # vars ONLY for Claude
30+
CLAUDE_CODE_USE_BEDROCK = "true"
31+
AWS_PROFILE = "bedrock"
32+
AWS_REGION = "us-east-1"
33+
ANTHROPIC_MODEL = "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
34+
ANTHROPIC_SMALL_FAST_MODEL = "us.anthropic.claude-3-5-haiku-20241022-v1:0"
35+
~~~
36+
- **Why UV not pipx?** With `experimental = true`, mise installs Python packages using **UV** and exposes them via **`uvx`**—fast, isolated, and no extra venvs.
37+
- ### 2 Install & reshim the toolchain
38+
~~~bash
39+
mise install
40+
mise reshim
41+
mise run claude -- --version # sanity-check shim
42+
~~~
43+
- ### 3 Obtain STS credentials
44+
~~~bash
45+
mise run bedrock-login # runs uvx aws_okta_keyman …
46+
~~~
47+
- Credentials land in *~/.aws/credentials* under `[bedrock]`.
48+
- ### 4 Launch Claude Code
49+
~~~bash
50+
cd /path/to/monorepo
51+
mise run claude # or: mise r claude
52+
/init # one-time scan
53+
/status # should show “provider: Bedrock”
54+
~~~
55+
- ### 5 Verify & tidy
56+
~~~bash
57+
aws sts get-caller-identity --profile bedrock
58+
aws bedrock list-foundation-models --region us-east-1 | grep claude
59+
claude config add ignorePatterns "libs/legacy/**"
60+
/cost
61+
~~~
62+
- ## Troubleshooting
63+
- **403 “Model access denied”** → enable *Claude 3* in the Bedrock console for `us-east-1`.
64+
- **TOML parse error** → ensure `[tasks.claude.env]` is a nested table, not inline `{…}`.
65+
- **Expired creds** → rerun `mise r bedrock-login`; STS tokens last ≈1 h.
66+
- ## Related
67+
- A less opinionated guide is available at [[Anthropic/App/Claude Code/How To/Get Started with AWS Bedrock]]
68+
- Claude Code Bedrock settings docs
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
tags:: [[Diataxis/How To]]
2+
3+
- # How to get started with [[Claude Code]] using [[AWS/Bedrock/Model/Anthropic]]
4+
- ## Problem
5+
- Use **Claude Code** with Anthropic models on **AWS Bedrock** while authenticating through an Okta-backed IAM role obtained with **`aws_okta_keyman`**.
6+
- ## Prerequisites
7+
- Node 18+ & npm
8+
- Python 3.8+ and `pip`
9+
- AWS CLI v2 configured for SSO/Okta federation
10+
- Bedrock model access for *Claude 3.7 Sonnet* (and optionally *3.5 Haiku*) in your Region
11+
- An Okta-backed IAM role allowing `bedrock:InvokeModel`
12+
- Local Git checkout of your monorepo
13+
- ## Steps
14+
- ### 1. Install tools
15+
- ~~~
16+
npm install -g @anthropic-ai/claude-code # Claude Code CLI
17+
pip install --user aws-okta-keyman # Okta → AWS STS helper
18+
~~~
19+
- `aws_okta_keyman` produces short-lived `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` for any role your Okta account exposes ([aws_okta_keyman GitHub](https://github.com/nathan-v/aws_okta_keyman)).
20+
- ### 2. Assume the Bedrock-enabled role
21+
- ~~~
22+
aws_okta_keyman --role arn:aws:iam::<acct>:role/BedrockInvokeRole
23+
# follow MFA prompts; creds land in ~/.aws/credentials under [default]
24+
~~~
25+
- *Alternatively*, wrap the entire Claude session:
26+
- ~~~
27+
aws_okta_keyman --command "claude"
28+
~~~
29+
- ### 3. Verify the temporary credentials
30+
- ~~~
31+
aws sts get-caller-identity
32+
aws bedrock list-foundation-models --region us-east-1 | grep claude
33+
~~~
34+
- ### 4. Tell Claude Code to use Bedrock
35+
- ~~~
36+
export CLAUDE_CODE_USE_BEDROCK=1
37+
export AWS_REGION=us-east-1
38+
export ANTHROPIC_MODEL=us.anthropic.claude-3-7-sonnet-20250219-v1:0
39+
export ANTHROPIC_SMALL_FAST_MODEL=us.anthropic.claude-3-5-haiku-20241022-v1:0
40+
~~~
41+
- These variables switch the provider and model IDs for the session ([Anthropic Claude Code Bedrock Docs](https://docs.anthropic.com/en/docs/claude-code/bedrock-vertex?utm_source=chatgpt.com)).
42+
- Persist once if you prefer:
43+
- ~~~
44+
claude config set --global env \
45+
'{"CLAUDE_CODE_USE_BEDROCK":"true", \
46+
"ANTHROPIC_MODEL":"us.anthropic.claude-3-7-sonnet-20250219-v1:0"}'
47+
~~~
48+
- ### 5. Launch Claude Code in your project
49+
- ~~~
50+
cd /path/to/monorepo
51+
claude # starts the REPL
52+
/init # one-time: generates CLAUDE.md project map
53+
/status # confirms “provider: Bedrock”
54+
~~~
55+
- ### 6. Optional hygiene
56+
- ~~~
57+
# Ignore large or irrelevant libraries
58+
claude config add ignorePatterns "libs/legacy/**"
59+
# View token spend
60+
/cost
61+
~~~
62+
- ## Result
63+
- Claude Code now runs against AWS Bedrock using STS credentials issued by `aws_okta_keyman`; every request is SigV4-signed and billed to your enterprise account.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# [[Diataxis]] [[Logseq]] [[ChatGPT/Project/Instruction]]
2+
- ## Context
3+
- This #Prompt - [ChatGPT Project Instruction Diataxis Logseq](https://github.com/codekiln/logseq-cursor-rules/blob/b6b1bf8a00d77abd99389635a79800afe7c61a5e/ChatGPT_Project_Instruction_Diataxis_Logseq.txt) - is < 8k characters and encapsulates much of what's needed to get ChatGPT to generate well-formulated logseq documents in Diataxis format.

0 commit comments

Comments
 (0)