Terraform-based cloud resource automation method and device and storage medium

Terraform's cloud resource automation method solves the tedious and error-prone problems of traditional cloud resource management, realizes automated management of cloud resources, simplifies the creation and destruction process, improves management efficiency and accuracy, and reduces security risks.

CN118535343APending Publication Date: 2024-08-23BEIJING ZIJING TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410760326.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The traditional cloud resource management method requires manual management through the cloud platform console, which is cumbersome and error-prone. Especially when cloud resources need to be adjusted frequently, the workload is heavy and easy to omit and misconfigurate.

Method used

Provide a cloud resource automation method based on Terraform. By entering the cloud resource management interface, create a new resource stack, set the channel and resource type of the target resource, select the cloud resource standard template, set the resource quantity parameters, and generate cloud resources based on these parameters. Simplify the creation and destruction process of cloud resources, provide unified interface API and SDK, and realize automated management.

Benefits of technology

It reduces manual operations and potential errors, simplifies the cloud resource batch management process, improves management accuracy and efficiency, reduces security risks, and provides comprehensive monitoring and management capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535343A
    Figure CN118535343A
Patent Text Reader

Abstract

The invention relates to a Terraform-based cloud resource automation method and device and a storage medium, and is applied to the technical field of cloud platform management, and the method comprises the steps: determining a set of target resources through newly establishing a resource stack in a cloud resource management interface; setting a channel and a resource type of the target resource in the new resource stack; selecting a finally created cloud resource standard template; setting resource quantity parameters, and determining the quantity of finally created resources; generating a cloud resource of the target resource according to the channel, the resource type and the resource quantity parameter of the target resource and a cloud resource standard template; compared with manual management in the prior art, a user does not need to care about Terraform grammar and the like, resource creation can be automatically completed by using the provided UI interface to input the target parameters and selecting the cloud resource standard template which the user wants to create, an administrator can use the method to simplify the cloud resource batch management process, and the user experience is improved. And manual operation and potential errors are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud platform management, and in particular to a cloud resource automation method, device and storage medium based on Terraform. Background Art

[0002] The traditional cloud resource management method requires manual management through the cloud platform console, which is cumbersome and error-prone. Especially when cloud resources need to be adjusted frequently, the workload is large and it is easy to miss and misconfigure. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a cloud resource automation method, device and storage medium based on Terraform, so as to solve the problem in the prior art that manual management of cloud resources through the cloud platform console is cumbersome and error-prone, especially when cloud resources need to be adjusted frequently, the workload is large and it is easy to miss and misconfigure.

[0004] According to a first aspect of an embodiment of the present invention, a cloud resource automation method based on Terraform is provided, the method comprising:

[0005] Enter the cloud resource management interface;

[0006] Create a new resource stack in the cloud resource management interface and confirm the set of target resources;

[0007] Setting the channel and resource type of the target resource in the newly created resource stack;

[0008] Select the final created cloud resource standard template from the preset standard template library;

[0009] Set the resource quantity parameter to determine the final number of resources created;

[0010] The cloud resources of the target resource are generated according to the channel, resource type, resource quantity parameters of the target resource and a cloud resource standard template.

[0011] Preferably,

[0012] After setting the resource quantity parameters, it also includes:

[0013] Verify the expressions of the channel, resource type and resource quantity parameters of the target resource to determine whether the resource expression is correctly described;

[0014] If the resource expression description is correct, the cloud resource of the target resource is generated according to the channel, resource type, resource quantity parameters of the target resource and the cloud resource standard template.

[0015] Preferably,

[0016] After entering the cloud resource management interface, it also includes:

[0017] Select a created resource stack, and execute a Destroy command in the created resource stack to destroy specified resources.

[0018] Preferably, it also includes:

[0019] An API corresponding to the cloud resource management interface is set and encapsulated into an SDK to obtain a unified interface API and SDK, and a third-party platform enters the cloud resource management interface through the unified interface API and SDK.

[0020] Preferably, it also includes:

[0021] After entering the cloud resource management interface through the unified interface API and SDK, it also includes:

[0022] The user who requests access enters his / her identity information, and the user searches the preset authorized personnel database based on the identity information to determine whether the user is an authorized person.

[0023] If so, you can create a new resource stack or select an already created resource stack and execute the Destroy command in the created resource stack to destroy the specified resource operation; otherwise, exit the cloud resource management interface.

[0024] Preferably, it also includes:

[0025] Record the user's change operations, change data, and change time nodes in the cloud resource management interface and generate an operation management log.

[0026] According to a second aspect of an embodiment of the present invention, a cloud resource automation device based on Terraform is provided, the device comprising:

[0027] Input module: used to enter the cloud resource management interface;

[0028] New creation module: used to create a new resource stack in the cloud resource management interface and confirm the set of target resources;

[0029] Resource parameter determination module: used to set the channel and resource type of the target resource in the newly created resource stack;

[0030] Template selection module: used to select the final created cloud resource standard template from the preset standard template library;

[0031] Quantity parameter setting module: used to set resource quantity parameters and determine the final number of resources created;

[0032] Generation module: used to generate cloud resources of the target resource according to the channel, resource type, resource quantity parameters of the target resource and the cloud resource standard template.

[0033] According to a third aspect of an embodiment of the present invention, there is provided a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a main controller, each step in the above method is implemented.

[0034] The technical solution provided by the embodiments of the present invention may have the following beneficial effects:

[0035] The present application creates a new resource stack in the cloud resource management interface to confirm the set of target resources; sets the channel and resource type of the target resources in the new resource stack; selects the cloud resource standard template that is finally created; sets the resource quantity parameter to determine the number of resources that are finally created; generates cloud resources of the target resources according to the channel, resource type, resource quantity parameter and cloud resource standard template of the target resources; compared with the manual management in the prior art, the present application does not require users to care about Terraform syntax, etc., and can automatically complete resource creation by using the provided UI interface to input target parameters and select the cloud resource standard template that they want to create. Administrators can use this method to simplify the cloud resource batch management process and reduce manual operations and potential errors.

[0036] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0038] Figure 1 is a flow chart of a cloud resource automation method based on Terraform according to an exemplary embodiment;

[0039] Figure 2 is a system schematic diagram of a cloud resource automation device based on Terraform according to another exemplary embodiment;

[0040] In the attached figure: 1-input module, 2-new creation module, 3-resource parameter determination module, 4-template selection module, 5-quantity parameter setting module, 6-generation module. DETAILED DESCRIPTION

[0041] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0042] Embodiment 1

[0043] Figure 1 is a flow chart of a cloud resource automation method based on Terraform according to an exemplary embodiment, such as Figure 1 As shown, the method includes:

[0044] S1, enter the cloud resource management interface;

[0045] S2, creating a new resource stack in the cloud resource management interface and confirming the set of target resources;

[0046] S3, setting the channel and resource type of the target resource in the newly created resource stack;

[0047] S4, selecting the final created cloud resource standard template from the preset standard template library;

[0048] S5, setting resource quantity parameters to determine the final number of resources created;

[0049] S6, generating cloud resources of the target resource according to the channel, resource type, resource quantity parameters of the target resource and a cloud resource standard template;

[0050] It can be understood that the present application confirms the set of target resources by creating a new resource stack in the cloud resource management interface; sets the channel and resource type of the target resource in the new resource stack; selects the cloud resource standard template that is finally created; sets the resource quantity parameter to determine the number of resources that are finally created; generates cloud resources of the target resource according to the channel, resource type, resource quantity parameter and cloud resource standard template of the target resource; compared with the manual management in the prior art, the present application does not require users to care about Terraform syntax, etc., and can automatically complete resource creation by using the provided UI interface to input target parameters and select the cloud resource standard template that they want to create. Administrators can use this method to simplify the cloud resource batch management process and reduce manual operations and potential errors.

[0051] Preferably,

[0052] After setting the resource quantity parameters, it also includes:

[0053] Verify the expressions of the channel, resource type and resource quantity parameters of the target resource to determine whether the resource expression is correctly described;

[0054] If the resource expression is correctly described, the cloud resource of the target resource is generated according to the channel, resource type, resource quantity parameters of the target resource and the cloud resource standard template;

[0055] It is understandable that by directly setting the parameters required to create cloud resources in the new resource stack, there is no need to worry about Terraform syntax, which is simple and convenient. By verifying the parameters, the accuracy of the automated establishment of cloud resources can be further ensured.

[0056] Preferably,

[0057] After entering the cloud resource management interface, it also includes:

[0058] Select a created resource stack, and execute a Destroy command in the created resource stack to destroy specified resources;

[0059] It can be understood that in addition to creating new cloud resources in the cloud resource management interface, this embodiment also provides a way to change and destroy existing cloud resources. That is, after entering the cloud resource management interface, instead of choosing to create a new resource stack, directly click on the existing resource stack and enter the Destroy command to determine the resources you want to change or destroy.

[0060] Preferably, it also includes:

[0061] An API corresponding to the cloud resource management interface is set and encapsulated into an SDK to obtain a unified interface API and SDK, and a third-party platform enters the cloud resource management interface through the unified interface API and SDK;

[0062] It is understandable that the prior art usually involves manual execution of Terraform CLI commands by operation and maintenance, and there are no more diverse implementation methods such as unified APIs and SDKs for multiple third-party platforms to call or integrate, that is, there is no unified calling interface, and it is difficult to manage the calling interface. Therefore, in addition to creating a resource stack in the interface, this application also provides a corresponding API and encapsulates it into an SDK. A third party can directly call the API or integrate the SDK to complete resource management or expansion functions.

[0063] Preferably, it also includes:

[0064] After entering the cloud resource management interface through the unified interface API and SDK, it also includes:

[0065] The user who requests access enters his / her identity information, and the user searches the preset authorized personnel database based on the identity information to determine whether the user is an authorized person.

[0066] If yes, you can create a new resource stack or select an already created resource stack, and execute the Destroy command in the created resource stack to destroy the specified resource operation; otherwise, exit the cloud resource management interface;

[0067] It is understandable that in traditional methods, cloud resource adjustments are usually manually adjusted and managed by personnel with system administrator privileges, which may lead to security risks. Misoperation and access by unauthorized personnel may lead to security vulnerabilities in cloud resources. Therefore, this application also sets up identity authentication, that is, after the user enters the cloud resource management interface through the unified interface, he or she is also required to enter his or her own identity information. The system will compare and query the identity information in the preset authorized personnel information database. If there is a match, it indicates that the user is an authorized manager and can perform subsequent operations such as creating a new resource stack or deleting resources. If there is no match, the user is reminded that he or she is an "unauthorized person" and exits the cloud resource management interface at the same time.

[0068] Preferably, it also includes:

[0069] Record the user's change operations, change data, and change time nodes in the cloud resource management interface and generate an operation management log;

[0070] It is understandable that in the prior art, the record and audit functions of cloud resource change history and administrator operations are often scattered across multiple cloud platforms, which makes troubleshooting, security auditing, and tracking of operators difficult, and lacks comprehensive monitoring and management capabilities for cloud platforms; therefore, the present application also provides unified log management in the cloud resource management interface; that is, after the user enters the cloud resource management interface, any operation instructions and data changes involved in creating a new resource stack or destroying resources in an existing resource stack will record the number of the operating user (the number of the operating user is a unique number assigned based on the authorized personnel information) and the operation time for auditing and troubleshooting. Administrators can view the change records of cloud resources within a specific time period and track key information such as operators and timestamps.

[0071] Embodiment 2:

[0072] Figure 2 is a system schematic diagram of a cloud resource automation device based on Terraform according to another exemplary embodiment, the device comprising:

[0073] Input module 1: used to enter the cloud resource management interface;

[0074] New creation module 2: used to create a new resource stack in the cloud resource management interface and confirm the set of target resources;

[0075] Resource parameter determination module 3: used to set the channel and resource type of the target resource in the newly created resource stack;

[0076] Template selection module 4: used to select the final created cloud resource standard template from the preset standard template library;

[0077] Quantity parameter setting module 5: used to set resource quantity parameters and determine the final number of resources created;

[0078] Generating module 6: used to generate cloud resources of the target resource according to the channel, resource type, resource quantity parameters of the target resource and the cloud resource standard template;

[0079] It can be understood that the present application is used to enter the cloud resource management interface through the input module 1; is used to create a new resource stack in the cloud resource management interface and confirm the set of target resources through the new creation module 2; is used to set the channel and resource type of the target resource in the new resource stack through the resource parameter determination module 3; is used to select the final created cloud resource standard template in the preset standard template library through the template selection module 4; is used to set the resource quantity parameter and determine the final created resource quantity through the quantity parameter setting module 5; is used to generate the cloud resource of the target resource according to the channel, resource type, resource quantity parameter and cloud resource standard template of the target resource.

[0080] Embodiment three:

[0081] This embodiment provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a main controller, each step in the above method is implemented;

[0082] It is understandable that the storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0083] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0084] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0085] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0086] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0087] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0088] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0089] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0090] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0091] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A cloud resource automation method based on Terraform, characterized in that: The method comprises: Enter the cloud resource management interface; Create a new resource stack in the cloud resource management interface and confirm the set of target resources; Setting the channel and resource type of the target resource in the newly created resource stack; Select the final created cloud resource standard template from the preset standard template library; Set the resource quantity parameter to determine the final number of resources created; The cloud resources of the target resource are generated according to the channel, resource type, resource quantity parameters of the target resource and a cloud resource standard template.

2. The method according to claim 1, characterized in that After setting the resource quantity parameters, it also includes: Verify the expressions of the channel, resource type and resource quantity parameters of the target resource to determine whether the resource expression is correctly described; If the resource expression description is correct, the cloud resource of the target resource is generated according to the channel, resource type, resource quantity parameters of the target resource and the cloud resource standard template.

3. The method according to claim 2, characterized in that After entering the cloud resource management interface, it also includes: Select a created resource stack, and execute a Destroy command in the created resource stack to destroy specified resources.

4. The method according to claim 3, characterized in that: Also includes: An API corresponding to the cloud resource management interface is set and encapsulated into an SDK to obtain a unified interface API and SDK, and a third-party platform enters the cloud resource management interface through the unified interface API and SDK.

5. The method according to claim 4, characterized in that Also includes: After entering the cloud resource management interface through the unified interface API and SDK, it also includes: The user who requests access enters his / her identity information, and the user searches the preset authorized personnel database based on the identity information to determine whether the user is an authorized person. If so, you can create a new resource stack or select an already created resource stack and execute the Destroy command in the created resource stack to destroy the specified resource operation; otherwise, exit the cloud resource management interface.

6. The method according to claim 5, characterized in that Also includes: Record the user's change operations, change data, and change time nodes in the cloud resource management interface and generate an operation management log.

7. A cloud resource automation device based on Terraform, characterized in that: The device comprises: Input module: used to enter the cloud resource management interface; New creation module: used to create a new resource stack in the cloud resource management interface and confirm the set of target resources; Resource parameter determination module: used to set the channel and resource type of the target resource in the newly created resource stack; Template selection module: used to select the final created cloud resource standard template from the preset standard template library; Quantity parameter setting module: used to set resource quantity parameters and determine the final number of resources created; Generation module: used to generate cloud resources of the target resource according to the channel, resource type, resource quantity parameters of the target resource and the cloud resource standard template.

8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the main controller, each step in the Terraform-based cloud resource automation method as described in any one of claims 1-6 is implemented.

Citation Information

Cited By

  • Cloud resource deployment method and device, electronic equipment and storage medium

    CN119917112A