ALIYUN::FC::Layer は、レイヤーバージョンのリリースに使用されます。
レイヤーとレイヤーバージョンの詳細については、関数のカスタムレイヤーを設定するをご参照ください。
構文
{
"Type": "ALIYUN::FC::Layer",
"Properties": {
"CompatibleRuntime": List,
"Description": String,
"LayerName": String,
"Code": Map
}
}プロパティ
プロパティ | タイプ | 必須 | 編集可能 | 説明 | 制約 |
CompatibleRuntime | List | はい | いいえ | レイヤーでサポートされているランタイム。 | 有効な値:
|
Description | String | いいえ | いいえ | レイヤーの説明。 | なし。 |
LayerName | String | はい | いいえ | レイヤーの名前。 | 名前は 1 ~ 64 文字の長さでなければなりません。 |
Code | Map | はい | いいえ | 関数コードの ZIP パッケージ。 |
コードの構文
"Code": {
"ZipFile": String,
"OssObjectName": String,
"OssBucketName": String
}コードのプロパティ
プロパティ | タイプ | 必須 | 編集可能 | 説明 | 制約 |
ZipFile | String | いいえ | いいえ | ZIP パッケージの Base64 エンコードされたコンテンツ。 | ZipFile は、OssBucketName および OssObjectName よりも優先順位が高くなります。 Code には ZipFile の値が優先されます。 |
OssObjectName | String | いいえ | いいえ | オブジェクトストレージサービス (OSS) オブジェクトとして使用される ZIP パッケージの名前。 | OssBucketName と OssObjectName の両方を指定する必要があります。 |
OssBucketName | String | いいえ | いいえ | ZIP パッケージが格納されている OSS バケットの名前。 | OssBucketName と OssObjectName の両方を指定する必要があります。 |
戻り値
Fn::GetAtt
LayerName: レイヤーの名前。
Version: レイヤーのバージョン。
Arn: レイヤーの Alibaba Cloud Resource Name (ARN)。
例
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"CompatibleRuntime": {
"Type": "Json",
"Description": "レイヤーでサポートされているランタイム環境。例: nodejs12、nodejs10、nodejs8、nodejs6、python3", // The runtime environment supported by the layer. For example:nodejs12, nodejs10, nodejs8, nodejs6, python3
"MinLength": 1,
"Default": "[\n \"python3\"\n]"
},
"Description": {
"Type": "String",
"Description": "レイヤーの説明。", // The description of the layer.
"Default": "test123"
},
"LayerName": {
"Type": "String",
"Description": "レイヤーの名前", // The name of layer
"AllowedPattern": "[a-zA-Z][_a-zA-Z0-9-]+",
"MinLength": 1,
"MaxLength": 64,
"Default": "test123"
},
"Code": {
"Type": "Json",
"Description": "レイヤーのコード。", // The code of layer.
"Default": "{\n \"OssBucketName\": \"you_bucket_name\",\n \"OssObjectName\": \"index.py\"\n}"
}
},
"Resources": {
"Layer": {
"Type": "ALIYUN::FC::Layer",
"Properties": {
"CompatibleRuntime": {
"Ref": "CompatibleRuntime"
},
"Description": {
"Ref": "Description"
},
"LayerName": {
"Ref": "LayerName"
},
"Code": {
"Ref": "Code"
}
}
}
},
"Outputs": {
"LayerName": {
"Description": "レイヤーの名前", // The name of layer
"Value": {
"Fn::GetAtt": [
"Layer",
"LayerName"
]
}
},
"Version": {
"Description": "レイヤーリソースのバージョン。", // The version of the layer resource.
"Value": {
"Fn::GetAtt": [
"Layer",
"Version"
]
}
},
"Arn": {
"Description": "レイヤーリソースの名前。", // The name of the layer resource.
"Value": {
"Fn::GetAtt": [
"Layer",
"Arn"
]
}
}
}
}