Day after day, the number of mobile applications deployed on cloud computing continues in increasing because of smartphone capabilities improvement. Cloud computing has already succeeded in the web-based application, for that reason, the demand for context-aware services provided by cloud computing increases. To customize a cloud service that takes into account the consumer requirements, which depend on information change, it brings to light many recent challenges to cloud computing about environment-aware, location-aware, time-aware. The cloud provider, moreover, has to manage personalized applications and the constraints of mobile devices in matters of interaction abilities and communication restrictions. This paper proposes a strategy for selecting automatically an appropriate cloud environment that runs out whole requirements, defines a configuration for the associated cloud environment and able to easily adapt to the change of the environment on either the user or the cloud side or both. This process builds on the principles of dynamic software product lines, Agent-oriented software engineering, and the MAPE-k model to select and configure cloud environments according to the consumer needs and the context change.