The invention discloses a method and a
system for realizing elastic expansion and contraction of cloud platform resources based on Terraform, and belongs to the field of
cloud computing pass. The technical problem to be solved by the invention is how to ensure that resources are created as required. meet requirement of dynamically adjusting according to the
service flow, increase the actual utilization of resources, and achieve efficient reduction of
operating cost. According to the technical scheme, the method comprises the steps that an open-source Terraform tool and an Etcd
database are used; editing a Terraform template according to an elastic stretching strategy of the tenant; the Terraform template is executed through a Terraform tool of a provider plug-in provided by the cloud platform, so that the template is obtained; therefore, the resources of the tenants on the cloud platform are dynamically controlled, the effect of elastic expansion and contraction of the resources is achieved, and creation and deletion operation of the tenant resources and decoupling and separation of infrastructure
resource management and upper-layer applications on the cloud platform are achieved.The
system adopts a micro-service technical architecture and comprises a UI layer, a
business logic layer and an
infrastructure management layer, and the UI layer is used for interacting with a user,receiving user configuration, forwarding the user configuration to the service logic layer for
processing and presenting a
processing result to the user.