private Pair<ShapeId, Map<ShapeId, ArnTrait>> compileServiceArns(TopDownIndex index, ServiceShape service) {
        Map<ShapeId, ArnTrait> mapping = new HashMap<>();
        for (ResourceShape resource : index.getContainedResources(service.getId())) {
            resource.getTrait(ArnTrait.class).ifPresent(arnTrait -> {
                mapping.put(resource.getId(), arnTrait);
            });
        }

        return Pair.of(service.getId(), Collections.unmodifiableMap(mapping));
    }
Resolves and indexes the ARN templates for each resource in a service.
smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java