private Function<CfnResourceProperty, CfnResourceProperty> getCfnResourcePropertyUpdater(
            MemberShape member,
            Set<Mutability> explicitMutability,
            Function<Set<Mutability>, Set<Mutability>> updater
    ) {
        return definition -> {
            CfnResourceProperty.Builder builder = definition.toBuilder().addShapeId(member.getId());

            if (explicitMutability.isEmpty()) {
                // Update the existing mutabilities.
                builder.mutabilities(updater.apply(definition.getMutabilities()));
            } else {
                // Handle explicit mutability from any trait location.
                builder.hasExplicitMutability(true)
                        .mutabilities(explicitMutability);
            }

            return builder.build();
        };
    }
Gets the definition of the specified CloudFormation resource.

@param resource ShapeID of a resource
@return The resource definition.
smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourceIndex.java