TeamCity AWS ECS - too many agents spawned

Answered

Hi,

I've set up TeamCity cloud profile for Fargate. When I enable the profile, TeamCity continously starts more and more tasks in Fargate. My settings in cloud profile allow only 1 instance to created. It creates like 50 before I disable the profile.

I wonder if TeamCity is unable to tell if the task is actually started?

My policy for TeamCity AWS user:

{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ecs:RegisterTaskDefinition",
"ecs:ListClusters",
"ecs:DescribeClusters",
"ecs:DescribeContainerInstances",
"ecs:ListTaskDefinitions",
"ecs:ListTasks",
"ecs:DescribeTaskDefinition",
"cloudwatch:GetMetricStatistics",
"ecs:RunTask",
"ecs:StopTask",
"ecs:ListContainerInstances",
"iam:PassRole",
"iam:ListInstanceProfiles",
"ec2:*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}

2 comments
Comment actions Permalink

Hi Alex,

I don't seem to find anything particularly wrong about it, is the image configured to start the agent on startup? It might be that the amazon server is not responding properly or the response is not properly understood by teamcity. I'd recommend checking the teamcity-clouds.log to see if anything is logged when you attempt to connect.

 

Which version of teamcity are you using?

0
Comment actions Permalink

Hi Denis,

the problem was - I did not have ecs:DescribeTask permission in the policy, my bad. (I found errors in the teamcity-clouds.log. But it would be great if instead of continuing to spawn more tasks, TC will actually error in a more visible way - like show "Missing permission" in the cloud profile or something like that.

 

Thanks

Alex

0

Please sign in to leave a comment.