utility function to return deployments in a given state for a given stack name