You can go with any of both approaches, according to your topology, if you require more ports to use this VLAN and have an SVI interface to route this VLAN traffic go with the second solution, while if you require only point to point connectivity between the switch and the router go with the first solution.
both configurations work, but the first in your design could have more sense. If you need just a routed port, the first is enough. If you would that router will be the vlan5 default gateway, so use the second (without SVI if you please, that's not necessary).
The difference between configurations is: the first is a routed port, so consider that just a L3; the second is a switchport (in your case in access mode, but could be have more sense in another scenario in case of trunk mode, carrying more vlans), so a L2 port that has a L3 virtual interface corresponding the vlan in access.
more infos about difference between routed port and SVI:
Mohammed, you hit the nail on the head. Not only did you answer the question, but you preempted me asking the follow-up, which would have been regarding the case of adding more router connections in the same vlan. :-)
In fact, there are several router connections that the client has placed in the same vlan, so I would use the second scenario.
Andrea, thank you for your input and the link. I will check it out further.
We are pleased to announce availability of Beta software for 16.6.3.
16.6.3 will be the second rebuild on the 16.6 release train targeted
towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are
looking for early feedback from customers befor...
Introduction Featured Speakers Luis Espejel is the Telecommunications
Manager of IENova, an Oil & Gas company. Currently he works with Cisco
IOS® and Cisco IOS XE platforms, and NX to some extent. He has also
worked as a Senior Engineer with the Routing P...
In this session you can learn more about Layer 3 multicast and the best
practices to identify possible threats and take security measures. It
provides an overview of basic multicast, the best security practices for
use of this technology, and recommendati...