I have setup an ECS Fargate service. Task is setup with a task role. Also, I have a VPC endpoint setup for the Rekognition service. However, I am getting a 504 Gateway timeout when calling the Rekognition service API.
Please note that I am able to make a call to the S3 buckets with a similar setup.
What am I missing when connecting to the Rekognition API?
Task Role Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rekognition:*"
],
"Resource": "*"
}
]
}
Task Role Trust Relations:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "ecs-tasks.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Service Security Group Inbound/Outbound Rules:
Subnets: ECS Services are running in a private subnet.
Upon rechecking my network configurations, I realized I had not enabled the Private DNS names
flag preventing me from using the Rekognition API. Thanks to @MarkB for the help.
To summarize:
AmazonRekognitionFullAccess
policy to the Task Role.com.amazonaws.us-west-2.rekognition
. Also, enable the Private DNS names.