Resource Initialization error in ECS fargate service

0

I have created task defintion with cft and passed the environment variable through the arn of s3 bucket. Its working for one service but for another its giving resource initialization errror.

The env file is available in the s3 bucket still I am getting this error and permission to get object from s3 bucket is also given.

These are the permissions which are given to the execution role:

s3:ListBucket,s3:PutObject,s3:GetObject,s3:GetBucketLocation,sqs:sendmessage,ecr:GetAuthorizationToken,ecr:BatchCheckLayerAvailability,ecr:GetDownloadUrlForLayer,ecr:BatchGetImage,logs:CreateLogStream,logs:PutLogEvents,ecs:RunTask,iam:PassRole

Enter image description here

1回答
0

Ref: https://repost.aws/knowledge-center/ecs-task-environment-variables

"ResourceInitializationError: failed to download env files: file download command: non empty error stream"

You might face issues when you pass environment variables to your Amazon ECS tasks due to the following reasons:

Your Amazon ECS task execution role doesn't have the required AWS Identity and Management (IAM) permissions. There are issues with your network configuration. Your application is unable to read the environment variable. The format of variable in the container definition is incorrect. The environment variable isn't automatically refreshed. To troubleshoot the errors for Amazon ECS tasks that fail to start, use the AWSSupport-TroubleshootECSTaskFailedToStart runbook. Then, refer to the relevant troubleshooting steps for your issue.

It could also be linking wrong security group to the service or attaching internet gateway to route table . Check if public ip is enabled on ECS

profile picture
回答済み 5ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ