
Amazon Bedrock AgentCore Runtime がサポートした x86_64 アーキテクチャを試してみた
はじめに
2026年11月29日、Amazon Bedrock AgentCore Runtime v2 が x86(x86_64)アーキテクチャをサポートしました。
この記事では、amd64 のコンテナイメージから x86_64 の Runtime を作成して実行できることを確かめました。
検証環境
- リージョン:東京(ap-northeast-1)
- ビルド環境:aarch64 ホスト上の docker buildx。QEMU のエミュレーションで linux/amd64 向けにビルド
- ベースイメージ:Amazon Linux 2023(amd64)
- コンテナイメージの Python:3.11(dnf で導入)
- AWS CLI:2.42.7
x86_64 イメージのビルドと ECR への push
最小構成のエージェントを用意します。Dockerfile と app.py を同じディレクトリに保存します。
FROM --platform=linux/amd64 public.ecr.aws/amazonlinux/amazonlinux:2023
WORKDIR /app
RUN dnf install -y python3.11 && dnf clean all
COPY app.py .
EXPOSE 8080
CMD ["python3.11", "app.py"]
app.py は、標準ライブラリだけで書いた HTTP サーバーです。/invocations への POST を受けると、platform.machine() の値を含む JSON を返します。
app.py
import json
import platform
from http.server import BaseHTTPRequestHandler, HTTPServer
class Handler(BaseHTTPRequestHandler):
def _send(self, status, body):
data = json.dumps(body).encode()
self.send_response(status)
self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(data)))
self.end_headers()
self.wfile.write(data)
def do_GET(self):
if self.path == "/ping":
self._send(200, {"status": "Healthy"})
else:
self._send(404, {"error": "not found"})
def do_POST(self):
if self.path == "/invocations":
length = int(self.headers.get("Content-Length", 0))
self.rfile.read(length)
self._send(200, {"machine": platform.machine(), "system": platform.system()})
else:
self._send(404, {"error": "not found"})
HTTPServer(("0.0.0.0", 8080), Handler).serve_forever()
ECR リポジトリの作成、ビルド、ログイン、push の順に実行します。
aws ecr create-repository --repository-name devio-x86-verify --region ap-northeast-1
docker buildx build --platform linux/amd64 --load -t 123456789012.dkr.ecr.ap-northeast-1.amazonaws.com/devio-x86-verify:v1 .
aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-northeast-1.amazonaws.com
docker push 123456789012.dkr.ecr.ap-northeast-1.amazonaws.com/devio-x86-verify:v1
x86_64 の Runtime の作成
Runtime は、実行ロールを使って ECR からイメージを取得します。
実行ロールの作成
信頼ポリシーは trust-policy.json として保存します。
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"bedrock-agentcore.amazonaws.com"},"Action":"sts:AssumeRole","Condition":{"StringEquals":{"aws:SourceAccount":"123456789012"}}}]}
ロールポリシーは role-policy.json として保存します。
{"Version":"2012-10-17","Statement":[
{"Effect":"Allow","Action":["ecr:BatchGetImage","ecr:GetDownloadUrlForLayer"],"Resource":"arn:aws:ecr:ap-northeast-1:123456789012:repository/devio-x86-verify"},
{"Effect":"Allow","Action":"ecr:GetAuthorizationToken","Resource":"*"},
{"Effect":"Allow","Action":["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents","logs:DescribeLogStreams"],"Resource":"arn:aws:logs:ap-northeast-1:123456789012:log-group:/aws/bedrock-agentcore/runtimes/*"}
]}
2つのファイルを置いたディレクトリで実行します。
aws iam create-role --role-name devio-x86-verify-role --assume-role-policy-document file://trust-policy.json
aws iam put-role-policy --role-name devio-x86-verify-role --policy-name devio-x86-verify-policy --policy-document file://role-policy.json
x86_64 の Runtime を作成するには、次の2つのオプションを指定します。
--platform-version V2--cpu-configurations '[{"architecture":"X86_64"}]'
環境変数 IMAGE_URI には push したイメージの URI を、ROLE_ARN には実行ロールの ARN を設定して、Runtime を作成します。
export IMAGE_URI=123456789012.dkr.ecr.ap-northeast-1.amazonaws.com/devio-x86-verify:v1
export ROLE_ARN=arn:aws:iam::123456789012:role/devio-x86-verify-role
aws bedrock-agentcore-control create-agent-runtime \
--agent-runtime-name devio_x86_verify \
--agent-runtime-artifact "{\"containerConfiguration\":{\"containerUri\":\"$IMAGE_URI\"}}" \
--role-arn "$ROLE_ARN" \
--network-configuration '{"networkMode":"PUBLIC"}' \
--platform-version V2 \
--cpu-configurations '[{"architecture":"X86_64"}]'
CreateAgentRuntime の応答は、status が CREATING で、cpuConfigurations を含んでいませんでした。設定の確認には GetAgentRuntime を使います。
status が READY になるまで、get-agent-runtime を10秒間隔で実行します。環境変数 RUNTIME_ID には、create-agent-runtime の出力にある agentRuntimeId を設定します。
export RUNTIME_ID=<agentRuntimeId>
for i in $(seq 1 60); do
STATUS=$(aws bedrock-agentcore-control get-agent-runtime --agent-runtime-id "$RUNTIME_ID" --query status --output text)
echo "$(date -u +%H:%M:%S) $STATUS"
[ "$STATUS" = READY ] || [ "$STATUS" = CREATE_FAILED ] && break
sleep 10
done
aws bedrock-agentcore-control get-agent-runtime --agent-runtime-id "$RUNTIME_ID"
作成から READY まで3分19秒でした。
READY になった後の GetAgentRuntime の応答から、platformVersion と cpuConfigurations の部分を抜き出します。作成時に指定した値が含まれていました。
"platformVersion": "V2",
"cpuConfigurations": [
{
"architecture": "X86_64"
}
]
Runtime の呼び出し
invoke-agent-runtime で Runtime を呼び出します。環境変数 RUNTIME_ARN に、create-agent-runtime の出力にある agentRuntimeArn を設定して実行します。応答の本文は、最後の引数で指定したファイルに保存されます。
export RUNTIME_ARN=<agentRuntimeArn>
aws bedrock-agentcore invoke-agent-runtime \
--agent-runtime-arn "$RUNTIME_ARN" \
--runtime-session-id "$(cat /proc/sys/kernel/random/uuid)-x86-verify" \
--cli-binary-format raw-in-base64-out \
--payload '{"prompt": "hello"}' \
response.json
cat response.json
実行すると、次のように表示されました。
{
"runtimeSessionId": "<UUID>-x86-verify",
"contentType": "application/json",
"statusCode": 200
}
{"machine": "x86_64", "system": "Linux"}
料金
2026年11月30日時点の東京リージョンでは、Runtime v2 の従量課金(consumption)は x86 のほうが ARM64 より約18%高くなっています。料金は AWS Price List API で取得しました。
| 使用タイプ(usagetype) | 料金 |
|---|---|
| APN1-Runtime:Consumption-based:vCPU-v2 | 0.1276 USD / vCPU 時間 |
| APN1-Runtime:Consumption-based:vCPU-v2-x86 | 0.1505 USD / vCPU 時間 |
| APN1-Runtime:Consumption-based:Memory-v2 | 0.0169 USD / GB 時間 |
| APN1-Runtime:Consumption-based:Memory-v2-x86 | 0.0199 USD / GB 時間 |
Value に使用タイプを指定して取得します。
aws pricing get-products --region us-east-1 \
--service-code AmazonBedrockAgentCore \
--filters Type=TERM_MATCH,Field=usagetype,Value=APN1-Runtime:Consumption-based:vCPU-v2-x86 \
--query 'PriceList' --output text
まとめ
x86(x86_64)アーキテクチャをサポートした AgentCore Runtime v2 の動作を確認できました。
これまでは ARM64 のみでしたが、x86 もサポートされました。x86 のバイナリを持ち込めることや、開発環境が x86 の場合にクロスコンパイルを避けられることで、開発効率の向上が期待できます。
費用面では、従来の ARM64 のほうが安価です。ARM64 環境で不自由がなければ、アーキテクチャはそのまま利用することをおすすめします。











