private Optional<ValidationEvent> validateResourceProperty(
            Model model,
            ResourceShape resource,
            String resourceName,
            Map.Entry<String, CfnResourceProperty> property
    ) {
        Set<ShapeId> propertyTargets = new TreeSet<>();
        for (ShapeId shapeId : property.getValue().getShapeIds()) {
            model.getShape(shapeId).ifPresent(shape ->
            // Use the member target or identifier definition shape.
            OptionalUtils.ifPresentOrElse(shape.asMemberShape(),
                    memberShape -> propertyTargets.add(memberShape.getTarget()),
                    () -> propertyTargets.add(shapeId)));
        }

        if (propertyTargets.size() > 1) {
            return Optional.of(error(resource,
                    format("The `%s` property of the generated `%s` "
                            + "CloudFormation resource targets multiple shapes: %s. Reusing member names that "
                            + "target different shapes can cause confusion for users of the API. This target "
                            + "discrepancy must either be resolved in the model or one of the members must be "
                            + "excluded from the conversion.",
                            property.getKey(),
                            resourceName,
                            propertyTargets)));
        }

        return Optional.empty();
    }
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