We propose a dynamic auction mechanism to solve the allocation problem of computation capacity in the environment of cloud computing. Truth-telling property holds when we apply a second-priced auction mechanism into the resource allocation problem. Thus, the cloud service provider (CSP) can assure reasonable profit and efficient allocation of its computation resources. In the cases that the number of users and resources are large enough, potential problems in second-priced auction mechanism, including the variation of revenue, will not be weighted seriously since the law of large number holds in this case.