1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

「There is a connection issue between the task and Amazon ECR. Check your task network configuration.」の解決方法【ALB/ECS】

1
Posted at

はじめに

React + Hono + PostgreSQLで作っているTodoアプリを、AWS ECS FargateとALBを使ってデプロイしたところエラーが発生しました。

構成

ユーザー
  |
  v
ALB
  |-- /api/* → backend コンテナ
  |              |
  |              `-- PostgreSQL コンテナ
  |
  `-- その他 → frontend コンテナ

問題

ResourceInitializationError: 
unable to pull secrets or registry auth: 
The task cannot pull registry auth from Amazon ECR: 
There is a connection issue between the task and Amazon ECR. 
Check your task network configuration. operation error ECR: 
GetAuthorizationToken, exceeded maximum number of attempts, 3, 
https response error StatusCode: 0, RequestID: , request send failed, 
Post "https://api.ecr.ap-northeast-1.amazonaws.com/": dial tcp 3.112.64.212:443: i/o timeout

解決方法

ECS, ALBに設定しているセキュリティグループにそれぞれアウトバウンドルールを追加し、再度デプロイ。

アウトバウンドルール

タイプ:すべてのトラフィック
送信先:0.0.0.0/0

おわりに

アウトバウンドルールはデフォルトで設定されていたはずですが、消してしまったことによりエラーになっていました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?