×
Community Blog Developing Custom Rules for Cloud Config

Developing Custom Rules for Cloud Config

The article explained Cloud Config custom rules and how to create them using Function Compute functions.

By Pablo Puig

What Is a Cloud Config Custom Rule?

Cloud Config monitors and tracks the configuration changes of your resources and evaluates configuration compliance. Cloud Config provides managed rules to evaluate resources. However, if the managed rules provided by Alibaba Cloud do not meet your requirements, you can create custom rules based on Function Compute. When a rule is triggered, Cloud Config invokes the corresponding rule function to evaluate the associated resources and returns the compliance evaluation results of the resources.

Developing a Custom Rule

The following step-by-step guide explains how to develop and create a Cloud Config custom rule from the Alibaba Cloud console. The diagram below describes the steps required:

1

  • Step 1: Log in to your Alibaba Cloud account and go to the Cloud Config service.

Note: Before you create a Cloud Config custom rule, you must create a function for the rule in Function Compute first.

  • Step 2: Click on the Services and Functions section. Create the service and provide the required information, including Service Name and Service Description. Then, click Next.

2

  • Step 3: Select the Creation Method you want to use to create the function and click Next.

Note: For this demo, I’m going to select the Creation Method of Function Template and use the aliyun-config-python3 template for my function.

3

  • Step 4: Configure your function by entering the following properties:

    • Function Name
    • Runtime
    • Instance Type
    • Function Handler
    • Memory
    • Timeout

Once you have introduced all properties, click Next.

4

  • Step 5: Once you have your Function Compute function created, go to the Cloud Config service.
  • Step 6: Click on the Rules section and then click Create Rule.

5

  • Step 7: Click Create Custom Rule

6

  • Step 8: Select the Region, Service, and Function you created in the previous steps. Then, enter a Rule Name and select the Risk Level of the custom rule you are about to create. Next, select the Trigger Type and click Next.

7

  • Step 9: Select the related resources (All Supported Resource Types or Custom Resource Types.)

8

  • Step 10: Specify the required names and thresholds for input parameters based on the logic of a custom function and then click Next.

9

  • Step 11: You cannot modify the current rule. Therefore, click Next.

10

  • Step 12: After reviewing your configuration, click Submit.

11

Once your Cloud Config custom rule is created you can click Return to Rule List. You will find your custom rule on the list.

12

Conclusion

The article explained Cloud Config custom rules and how to create them using Function Compute functions.

0 2 0
Share on

Alibaba Cloud Community

1,044 posts | 257 followers

You may also like

Comments

Alibaba Cloud Community

1,044 posts | 257 followers

Related Products