Added DependsOn attributes to CloudFormation template

This will tell CloudFormation how to better handle resource dependencies and avoid randomly failed stack creations