[CloudFormation] Better populate resource attributes

Avoid n+1 redundant queries to populate stack resource attributes.

Per @trevorrowe’s comment: http://git.io/J2EFyw