AgentCore Runtime の仮イメージ(fd-platform:agentcore-placeholder)
terraform で AgentCore Runtime を作るときに container_uri に入れる仮のイメージ。本物のイメージは、各サービスのデプロイの workflow が置き換える(lifecycle.ignore_changes で agent_runtime_artifact を外しておく)。
なぜ fd-platform:dummy-ecr ではいけないか
AgentCore は Runtime を作るときに、コンテナの 8080 の GET /ping でヘルスチェックをする。応えないと CREATE_FAILED(The runtime failed its health check. Ensure your container serves the configured health endpoint.)になる。fd-platform:dummy-ecr は /ping に応えないので、2026-11-18 に ai-supervisor の Runtime を作れなかった(2025 年にこのイメージで作った online-ai-service の Runtime は READY のままなので、ヘルスチェックはその後に始まったとみられる)。
このイメージは /ping に {"status":"Healthy"} を返し、/invocations には 503 を返す。
置いてある場所
| アカウント | URI | digest |
|---|---|---|
| staging(301608970378) | 301608970378.dkr.ecr.ap-northeast-1.amazonaws.com/fd-platform:agentcore-placeholder | sha256:7582dd25302b1cdb32789515f1a3ed89305257d6e08f0b38b10e77e3529066d0 |
| production(967691968827) | 967691968827.dkr.ecr.ap-northeast-1.amazonaws.com/fd-platform:agentcore-placeholder | 同じ |
fd-platformは IMMUTABLE で、ライフサイクルは「20 個を超えたら古いものから消す」。2026-11-18 時点のイメージはdummy-ecrとこれの 2 つだけ- Runtime の実行ロールに
fd-platformのecr:BatchGetImage・ecr:GetDownloadUrlForLayerを許しておく(作るときに AgentCore がこのロールで取りに行く) - 使っている Runtime: ai-supervisor(
template_modules/ai-supervisor/agentcore.tf)
作り方(ほかのアカウントに置くとき)
base image を使わない(scratch に Go の静的なバイナリを入れるだけ)。AgentCore は arm64 で動かすので、arm64 で作る。
main.go:
go
// AgentCore Runtime の仮イメージ。terraform で Runtime を作るときだけに使い、デプロイで本物のイメージに置き換える。
// AgentCore は作成時に 8080 の /ping でヘルスチェックをするので、Healthy を返す。/invocations は 503 を返す。
package main
import (
"fmt"
"net/http"
"time"
)
func main() {
http.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
fmt.Fprintf(w, `{"status":"Healthy","time_of_last_update":%d}`, time.Now().Unix())
})
http.HandleFunc("/invocations", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusServiceUnavailable)
fmt.Fprint(w, `{"error":"placeholder image: deploy the real agent image"}`)
})
if err := http.ListenAndServe(":8080", nil); err != nil {
panic(err)
}
}go.mod:
module agentcore-placeholder
go 1.22Dockerfile:
dockerfile
FROM scratch
COPY server /server
USER 65534:65534
EXPOSE 8080
ENTRYPOINT ["/server"]bash
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o server .
docker build --platform linux/arm64 -t agentcore-placeholder .
docker run -d --rm -p 18080:8080 --name acph agentcore-placeholder && curl -s localhost:18080/ping && docker rm -f acph
ACCOUNT=<アカウント ID>
REG=$ACCOUNT.dkr.ecr.ap-northeast-1.amazonaws.com
aws ecr get-login-password --profile <プロファイル> | docker login -u AWS --password-stdin $REG
docker tag agentcore-placeholder $REG/fd-platform:agentcore-placeholder
docker push $REG/fd-platform:agentcore-placeholder