ALIYUN::FC3::LayerVersion

更新时间:
复制为 MD 格式

ALIYUN::FC3::LayerVersion类型用于创建层版本。

语法

{
  "Type": "ALIYUN::FC3::LayerVersion",
  "Properties": {
    "LayerName": String,
    "Acl": String,
    "CompatibleRuntime": List,
    "Code": Map,
    "Description": String,
    "License": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

LayerName

String

层的名称。

Acl

String

层的访问权限,

取值:

  • 1:公有

  • 0:私有

默认为私有。

Code

Map

层代码配置。

更多信息,请参考Code属性

CompatibleRuntime

List

层支持的运行时环境列表。

长度范围:0-20。

Description

String

版本的描述。

License

String

层许可协议。

Code语法

"Code": {
  "ZipFile": String,
  "Checksum": String,
  "OssObjectName": String,
  "OssBucketName": String
}

Code属性

属性名称

类型

必须

允许更新

描述

约束

Checksum

String

代码包的CRC-64值。

如果提供了校验和,函数计算会检查代码包的校验和是否与提供的校验和一致。

OssBucketName

String

用户存储层代码ZIP包的OSS存储桶名称。

OssObjectName

String

用户存储层代码ZIP包的OSS对象名称。

ZipFile

String

层代码ZIP包的Base 64编码。

返回值

Fn::GetAtt

  • CompatibleRuntime:层支持的运行时环境列表。

  • Description:版本的描述。

  • CodeSize:层代码包的大小,单位为字节。

  • LayerVersionArn:层版本ARN。格式为acs:fc:{region}:{accountID}:layers/{layerName}/versions/{layerVersion}。

  • Version:层的版本。

  • LayerName:层的名称。

  • CreateTime:资源的创建时间。

  • License:层许可协议。

  • Acl:层的访问权限,1:公开,0:私有,默认为私有。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  CompatibleRuntime:
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Description:
          en: Runtime Environment.
        Required: false
    Type: Json
    AssociationProperty: List[Parameter]
    Description:
      en: List of runtime environments supported by the layer.
    Required: false
    MinLength: 0
    MaxLength: 20
  Description:
    Type: String
    AssociationProperty: TextArea
    Description:
      en: Description of the version.
    Required: false
  LayerName:
    Type: String
    Description:
      en: Name of the layer.
    Required: true
  License:
    Type: String
    Description:
      en: Layer License Agreement.
    Required: false
  Acl:
    Type: String
    Description:
      en: 'The access permission of the layer, 1: public, 0: private, default is private.'
    AllowedValues:
      - '1'
      - '0'
    Required: false
  Code:
    AssociationPropertyMetadata:
      Parameters:
        ZipFile:
          Type: String
          Description:
            en: Base 64 encoding of Layer Code ZIP package.
          Required: false
        Checksum:
          Type: String
          Description:
            en: The CRC-64 value of the code package. If checksum is provided, Function Compute checks whether the checksum of the code package is consistent with the provided checksum.
          Required: false
        OssObjectName:
          Type: String
          Description:
            en: Name of the OSS Object where the user stores the Layer Code ZIP package.
          Required: false
        OssBucketName:
          Type: String
          Description:
            en: Name of the OSS Bucket where the user stores the Layer Code ZIP package.
          Required: false
    Type: Json
    Description:
      en: Layer code configuration.
    Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::FC3::LayerVersion
    Properties:
      CompatibleRuntime:
        Ref: CompatibleRuntime
      Description:
        Ref: Description
      LayerName:
        Ref: LayerName
      License:
        Ref: License
      Acl:
        Ref: Acl
      Code:
        Ref: Code
Outputs:
  CompatibleRuntime:
    Description: List of runtime environments supported by the layer.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CompatibleRuntime
  Description:
    Description: Description of the version.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Description
  CodeSize:
    Description: The code package size of the layer, in bytes.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CodeSize
  LayerVersionArn:
    Description: Layer version ARN. The format is acs:fc:{region }:{ accountID}:layers/{layerName}/versions/{layerVersion}.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - LayerVersionArn
  Version:
    Description: The version of the layer.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Version
  LayerName:
    Description: Name of the layer.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - LayerName
  CreateTime:
    Description: The creation time of the resource.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  License:
    Description: Layer License Agreement.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - License
  Acl:
    Description: 'The access permission of the layer, 1: public, 0: private, default is private.'
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Acl
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "CompatibleRuntime": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Description": {
            "en": "Runtime Environment."
          },
          "Required": false
        }
      },
      "Type": "Json",
      "AssociationProperty": "List[Parameter]",
      "Description": {
        "en": "List of runtime environments supported by the layer."
      },
      "Required": false,
      "MinLength": 0,
      "MaxLength": 20
    },
    "Description": {
      "Type": "String",
      "AssociationProperty": "TextArea",
      "Description": {
        "en": "Description of the version."
      },
      "Required": false
    },
    "LayerName": {
      "Type": "String",
      "Description": {
        "en": "Name of the layer."
      },
      "Required": true
    },
    "License": {
      "Type": "String",
      "Description": {
        "en": "Layer License Agreement."
      },
      "Required": false
    },
    "Acl": {
      "Type": "String",
      "Description": {
        "en": "The access permission of the layer, 1: public, 0: private, default is private."
      },
      "AllowedValues": [
        "1",
        "0"
      ],
      "Required": false
    },
    "Code": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "ZipFile": {
            "Type": "String",
            "Description": {
              "en": "Base 64 encoding of Layer Code ZIP package."
            },
            "Required": false
          },
          "Checksum": {
            "Type": "String",
            "Description": {
              "en": "The CRC-64 value of the code package. If checksum is provided, Function Compute checks whether the checksum of the code package is consistent with the provided checksum."
            },
            "Required": false
          },
          "OssObjectName": {
            "Type": "String",
            "Description": {
              "en": "Name of the OSS Object where the user stores the Layer Code ZIP package."
            },
            "Required": false
          },
          "OssBucketName": {
            "Type": "String",
            "Description": {
              "en": "Name of the OSS Bucket where the user stores the Layer Code ZIP package."
            },
            "Required": false
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "Layer code configuration."
      },
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::FC3::LayerVersion",
      "Properties": {
        "CompatibleRuntime": {
          "Ref": "CompatibleRuntime"
        },
        "Description": {
          "Ref": "Description"
        },
        "LayerName": {
          "Ref": "LayerName"
        },
        "License": {
          "Ref": "License"
        },
        "Acl": {
          "Ref": "Acl"
        },
        "Code": {
          "Ref": "Code"
        }
      }
    }
  },
  "Outputs": {
    "CompatibleRuntime": {
      "Description": "List of runtime environments supported by the layer.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CompatibleRuntime"
        ]
      }
    },
    "Description": {
      "Description": "Description of the version.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Description"
        ]
      }
    },
    "CodeSize": {
      "Description": "The code package size of the layer, in bytes.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CodeSize"
        ]
      }
    },
    "LayerVersionArn": {
      "Description": "Layer version ARN. The format is acs:fc:{region }:{ accountID}:layers/{layerName}/versions/{layerVersion}.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "LayerVersionArn"
        ]
      }
    },
    "Version": {
      "Description": "The version of the layer.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Version"
        ]
      }
    },
    "LayerName": {
      "Description": "Name of the layer.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "LayerName"
        ]
      }
    },
    "CreateTime": {
      "Description": "The creation time of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "License": {
      "Description": "Layer License Agreement.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "License"
        ]
      }
    },
    "Acl": {
      "Description": "The access permission of the layer, 1: public, 0: private, default is private.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Acl"
        ]
      }
    }
  }
}