Improve swig'ing of cloud providers to allow casting

[#54814872]
Merge remote-tracking branch 'remotes/origin/develop' into PAT-EC2
Fixing compile error introduced in 54c557611e5d5fe7dd5b1c2a351d4c9635bdfcc4