Make deployments work and add resource replacement.