Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Missing Details in log_resource_record Documentation #7908

Open
A-nony-mous opened this issue Nov 27, 2024 · 2 comments
Open

[feat] Missing Details in log_resource_record Documentation #7908

A-nony-mous opened this issue Nov 27, 2024 · 2 comments

Comments

@A-nony-mous
Copy link

The Terraform documentation for SLS Log resource lacks sufficient detail for its arguments. For example, it mentions:

  • resource_name (Required): The name defined in log_resource. However, the explanation is vague and only references internal resources like sls.common.user or sls.common.user_group without clear guidance or examples.

I also reached out to Alibaba Cloud support for clarification, but they were unable to provide further details.😐

I discovered additional relevant information in an Aliyun Cloud blog post from March 2022. The blog provides more details on using log_resource_record, and I tested the guidance locally—it worked as expected.

I think keep git file and Aliyun Cloud blog post the same will do. If you agree, I can contribute by making a PR to address this issue.


SLS日志资源文档里面没有具体写相应的资源。如:

  • resource_name (Required): The name defined in log_resource. However, the explanation is vague and only references internal resources like sls.common.user or sls.common.user_group without clear guidance or examples.

我也跟阿里云客服咨询,他们说“我也不太熟”、“详细和准确的信息可以问问社区” (不截图了)😕😕😕😕😕

我在阿里云开发者社区找到了一篇有相关信息的博文。虽然是2022年3月的文章, 我试了一下还是可以用的。

我觉得保持 Githubpo文 保持一样就行了。 如果可以的话,我可以提一个PR。

Affected Resource(s)

SLS

Terraform Configuration Files

resource "alicloud_log_resource_record" "action_sls_java_log_alert" {
  # id            = "sls.alert.action_policy:sls.alert.log_1"
  record_id     = "sls.alert.log_1"
  resource_name = "sls.alert.action_policy"
  tag           = "java日志告警策略"
  value         = jsonencode(
    {
      action_policy_id              = "sls.alert.log_1"
      action_policy_name            = "java日志告警策略"
      enabled                       = true
      escalation_enabled            = false
      escalation_inprogress_enabled = false
      escalation_inprogress_timeout = "10m"
      escalation_start_enabled      = false
      escalation_start_timeout      = "10m"
      escalation_timeout            = "24h"
      is_default                    = false
      labels                        = {}
      primary_policy                = {
        links = [
          {
            inputPortId  = "eqweqweqwen_1"
            label        = ""
            outputPortId = "b21qweqwe_1"
            source       = "bqweqwewqecb"
            sourceAnchor = "bottom"
            target       = "ec88fqweqweqwea61"
            targetAnchor = "top"
          },
          {
            inputPortId  = "b2qweqwewqe1"
            label        = ""
            outputPortId = "0_out_1"
            source       = "0"
            sourceAnchor = "bottom"
            target       = "bqweqweqweb"
            targetAnchor = "top"
          },
        ]
        nodes = [
          {
            height     = 50
            id         = "0"
            inPorts    = []
            leftPorts  = []
            outPorts   = [
              {
                id       = "0_out_1"
                sequence = 1
              },
            ]
            rightPorts = []
            type       = "node-start"
            width      = 120
            x          = 0
            y          = 0
          },
          {
            height     = 450
            id         = "bqweqweqwecb"
            inPorts    = [
              {
                id       = "bqweqweqwe1"
                sequence = 1
              },
            ]
            leftPorts  = []
            outPorts   = [
              {
                id       = "bqweqwewqe1"
                sequence = 1
              },
            ]
            payload    = {
              actions        = [
                {
                  checkQuota      = "true"
                  eventBridgeName = ""
                  externalHeaders = []
                  externalUrl     = ""
                  functionName    = ""
                  headersArray    = []
                  method          = "POST"
                  period          = "any"
                  qualifier       = "LATEST"
                  region          = "cn-hangzhou"
                  remindType      = "noAt"
                  service         = ""
                  serviceUri      = ""
                  templateId      = "sqweqwewqeg"
                  type            = "iwqeqwewqk"
                  webhookId       = "qweqwewqe1"
                },
              ]
              owner          = []
              ownerType      = "first"
              setTicketOwner = false
            }
            rightPorts = []
            type       = "noqweqweqwen"
            width      = 440
            x          = -160
            y          = 110
          },
          {
            height     = 50
            id         = "eqweqweqwe1"
            inPorts    = [
              {
                id       = "qweqweqwe_1"
                sequence = 1
              },
            ]
            leftPorts  = []
            outPorts   = []
            rightPorts = []
            type       = "node-end"
            width      = 120
            x          = 0
            y          = 620
          },
        ]
      }
      primary_policy_script         = "qweqwewqewqe"
      secondary_policy              = {}
      secondary_policy_script       = ""
    }
  )
}
@walbertus
Copy link

from the "Basic example" section, it shows that "resource_name" is a reference to another "alicloud_log_resource." I think it's the intended use case for this terraform resource.

Are you referring to using this resource to add records to internal SLS resources? https://www.alibabacloud.com/help/en/sls/developer-reference/data-structure-of-alert-resource-data

@A-nony-mous
Copy link
Author

A-nony-mous commented Dec 10, 2024

from the "Basic example" section, it shows that "resource_name" is a reference to another "alicloud_log_resource." I think it's the intended use case for this terraform resource.

Are you referring to using this resource to add records to internal SLS resources? https://www.alibabacloud.com/help/en/sls/developer-reference/data-structure-of-alert-resource-data

Yes, the link you provided contains content almost identical to what I shared, though it lacks an example of an alert resource. For some reason, this information is not included in the log_resource_record documentation. It seems this might be intended specifically for SDK development rather than for tf usage.

But in anyway, this file can be and should be able to add to docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants