ALIYUN::CEN::Flowlog类型用于创建流日志。
语法
{
"Type": "ALIYUN::CEN::Flowlog",
"Properties": {
"CenId": String,
"Description": String,
"FlowLogName": String,
"Interval": Integer,
"LogStoreName": String,
"LogFormatString": String,
"ProjectName": String,
"TransitRouterAttachmentId": String,
"Tags": List,
"TransitRouterId": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
CenId | String | 是 | 否 | 云企业网实例 ID。 | 无 |
Description | String | 否 | 是 | 流日志的描述信息。 | 描述可以为空或长度为 1~256 个字符,不能以 http://或 https://开头。 |
FlowLogName | String | 否 | 是 | 流日志名称。 | 名称可以为空或长度为 1~128 个字符,不能以 http://或 https://开头。 |
Interval | Integer | 否 | 是 | 流日志捕获流量的捕获窗口时长。 | 单位:秒。取值:60 或 600。默认值:600。 |
LogStoreName | String | 否 | 否 | 存储捕获流量的 Logstore。 |
|
LogFormatString | String | 否 | 否 | 自定义流日志记录字段的字符串。 | 格式定义为:
|
ProjectName | String | 否 | 否 | 存储捕获流量的 Project。 |
|
TransitRouterAttachmentId | String | 否 | 否 | VPC 连接、VPN 连接、VBR 连接、ECR 连接或跨地域连接 ID。 | 若需配置转发路由器实例的流日志,此字段不填值。 |
Tags | List | 否 | 是 | 标签。 | 更多信息,请参考Tags属性。 |
TransitRouterId | String | 否 | 否 | 转发路由器实例 ID。 | 无 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Key | String | 是 | 否 | 标签键。 | 无 |
Value | String | 否 | 否 | 标签值。 | 无 |
返回值
Fn::GetAtt
FlowLogVersion:流日志的版本。
TransitRouterAttachmentId:网络实例连接 ID。
Description:流日志的描述信息。
ProjectName:存储捕获流量的 Project 名称。
CreateTime:流日志的创建时间。
FlowLogId:流日志 ID。
FlowLogName:流日志的名称。
LogStoreName:存储捕获流量的 LogStore 名称。
LogFormatString:自定义流日志记录格式的字符串。
CenId:云企业网实例 ID。
Tags:标签。
TransitRouterId:转发路由器实例 ID。
Interval:流日志捕获流量的捕获窗口时长。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
TransitRouterAttachmentId:
Type: String
Description:
en: |-
The ID of the VPC connection, VPN connection, VBR connection, ECR connection, or inter-region connection.
If you create the flow log for a transfer router, skip this parameter.
Required: false
FlowLogName:
Type: String
Description:
en: |-
The flow log name.
The name can be empty or 1 to 128 characters in length, and cannot start with http:// or https://.
Required: false
MinLength: 1
MaxLength: 128
Description:
AssociationProperty: TextArea
Type: String
Description:
en: |-
The description of the flow log.
The description is optional. If you enter a description, it must be 1 to 256 characters in length, and cannot start with http:// or https://.
Required: false
MinLength: 1
MaxLength: 256
LogStoreName:
Type: String
Description:
en: |-
The Logstore that stores the captured traffic data.
* If a Logstore is already created in the selected region, enter the name of the Logstore.
* If no Logstores are created in the selected region, enter a name and the system automatically creates a Logstore. The name of the Logstore. The name must meet the following requirements:
** The name must be unique in a project.
** The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).
** The name must start and end with a lowercase letter or a digit.
** The name must be 3 to 63 characters in length.
Required: false
MinLength: 3
MaxLength: 63
ProjectName:
Type: String
Description:
en: |-
The project that stores the captured traffic data.
* If a project is already created in the selected region, enter the name of the project.
* If no projects are created in the selected region, enter a name and the system automatically creates a project.
The project name must be unique in a region. You cannot change the name after the project is created. The name must meet the following requirements:
** The name must be globally unique.
** The name can contain only lowercase letters, digits, and hyphens (-).
** The name must start and end with a lowercase letter or a digit.
** The name must be 3 to 63 characters in length.
Required: false
MinLength: 3
MaxLength: 63
LogFormatString:
Type: String
Description:
en: |-
The strings that define the fields in the flow log.
Format: ${Field 1}${Field 2}${Field 3}...{Field n}
* If you do not configure this parameter, all fields are included in the flow log.
* If you configure this parameter, start the string with ${srcaddr}${dstaddr}${bytes} because ${srcaddr}${dstaddr}${bytes} are required variables.
Required: false
CenId:
Type: String
Description:
en: The ID of the CEN instance.
Required: true
TransitRouterId:
Type: String
Description:
en: The ID of the transit router.
Required: false
Interval:
Type: Number
Description:
en: 'The time window for collecting log data. Unit: seconds. Valid values: 60 and 600. Default value: 600.'
Required: false
MinValue: 60
MaxValue: 600
Resources:
ExtensionResource:
Type: ALIYUN::CEN::Flowlog
Properties:
TransitRouterAttachmentId:
Ref: TransitRouterAttachmentId
FlowLogName:
Ref: FlowLogName
Description:
Ref: Description
LogStoreName:
Ref: LogStoreName
ProjectName:
Ref: ProjectName
LogFormatString:
Ref: LogFormatString
CenId:
Ref: CenId
TransitRouterId:
Ref: TransitRouterId
Interval:
Ref: Interval
Outputs:
FlowLogVersion:
Description: The flow log version.
Value:
Fn::GetAtt:
- ExtensionResource
- FlowLogVersion
TransitRouterAttachmentId:
Description: The ID of the VPC connection, VPN connection, VBR connection, ECR connection, or inter-region connection.
Value:
Fn::GetAtt:
- ExtensionResource
- TransitRouterAttachmentId
Description:
Description: The description of the flow log.
Value:
Fn::GetAtt:
- ExtensionResource
- Description
ProjectName:
Description: The project that stores the captured traffic data.
Value:
Fn::GetAtt:
- ExtensionResource
- ProjectName
CreateTime:
Description: The time when the flow log was created.
Value:
Fn::GetAtt:
- ExtensionResource
- CreateTime
FlowLogId:
Description: The ID of the flow log.
Value:
Fn::GetAtt:
- ExtensionResource
- FlowLogId
FlowLogName:
Description: The flow log name.
Value:
Fn::GetAtt:
- ExtensionResource
- FlowLogName
LogStoreName:
Description: The Logstore that stores the captured traffic data.
Value:
Fn::GetAtt:
- ExtensionResource
- LogStoreName
LogFormatString:
Description: The strings that define the fields in the flow log.
Value:
Fn::GetAtt:
- ExtensionResource
- LogFormatString
CenId:
Description: The ID of the CEN instance.
Value:
Fn::GetAtt:
- ExtensionResource
- CenId
Tags:
Description: The tag of the flow log.
Value:
Fn::GetAtt:
- ExtensionResource
- Tags
TransitRouterId:
Description: The ID of the transit router.
Value:
Fn::GetAtt:
- ExtensionResource
- TransitRouterId
Interval:
Description: The time window for collecting log data.
Value:
Fn::GetAtt:
- ExtensionResource
- Interval
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"TransitRouterAttachmentId": {
"Type": "String",
"Description": {
"en": "The ID of the VPC connection, VPN connection, VBR connection, ECR connection, or inter-region connection.\nIf you create the flow log for a transfer router, skip this parameter."
},
"Required": false
},
"FlowLogName": {
"Type": "String",
"Description": {
"en": "The flow log name.\nThe name can be empty or 1 to 128 characters in length, and cannot start with http:// or https://."
},
"Required": false,
"MinLength": 1,
"MaxLength": 128
},
"Description": {
"AssociationProperty": "TextArea",
"Type": "String",
"Description": {
"en": "The description of the flow log.\nThe description is optional. If you enter a description, it must be 1 to 256 characters in length, and cannot start with http:// or https://."
},
"Required": false,
"MinLength": 1,
"MaxLength": 256
},
"LogStoreName": {
"Type": "String",
"Description": {
"en": "The Logstore that stores the captured traffic data.\n* If a Logstore is already created in the selected region, enter the name of the Logstore.\n* If no Logstores are created in the selected region, enter a name and the system automatically creates a Logstore. The name of the Logstore. The name must meet the following requirements:\n ** The name must be unique in a project.\n ** The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).\n ** The name must start and end with a lowercase letter or a digit.\n ** The name must be 3 to 63 characters in length."
},
"Required": false,
"MinLength": 3,
"MaxLength": 63
},
"ProjectName": {
"Type": "String",
"Description": {
"en": "The project that stores the captured traffic data. \n* If a project is already created in the selected region, enter the name of the project.\n* If no projects are created in the selected region, enter a name and the system automatically creates a project.\n The project name must be unique in a region. You cannot change the name after the project is created. The name must meet the following requirements:\n ** The name must be globally unique.\n ** The name can contain only lowercase letters, digits, and hyphens (-).\n ** The name must start and end with a lowercase letter or a digit.\n ** The name must be 3 to 63 characters in length."
},
"Required": false,
"MinLength": 3,
"MaxLength": 63
},
"LogFormatString": {
"Type": "String",
"Description": {
"en": "The strings that define the fields in the flow log.\nFormat: ${Field 1}${Field 2}${Field 3}...{Field n}\n * If you do not configure this parameter, all fields are included in the flow log.\n * If you configure this parameter, start the string with ${srcaddr}${dstaddr}${bytes} because ${srcaddr}${dstaddr}${bytes} are required variables."
},
"Required": false
},
"CenId": {
"Type": "String",
"Description": {
"en": "The ID of the CEN instance."
},
"Required": true
},
"TransitRouterId": {
"Type": "String",
"Description": {
"en": "The ID of the transit router."
},
"Required": false
},
"Interval": {
"Type": "Number",
"Description": {
"en": "The time window for collecting log data. Unit: seconds. Valid values: 60 and 600. Default value: 600."
},
"Required": false,
"MinValue": 60,
"MaxValue": 600
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::CEN::Flowlog",
"Properties": {
"TransitRouterAttachmentId": {
"Ref": "TransitRouterAttachmentId"
},
"FlowLogName": {
"Ref": "FlowLogName"
},
"Description": {
"Ref": "Description"
},
"LogStoreName": {
"Ref": "LogStoreName"
},
"ProjectName": {
"Ref": "ProjectName"
},
"LogFormatString": {
"Ref": "LogFormatString"
},
"CenId": {
"Ref": "CenId"
},
"TransitRouterId": {
"Ref": "TransitRouterId"
},
"Interval": {
"Ref": "Interval"
}
}
}
},
"Outputs": {
"FlowLogVersion": {
"Description": "The flow log version.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"FlowLogVersion"
]
}
},
"TransitRouterAttachmentId": {
"Description": "The ID of the VPC connection, VPN connection, VBR connection, ECR connection, or inter-region connection.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"TransitRouterAttachmentId"
]
}
},
"Description": {
"Description": "The description of the flow log.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Description"
]
}
},
"ProjectName": {
"Description": "The project that stores the captured traffic data.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ProjectName"
]
}
},
"CreateTime": {
"Description": "The time when the flow log was created.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CreateTime"
]
}
},
"FlowLogId": {
"Description": "The ID of the flow log.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"FlowLogId"
]
}
},
"FlowLogName": {
"Description": "The flow log name.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"FlowLogName"
]
}
},
"LogStoreName": {
"Description": "The Logstore that stores the captured traffic data.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"LogStoreName"
]
}
},
"LogFormatString": {
"Description": "The strings that define the fields in the flow log.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"LogFormatString"
]
}
},
"CenId": {
"Description": "The ID of the CEN instance.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CenId"
]
}
},
"Tags": {
"Description": "The tag of the flow log.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Tags"
]
}
},
"TransitRouterId": {
"Description": "The ID of the transit router.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"TransitRouterId"
]
}
},
"Interval": {
"Description": "The time window for collecting log data.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Interval"
]
}
}
}
}