Skip to content

Commit 1f31841

Browse files
seongpil0948jj22ee
andauthored
feat: Apply suggestions from code review
thank you @jj22ee Co-authored-by: Jonathan Lee <[email protected]>
1 parent 2ee2f08 commit 1f31841

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/resource-detector-aws/src/detectors/AwsEcsDetector.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class AwsEcsDetector implements ResourceDetector {
186186

187187
// Primary pattern: Match /ecs/taskId/taskId-containerId format (new ECS Fargate)
188188
// This captures the full taskId-containerId part after the last slash
189-
const ecsPattern = /\/ecs\/[a-zA-Z0-9-]+\/([a-zA-Z0-9-]+)$/;
189+
const ecsPattern = /\/ecs\/[a-fA-F0-9-]+\/([a-fA-F0-9-]+)$/;
190190
const ecsMatch = line.match(ecsPattern);
191191
if (
192192
ecsMatch &&
@@ -212,8 +212,7 @@ export class AwsEcsDetector implements ResourceDetector {
212212

213213
// Legacy fallback: original logic for lines that are just the container ID (64 chars)
214214
if (
215-
line.length > AwsEcsDetector.CONTAINER_ID_LENGTH &&
216-
!line.includes('/')
215+
line.length > AwsEcsDetector.CONTAINER_ID_LENGTH
217216
) {
218217
return line.substring(line.length - AwsEcsDetector.CONTAINER_ID_LENGTH);
219218
}

0 commit comments

Comments
 (0)