ALIYUN::Config::ReportTemplate

更新时间:
复制 MD 格式

ALIYUN::Config::ReportTemplate类型用于创建合规报告模版。

语法

{
  "Type": "ALIYUN::Config::ReportTemplate",
  "Properties": {
    "ReportTemplateName": String,
    "ReportGranularity": String,
    "ReportScope": List,
    "ReportFileFormats": String,
    "ReportLanguage": String,
    "ReportTemplateDescription": String,
    "SubscriptionFrequency": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ReportTemplateName

String

报表模板名称。

ReportFileFormats

String

报表格式。

取值:

  • excel

ReportGranularity

String

报表聚合粒度。

ReportLanguage

String

报表内容语言。

取值:

  • zh-CN

  • en-US

ReportScope

List

报表范围,

多组键值对之间为 AND 逻辑。更多信息,请参考ReportScope属性

ReportTemplateDescription

String

报表模板描述。

SubscriptionFrequency

String

报表订阅频率。

若该字段不为空,则为 Quartz 格式的 Cron 表达式,用于触发订阅通知。

格式为:秒、分、时、日、月、周。以下为常用 Cron 表达式示例:

- 每天 0 点执行:0 0 0 * * ?

- 每周一 15:30 执行:0 30 15 ? * MON

- 每月 1 日 2 点执行:0 0 2 1 * ?

其中:

- "*" 表示任意值。

- "?" 用于日和周字段,表示不指定具体值。

- MON 表示周一。

> 触发时间为 UTC+8,可根据时区转换 Cron 表达式的设置。

> 仅能尽可能按 Cron 表达式时间触发,Cron 表达式限制同一模板每天最多触发一次通知。

ReportScope语法

"ReportScope": [
  {
    "MatchType": String,
    "Value": String,
    "Key": String
  }
]

ReportScope属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

报表范围的键,

当前支持:

  • AggregatorId

  • CompliancePackId

  • RuleId。

MatchType

String

匹配逻辑。

取值:

  • In

Value

String

报表范围的值,

每个键值对之间为 OR 逻辑。例如,多个规则 ID 可用逗号(,)分隔。

返回值

Fn::GetAtt

  • ReportGranularity:报表聚合粒度。

  • ReportTemplateId:报表模板 ID。

  • ReportScope:报表范围,多组键值对之间为 AND 逻辑。

  • ReportFileFormats:报表格式,当前仅支持 `excel`。

  • SubscriptionFrequency:报表订阅频率。若该字段不为空,则为 Quartz 格式的 Cron 表达式,用于触发订阅通知。

  • ReportTemplateName:报表模板名称。

  • ReportLanguage:报表内容语言,当前仅支持 `zh-CN` 或 `en-US`。

  • ReportTemplateDescription:报表模板描述。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ReportFileFormats:
    AllowedValues:
      - excel
    Description:
      en: Report Format. Currently only support `excel`.
    Required: false
    Type: String
  ReportGranularity:
    Description:
      en: Report Aggregation Granularity.
    Required: false
    Type: String
  ReportLanguage:
    Description:
      en: Report Content Language, Currently only support `zh-CN` or `en-US`.
    Required: false
    Type: String
  ReportScope:
    AssociationProperty: List[Parameters]
    AssociationPropertyMetadata:
      Parameters:
        Key:
          AllowedValues:
            - AggregatorId
            - CompliancePackId
            - RuleId
          Description:
            en: 'Key for reporting scope, currently supported:

              - AggregatorId

              - CompliancePackId

              - RuleId.'
          Required: false
          Type: String
        MatchType:
          AllowedValues:
            - In
          Description:
            en: The matching logic. Currently, only In is supported.
          Required: false
          Type: String
        Value:
          Description:
            en: The value of the report range. Each k-v pair is an OR logic. For example,
              multiple rule IDs can be separated by commas (,).
          Required: false
          Type: String
    Description:
      en: Report range, yes and logic between multiple sets of k-v pairs.
    MaxLength: 2
    MinLength: 0
    Required: false
    Type: Json
  ReportTemplateDescription:
    Description:
      en: Report Template Description.
    Required: false
    Type: String
  ReportTemplateName:
    Description:
      en: Report Template Name.
    Required: true
    Type: String
  SubscriptionFrequency:
    Description:
      en: 'Report subscription frequency. If this field is not empty, it is a Cron
        expression in Quartz format triggered by the subscription notification.

        The format is: Seconds, time, day, month, week. The following are examples
        of commonly used Cron expressions:

        - Execute at 0 o''clock every day: 0 0 0 * *?

        - Every Monday at 15: 30: 0 30 15? * MON

        - Execute at 2 o''clock on the 1st of each month: 0 0 2 1 *?

        Among them:

        - "*" Indicates any value

        - What-? Used for day and week fields, indicating that no specific value is
        specified

        - MON means Monday

        > The trigger time is UTC +8, and the settings of the cron expression can
        be converted according to the time zone.

        > It can only be triggered according to the cron expression time as much as
        possible. The cron expression limits the same template to trigger at most
        one notification per day.'
    Required: false
    Type: String
Resources:
  ExtensionResource:
    Properties:
      ReportFileFormats:
        Ref: ReportFileFormats
      ReportGranularity:
        Ref: ReportGranularity
      ReportLanguage:
        Ref: ReportLanguage
      ReportScope:
        Ref: ReportScope
      ReportTemplateDescription:
        Ref: ReportTemplateDescription
      ReportTemplateName:
        Ref: ReportTemplateName
      SubscriptionFrequency:
        Ref: SubscriptionFrequency
    Type: ALIYUN::Config::ReportTemplate
Outputs:
  ReportFileFormats:
    Description: Report Format. Currently only support `excel`.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ReportFileFormats
  ReportGranularity:
    Description: Report Aggregation Granularity.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ReportGranularity
  ReportLanguage:
    Description: Report Content Language, Currently only support `zh-CN` or `en-US`.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ReportLanguage
  ReportScope:
    Description: Report range, yes and logic between multiple sets of k-v pairs.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ReportScope
  ReportTemplateDescription:
    Description: Report Template Description.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ReportTemplateDescription
  ReportTemplateId:
    Description: Report template Id.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ReportTemplateId
  ReportTemplateName:
    Description: Report Template Name.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ReportTemplateName
  SubscriptionFrequency:
    Description: Report subscription frequency. If this field is not empty, it is
      a Cron expression in Quartz format triggered by the subscription notification.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SubscriptionFrequency
                        
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ReportGranularity": {
      "Type": "String",
      "Description": {
        "en": "Report Aggregation Granularity."
      },
      "Required": false
    },
    "ReportScope": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "MatchType": {
            "Type": "String",
            "Description": {
              "en": "The matching logic. Currently, only In is supported."
            },
            "AllowedValues": [
              "In"
            ],
            "Required": false
          },
          "Value": {
            "Type": "String",
            "Description": {
              "en": "The value of the report range. Each k-v pair is an OR logic. For example, multiple rule IDs can be separated by commas (,)."
            },
            "Required": false
          },
          "Key": {
            "Type": "String",
            "Description": {
              "en": "Key for reporting scope, currently supported:\n- AggregatorId\n- CompliancePackId\n- RuleId."
            },
            "AllowedValues": [
              "AggregatorId",
              "CompliancePackId",
              "RuleId"
            ],
            "Required": false
          }
        }
      },
      "Type": "Json",
      "AssociationProperty": "List[Parameters]",
      "Description": {
        "en": "Report range, yes and logic between multiple sets of k-v pairs."
      },
      "Required": false,
      "MinLength": 0,
      "MaxLength": 2
    },
    "ReportFileFormats": {
      "Type": "String",
      "Description": {
        "en": "Report Format. Currently only support `excel`."
      },
      "AllowedValues": [
        "excel"
      ],
      "Required": false
    },
    "SubscriptionFrequency": {
      "Type": "String",
      "Description": {
        "en": "Report subscription frequency. If this field is not empty, it is a Cron expression in Quartz format triggered by the subscription notification.\nThe format is: Seconds, time, day, month, week. The following are examples of commonly used Cron expressions:\n- Execute at 0 o'clock every day: 0 0 0 * *?\n- Every Monday at 15: 30: 0 30 15? * MON\n- Execute at 2 o'clock on the 1st of each month: 0 0 2 1 *?\nAmong them:\n- \"*\" Indicates any value\n- What-? Used for day and week fields, indicating that no specific value is specified\n- MON means Monday\n> The trigger time is UTC +8, and the settings of the cron expression can be converted according to the time zone.\n> It can only be triggered according to the cron expression time as much as possible. The cron expression limits the same template to trigger at most one notification per day."
      },
      "Required": false
    },
    "ReportTemplateName": {
      "Type": "String",
      "Description": {
        "en": "Report Template Name."
      },
      "Required": true
    },
    "ReportLanguage": {
      "Type": "String",
      "Description": {
        "en": "Report Content Language, Currently only support `zh-CN` or `en-US`."
      },
      "Required": false
    },
    "ReportTemplateDescription": {
      "Type": "String",
      "Description": {
        "en": "Report Template Description."
      },
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::Config::ReportTemplate",
      "Properties": {
        "ReportGranularity": {
          "Ref": "ReportGranularity"
        },
        "ReportScope": {
          "Ref": "ReportScope"
        },
        "ReportFileFormats": {
          "Ref": "ReportFileFormats"
        },
        "SubscriptionFrequency": {
          "Ref": "SubscriptionFrequency"
        },
        "ReportTemplateName": {
          "Ref": "ReportTemplateName"
        },
        "ReportLanguage": {
          "Ref": "ReportLanguage"
        },
        "ReportTemplateDescription": {
          "Ref": "ReportTemplateDescription"
        }
      }
    }
  },
  "Outputs": {
    "ReportGranularity": {
      "Description": "Report Aggregation Granularity.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ReportGranularity"
        ]
      }
    },
    "ReportTemplateId": {
      "Description": "Report template Id.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ReportTemplateId"
        ]
      }
    },
    "ReportScope": {
      "Description": "Report range, yes and logic between multiple sets of k-v pairs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ReportScope"
        ]
      }
    },
    "ReportFileFormats": {
      "Description": "Report Format. Currently only support `excel`.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ReportFileFormats"
        ]
      }
    },
    "SubscriptionFrequency": {
      "Description": "Report subscription frequency. If this field is not empty, it is a Cron expression in Quartz format triggered by the subscription notification.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SubscriptionFrequency"
        ]
      }
    },
    "ReportTemplateName": {
      "Description": "Report Template Name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ReportTemplateName"
        ]
      }
    },
    "ReportLanguage": {
      "Description": "Report Content Language, Currently only support `zh-CN` or `en-US`.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ReportLanguage"
        ]
      }
    },
    "ReportTemplateDescription": {
      "Description": "Report Template Description.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ReportTemplateDescription"
        ]
      }
    }
  }
}