generate credentials when a resource is created