private List<ValidationEvent> validateResource(
            Model model,
            CfnResourceIndex cfnResourceIndex,
            ResourceShape resource
    ) {
        CfnResourceTrait trait = resource.expectTrait(CfnResourceTrait.class);
        List<ValidationEvent> events = new ArrayList<>();
        String resourceName = trait.getName().orElse(resource.getId().getName());

        if (trait.getPrimaryIdentifier().isPresent()) {
            validateResourcePrimaryIdentifier(model, resource, trait.getPrimaryIdentifier().get())
                    .ifPresent(events::add);
        }

        Optional<CfnResource> cfnResourceOptional = cfnResourceIndex.getResource(resource);
        if (cfnResourceOptional.isPresent()) {
            for (Map.Entry<String, CfnResourceProperty> property : cfnResourceOptional.get()
                    .getProperties()
                    .entrySet()) {
                validateResourceProperty(model, resource, resourceName, property).ifPresent(events::add);
            }
        }

        return events;
    }
Validates that derived CloudFormation properties all have the same target.
smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourcePropertyValidator.java