ALIYUN::SLS::OssExternalStore

ALIYUN::SLS::OssExternalStore类型用于创建OSS外部存储。

语法

{
  "Type": "ALIYUN::SLS::OssExternalStore",
  "Properties": {
    "AccessId": String,
    "AccessKey": String,
    "Bucket": String,
    "Columns": List,
    "Endpoint": String,
    "ExternalStoreName": String,
    "Objects": List,
    "Project": String,
    "StoreType": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

AccessId

String

AccessKey ID。

AccessKey

String

AccessKey Secret。

Bucket

String

OSS Bucket 名称。

Columns

List

关联的字段列表。

Endpoint

String

OSS 的 Endpoint 访问网址。

ExternalStoreName

String

外部存储的名称。

Objects

List

关联的 OSS 文件名称。

最多支持关联100个OSS文件。

Project

String

Project 名称。

StoreType

String

外部存储的类型。

取值:

  • oss

Columns语法

"Columns": [
  {
    "Type": String,
    "Name": String
  }
]

Columns属性

属性名称

类型

必须

允许更新

描述

约束

Name

String

字段名称。

Type

String

字段类型。

取值:

  • varchar

  • bigint

  • double

返回值

Fn::GetAtt

  • Project:Project 名称。

  • ExternalStoreName:外部存储的名称。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  StoreType:
    Type: String
    Description:
      en: The type of the external store. Set the value to oss.
    AllowedValues:
      - oss
    Required: true
  Project:
    Type: String
    Description:
      en: A short description of struct
    Required: true
  Endpoint:
    Type: String
    Description:
      en: The OSS endpoint.
    Required: true
  Bucket:
    Type: String
    Description:
      en: The name of the OSS bucket.
    Required: true
  AccessId:
    Type: String
    Description:
      en: The AccessKey ID.
    Required: true
  Objects:
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Required: false
    AssociationProperty: List[Parameter]
    Type: Json
    Description:
      en: 'The associated OSS objects. Valid values of n: 1 to 100.'
    Required: true
    MinLength: 1
    MaxLength: 100
  Columns:
    AssociationPropertyMetadata:
      Parameters:
        Type:
          Type: String
          Description:
            en: The data type of the field.
          AllowedValues:
            - varchar
            - bigint
            - double
          Required: true
        Name:
          Type: String
          Description:
            en: The name of the field.
          Required: true
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: The associated fields.
    Required: true
  AccessKey:
    Type: String
    Description:
      en: The AccessKey secret.
    Required: true
  ExternalStoreName:
    Type: String
    Description:
      en: The name of the external store.
    Required: true
Resources:
  OssExternalStore:
    Type: ALIYUN::SLS::OssExternalStore
    Properties:
      StoreType:
        Ref: StoreType
      Project:
        Ref: Project
      Endpoint:
        Ref: Endpoint
      Bucket:
        Ref: Bucket
      AccessId:
        Ref: AccessId
      Objects:
        Ref: Objects
      Columns:
        Ref: Columns
      AccessKey:
        Ref: AccessKey
      ExternalStoreName:
        Ref: ExternalStoreName
Outputs:
  Project:
    Description: The name of the project to which the external store belongs.
    Value:
      Fn::GetAtt:
        - OssExternalStore
        - Project
  ExternalStoreName:
    Description: The name of the external store.
    Value:
      Fn::GetAtt:
        - OssExternalStore
        - ExternalStoreName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "StoreType": {
      "Type": "String",
      "Description": {
        "en": "The type of the external store. Set the value to oss."
      },
      "AllowedValues": [
        "oss"
      ],
      "Required": true
    },
    "Project": {
      "Type": "String",
      "Description": {
        "en": "A short description of struct"
      },
      "Required": true
    },
    "Endpoint": {
      "Type": "String",
      "Description": {
        "en": "The OSS endpoint."
      },
      "Required": true
    },
    "Bucket": {
      "Type": "String",
      "Description": {
        "en": "The name of the OSS bucket."
      },
      "Required": true
    },
    "AccessId": {
      "Type": "String",
      "Description": {
        "en": "The AccessKey ID."
      },
      "Required": true
    },
    "Objects": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Required": false
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "The associated OSS objects. Valid values of n: 1 to 100."
      },
      "Required": true,
      "MinLength": 1,
      "MaxLength": 100
    },
    "Columns": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Type": {
            "Type": "String",
            "Description": {
              "en": "The data type of the field."
            },
            "AllowedValues": [
              "varchar",
              "bigint",
              "double"
            ],
            "Required": true
          },
          "Name": {
            "Type": "String",
            "Description": {
              "en": "The name of the field."
            },
            "Required": true
          }
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "The associated fields."
      },
      "Required": true
    },
    "AccessKey": {
      "Type": "String",
      "Description": {
        "en": "The AccessKey secret."
      },
      "Required": true
    },
    "ExternalStoreName": {
      "Type": "String",
      "Description": {
        "en": "The name of the external store."
      },
      "Required": true
    }
  },
  "Resources": {
    "OssExternalStore": {
      "Type": "ALIYUN::SLS::OssExternalStore",
      "Properties": {
        "StoreType": {
          "Ref": "StoreType"
        },
        "Project": {
          "Ref": "Project"
        },
        "Endpoint": {
          "Ref": "Endpoint"
        },
        "Bucket": {
          "Ref": "Bucket"
        },
        "AccessId": {
          "Ref": "AccessId"
        },
        "Objects": {
          "Ref": "Objects"
        },
        "Columns": {
          "Ref": "Columns"
        },
        "AccessKey": {
          "Ref": "AccessKey"
        },
        "ExternalStoreName": {
          "Ref": "ExternalStoreName"
        }
      }
    }
  },
  "Outputs": {
    "Project": {
      "Description": "The name of the project to which the external store belongs.",
      "Value": {
        "Fn::GetAtt": [
          "OssExternalStore",
          "Project"
        ]
      }
    },
    "ExternalStoreName": {
      "Description": "The name of the external store.",
      "Value": {
        "Fn::GetAtt": [
          "OssExternalStore",
          "ExternalStoreName"
        ]
      }
    }
  }
}