ALIYUN::ESA::SiteDeliveryTask

ALIYUN::ESA::SiteDeliveryTask类型用于新建实时日志投递任务。

语法

{
  "Type": "ALIYUN::ESA::SiteDeliveryTask",
  "Properties": {
    "BusinessType": String,
    "DataCenter": String,
    "DeliveryType": String,
    "FieldName": String,
    "SiteId": Integer,
    "TaskName": String,
    "DiscardRate": Integer,
    "HttpDelivery": Map,
    "KafkaDelivery": Map,
    "OssDelivery": Map,
    "SlsDelivery": Map,
    "S3Delivery": Map
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

BusinessType

String

业务类型。

取值:

  • dcdn_log_access_l1(默认值):访问日志。

  • dcdn_log_er:边缘函数日志。

  • dcdn_log_waf:安全防护日志。

  • dcdn_log_ipa:四层加速日志。

DataCenter

String

数据中心。

取值为:

  • cn:中国内地。

  • oversea:海外(非中国内地)。

DeliveryType

String

投递类型。

取值:

  • sls: 阿里云日志服务。

  • http: http 服务。

  • aws3: 亚马逊 s3 服务。

  • oss: 阿里云对象存储服务。

  • kafka: kafka 服务。

  • aws3cmpt: 亚马逊 s3 兼容服务。

FieldName

String

日志所选的字段。

以英文逗号“,”隔开。

SiteId

Integer

站点 ID。

TaskName

String

任务名称。

DiscardRate

Integer

丢弃率不填则默认为 0。

HttpDelivery

Map

HTTP 投递配置参数。

更多信息,请参考HttpDelivery属性

KafkaDelivery

Map

Kafka 投递配置参数。

更多信息,请参考KafkaDelivery属性

OssDelivery

Map

OSS 投递配置。

更多信息,请参考OssDelivery属性

SlsDelivery

Map

SLS 投递配置。

更多信息请参考SlsDelivery属性

S3Delivery

Map

S3/S3 兼容投递配置参数。

更多信息请参考S3Delivery属性

SlsDelivery语法

"SlsDelivery": {
  "SLSProject": String,
  "SLSRegion": String,
  "SLSLogStore": String
}

SlsDelivery属性

属性名称

类型

必须

允许更新

描述

约束

SLSProject

String

SLS 实时日志名称。

SLSRegion

String

SLS 实时日志区域名称。

SLSLogStore

String

SLS 实时日志库名称。

HttpDelivery语法

"HttpDelivery": {
  "Compress": String,
  "LogBodySuffix": String,
  "HeaderParam": Map,
  "StandardAuthParam": Map,
  "StandardAuthOn": Boolean,
  "LogBodyPrefix": String,
  "QueryParam": Map,
  "DestUrl": String,
  "MaxBatchSize": Integer,
  "TransformTimeout": Integer,
  "MaxRetry": Integer,
  "MaxBatchMB": Integer
}

HttpDelivery属性

属性名称

类型

必须

允许更新

描述

约束

DestUrl

String

HTTP 服务器投递地址。

Compress

String

压缩方式。

取值:

  • gzip

  • zlib

  • no

  • snappy

HeaderParam

Map

自定义 Header 头。

更多信息,请参考HeaderParam属性

LogBodySuffix

String

日志投递包尾缀。

LogBodyPrefix

String

日志投递包前缀。

MaxBatchSize

Integer

单次投递最大条数。

MaxRetry

Integer

最大重试次数。

MaxBatchMB

Integer

单次投递最大字节数。

单位为 MB。

QueryParam

Map

自定义请求参数。

更多信息,请参考QueryParam属性

StandardAuthParam

Map

标态鉴权参数。

更多信息,请参考StandardAuthParam属性

StandardAuthOn

Boolean

是否使用标态鉴权。

TransformTimeout

Integer

超时等待时间。

单位为秒。

HeaderParam语法

"HeaderParam": {
  "StaticValue": String
}

HeaderParam属性

属性名称

类型

必须

允许更新

描述

约束

StaticValue

String

自定义请求参数值。

StandardAuthParam语法

"StandardAuthParam": {
  "PrivateKey": String,
  "UrlPath": String,
  "ExpiredTime": Integer
}

StandardAuthParam属性

属性名称

类型

必须

允许更新

描述

约束

ExpiredTime

Integer

加密超时时间。

说明

大于 0 值,建议 300 以上

PrivateKey

String

私钥。

UrlPath

String

标态鉴权 uri 路径。

QueryParam语法

"QueryParam": {
  "StaticValue": String
}

QueryParam属性

属性名称

类型

必须

允许更新

描述

约束

StaticValue

String

自定义请求参数值。

S3Delivery语法

"S3Delivery": {
  "SecretKey": String,
  "Endpoint": String,
  "VertifyType": String,
  "Region": String,
  "ServerSideEncryption": Boolean,
  "BucketPath": String,
  "PrefixPath": String,
  "AccessKey": String,
  "S3Cmpt": Boolean
}

S3Delivery属性

属性名称

类型

必须

允许更新

描述

约束

AccessKey

String

阿里云账号或 RAM 用户的 AccessKey ID。

BucketPath

String

Bucket 路径。

Endpoint

String

服务器 Endpoint,

PrefixPath

String

存储路径前缀。

Region

String

服务所在区域。

SecretKey

String

S3 账号使用的 SecretKey ID。

ServerSideEncryption

Boolean

服务器端加密。

S3Cmpt

Boolean

是否为 S3 兼容。

VertifyType

String

认证类型。

KafkaDelivery语法

"KafkaDelivery": {
  "Compress": String,
  "UserName": String,
  "MachanismType": String,
  "Brokers": List,
  "Balancer": String,
  "Topic": String,
  "UserAuth": Boolean,
  "Password": String
}

KafkaDelivery属性

属性名称

类型

必须

允许更新

描述

约束

Brokers

List

服务器数组。

Balancer

String

负载均衡方式。

Compress

String

压缩方式。

MachanismType

String

加密方式。

Password

String

加密密码。

Topic

String

Kafka 消息主题。

UserName

String

用户名。

UserAuth

Boolean

是否开启用户鉴权。

OssDelivery语法

"OssDelivery": {
  "BucketName": String,
  "Region": String,
  "PrefixPath": String,
  "Aliuid": String
}

OssDelivery属性

属性名称

类型

必须

允许更新

描述

约束

Aliuid

String

阿里云账号 ID。

BucketName

String

Bucket 名称。

PrefixPath

String

存储路径前缀。

Region

String

服务所在区域。

返回值

Fn::GetAtt

  • SiteId:站点 ID。

  • DataCenter:数据中心。

  • DiscardRate:丢弃率不填则默认为 0。

  • SiteName:站点名称。

  • SinkConfig:投递配置。

  • TaskName:任务名称。

  • BusinessType:实时日志类型

  • FilterRules:过滤规则。

  • FieldName:日志所选的字段。

  • DeliveryType:投递类型

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SiteId:
    Type: Number
    Description:
      en: The site ID.
    Required: true
  DataCenter:
    Type: String
    Description:
      en: |-
        Data Center. Values:
        - `cn`: Mainland China.
        - `sg`: Global (excluding Mainland China).
    AllowedValues:
      - cn
      - sg
    Required: true
  TaskName:
    Type: String
    Description:
      en: The name of the delivery task.
    Required: true
  BusinessType:
    Type: String
    Description:
      en: |-
        Real-time log type. Valid values:
        - `dcdn_log_access_l1 (default)`: access log.
        - `dcdn_log_er`: Edge Routine logs.
        - `dcdn_log_waf`: firewall logs.
        - `dcdn_log_ipa`: TCP/UDP proxy logs.
    AllowedValues:
      - dcdn_log_access_l1
      - dcdn_log_er
      - dcdn_log_waf
      - dcdn_log_ipa
    Required: true
  FieldName:
    Type: String
    Description:
      en: The list of delivery fields to be modified, separated by commas.
    Required: true
  OssDelivery:
    AssociationPropertyMetadata:
      Parameters:
        BucketName:
          Type: String
          Description:
            en: The name of the OSS bucket.
          Required: false
        Region:
          Type: String
          Description:
            en: The region in which the bucket is located.
          Required: false
        PrefixPath:
          Type: String
          Description:
            en: The prefix of the path in which you want to store logs.
          Required: false
        Aliuid:
          Type: String
          Description:
            en: The account ID.
          Required: false
    Type: Json
    Description:
      en: OSS delivery configuration.
    Required: false
  DeliveryType:
    Type: String
    Description:
      en: |-
        Delivery Type:
        - `sls`: Alibaba Cloud Simple Log Service (SLS).
        - `http`: Http service.
        - `aws3`: Amazon s3 service.
        - `oss`: Alibaba Cloud Object Storage Service.
        - `kafka`: Kafka service.
        - `aws3cmpt`: Amazon s3 Compatible Service.
    AllowedValues:
      - sls
      - http
      - aws3
      - oss
      - kafka
      - aws3cmpt
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::ESA::SiteDeliveryTask
    Properties:
      SiteId:
        Ref: SiteId
      DataCenter:
        Ref: DataCenter
      TaskName:
        Ref: TaskName
      BusinessType:
        Ref: BusinessType
      FieldName:
        Ref: FieldName
      OssDelivery:
        Ref: OssDelivery
      DeliveryType:
        Ref: DeliveryType
Outputs:
  SiteId:
    Description: The site ID.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SiteId
  DataCenter:
    Description: Data Center.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - DataCenter
  DiscardRate:
    Description: If the discard rate is not filled, the default value is 0.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - DiscardRate
  SiteName:
    Description: The website name.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SiteName
  SinkConfig:
    Description: The delivery configuration.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SinkConfig
  TaskName:
    Description: The task name.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - TaskName
  BusinessType:
    Description: Real-time log type.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BusinessType
  FilterRules:
    Description: The filtering rules.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - FilterRules
  FieldName:
    Description: The list of delivery fields to be modified, separated by commas.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - FieldName
  DeliveryType:
    Description: Delivery Type:.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - DeliveryType
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SiteId": {
      "Type": "Number",
      "Description": {
        "en": "The site ID."
      },
      "Required": true
    },
    "DataCenter": {
      "Type": "String",
      "Description": {
        "en": "Data Center. Values:\n- `cn`: Mainland China.\n- `sg`: Global (excluding Mainland China)."
      },
      "AllowedValues": [
        "cn",
        "sg"
      ],
      "Required": true
    },
    "TaskName": {
      "Type": "String",
      "Description": {
        "en": "The name of the delivery task."
      },
      "Required": true
    },
    "BusinessType": {
      "Type": "String",
      "Description": {
        "en": "Real-time log type. Valid values:\n- `dcdn_log_access_l1 (default)`: access log.\n- `dcdn_log_er`: Edge Routine logs.\n- `dcdn_log_waf`: firewall logs.\n- `dcdn_log_ipa`: TCP/UDP proxy logs."
      },
      "AllowedValues": [
        "dcdn_log_access_l1",
        "dcdn_log_er",
        "dcdn_log_waf",
        "dcdn_log_ipa"
      ],
      "Required": true
    },
    "FieldName": {
      "Type": "String",
      "Description": {
        "en": "The list of delivery fields to be modified, separated by commas."
      },
      "Required": true
    },
    "OssDelivery": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "BucketName": {
            "Type": "String",
            "Description": {
              "en": "The name of the OSS bucket."
            },
            "Required": false
          },
          "Region": {
            "Type": "String",
            "Description": {
              "en": "The region in which the bucket is located."
            },
            "Required": false
          },
          "PrefixPath": {
            "Type": "String",
            "Description": {
              "en": "The prefix of the path in which you want to store logs."
            },
            "Required": false
          },
          "Aliuid": {
            "Type": "String",
            "Description": {
              "en": "The account ID."
            },
            "Required": false
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "OSS delivery configuration."
      },
      "Required": false
    },
    "DeliveryType": {
      "Type": "String",
      "Description": {
        "en": "Delivery Type:\n- `sls`: Alibaba Cloud Simple Log Service (SLS).\n- `http`: Http service.\n- `aws3`: Amazon s3 service.\n- `oss`: Alibaba Cloud Object Storage Service.\n- `kafka`: Kafka service.\n- `aws3cmpt`: Amazon s3 Compatible Service."
      },
      "AllowedValues": [
        "sls",
        "http",
        "aws3",
        "oss",
        "kafka",
        "aws3cmpt"
      ],
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ESA::SiteDeliveryTask",
      "Properties": {
        "SiteId": {
          "Ref": "SiteId"
        },
        "DataCenter": {
          "Ref": "DataCenter"
        },
        "TaskName": {
          "Ref": "TaskName"
        },
        "BusinessType": {
          "Ref": "BusinessType"
        },
        "FieldName": {
          "Ref": "FieldName"
        },
        "OssDelivery": {
          "Ref": "OssDelivery"
        },
        "DeliveryType": {
          "Ref": "DeliveryType"
        }
      }
    }
  },
  "Outputs": {
    "SiteId": {
      "Description": "The site ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SiteId"
        ]
      }
    },
    "DataCenter": {
      "Description": "Data Center.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DataCenter"
        ]
      }
    },
    "DiscardRate": {
      "Description": "If the discard rate is not filled, the default value is 0.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DiscardRate"
        ]
      }
    },
    "SiteName": {
      "Description": "The website name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SiteName"
        ]
      }
    },
    "SinkConfig": {
      "Description": "The delivery configuration.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SinkConfig"
        ]
      }
    },
    "TaskName": {
      "Description": "The task name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "TaskName"
        ]
      }
    },
    "BusinessType": {
      "Description": "Real-time log type.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BusinessType"
        ]
      }
    },
    "FilterRules": {
      "Description": "The filtering rules.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "FilterRules"
        ]
      }
    },
    "FieldName": {
      "Description": "The list of delivery fields to be modified, separated by commas.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "FieldName"
        ]
      }
    },
    "DeliveryType": {
      "Description": "Delivery Type:.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DeliveryType"
        ]
      }
    }
  }
}