I was specifically referring to any CDN functionality, in case that was provided by a third party add-on. Obviously XF or XFMG can't advise you on how to set up a CDN. Aside from the config values in the code above which we provide, I can't vouch for how you are synchronising the contents of your internal_data and data directories to the CDN, nor can I advise you on how you would do that. That would be purely down to your CDN provider or CDN add-on if you have one.
That said, the configuration above only affects the URL where thumbnails and JS are served from. Attachments are served from the internal_data directory, but they are not in a directory that is publicly accessible. The attachments URL will always be yoursite/attachments/ but that URL will be accessing the files which are stored in your internal_data/attachments directory. There is a config setting to change the internal_data path, but this generally isn't going to help you in terms of serving images from an external location. That would likely require an add-on or custom development.