Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::FC3::LayerVersion

Última atualização: Jun 27, 2026

O tipo de recurso ALIYUN::FC3::LayerVersion cria uma versão de layer.

Sintaxe

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

Propriedades

Parâmetro

Tipo

Obrigatório

Atualização permitida

Descrição

Restrições

LayerName

String

Sim

Não

Nome do layer.

Nenhuma

Acl

String

Não

Sim

Permissão de acesso do layer.

Valores válidos:

  • 1: público

  • 0: privado

Valor padrão: privado.

Code

Map

Não

Não

Configuração de código do layer.

Para mais informações, consulte Propriedades de Code.

CompatibleRuntime

List

Não

Não

Lista de ambientes de execução compatíveis.

Comprimento: 0 a 20.

Description

String

Não

Não

Descrição da versão do layer.

Nenhuma

License

String

Não

Não

Licença do layer.

Nenhuma

Sintaxe de Code

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

Propriedades de Code

Parâmetro

Tipo

Obrigatório

Atualize permitida

Descrição

Restrições

Checksum

String

Não

Não

Valor CRC-64 do pacote de código.

Se fornecido, o Function Compute verifica se o checksum do pacote de código corresponde a este valor.

OssBucketName

String

Não

Não

Bucket do OSS que contém o pacote de código do layer.

Nenhuma

OssObjectName

String

Não

Não

Objeto do OSS que contém o pacote de código do layer.

Nenhuma

ZipFile

String

Não

Não

Pacote de código do layer codificado em Base64.

Nenhuma

Valores de retorno

Fn::GetAtt

  • CompatibleRuntime: Lista de ambientes de execução compatíveis.

  • Description: Descrição da versão do layer.

  • CodeSize: Tamanho do pacote de código do layer, em bytes.

  • LayerVersionArn: ARN da versão do layer. Formato: acs:fc:{region}:{accountID}:layers/{layerName}/versions/{layerVersion}.

  • Version: Versão do layer.

  • LayerName: Nome do layer.

  • CreateTime: Hora de criação do recurso.

  • License: Licença do layer.

  • Acl: Permissão de acesso do layer. 1: público, 0: privado. Valor padrão: privado.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  CompatibleRuntime:
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Description:
          en: A compatible runtime environment.
        Required: false
    Type: Json
    AssociationProperty: List[Parameter]
    Description:
      en: The list of runtime environments that the layer supports.
    Required: false
    MinLength: 0
    MaxLength: 20
  Description:
    Type: String
    AssociationProperty: TextArea
    Description:
      en: The description of the version.
    Required: false
  LayerName:
    Type: String
    Description:
      en: The name of the layer.
    Required: true
  License:
    Type: String
    Description:
      en: The license for the layer.
    Required: false
  Acl:
    Type: String
    Description:
      en: 'The access permission of the layer. Valid values: 1 (public) and 0 (private). Default value: private.'
    AllowedValues:
      - '1'
      - '0'
    Required: false
  Code:
    AssociationPropertyMetadata:
      Parameters:
        ZipFile:
          Type: String
          Description:
            en: The Base64-encoded layer code package.
          Required: false
        Checksum:
          Type: String
          Description:
            en: The CRC-64 value of the code package. If a checksum is provided, Function Compute verifies that the checksum of the code package matches the provided checksum.
          Required: false
        OssObjectName:
          Type: String
          Description:
            en: The name of the OSS object that contains the layer's code package.
          Required: false
        OssBucketName:
          Type: String
          Description:
            en: The name of the OSS bucket that contains the layer's code package.
          Required: false
    Type: Json
    Description:
      en: The code configuration for the layer.
    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: The list of runtime environments that the layer supports.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CompatibleRuntime
  Description:
    Description: The description of the version.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Description
  CodeSize:
    Description: The size of the layer's code package, in bytes.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CodeSize
  LayerVersionArn:
    Description: The ARN of the layer version. 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: The name of the layer.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - LayerName
  CreateTime:
    Description: The creation time of the resource.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  License:
    Description: The license for the layer.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - License
  Acl:
    Description: 'The access permission of the layer. 1: public, 0: private. Default value: private.'
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Acl
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "CompatibleRuntime": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Description": {
            "en": "A compatible runtime environment."
          },
          "Required": false
        }
      },
      "Type": "Json",
      "AssociationProperty": "List[Parameter]",
      "Description": {
        "en": "The list of runtime environments that the layer supports."
      },
      "Required": false,
      "MinLength": 0,
      "MaxLength": 20
    },
    "Description": {
      "Type": "String",
      "AssociationProperty": "TextArea",
      "Description": {
        "en": "The description of the version."
      },
      "Required": false
    },
    "LayerName": {
      "Type": "String",
      "Description": {
        "en": "The name of the layer."
      },
      "Required": true
    },
    "License": {
      "Type": "String",
      "Description": {
        "en": "The license for the layer."
      },
      "Required": false
    },
    "Acl": {
      "Type": "String",
      "Description": {
        "en": "The access permission of the layer. Valid values: 1 (public) and 0 (private). Default value: private."
      },
      "AllowedValues": [
        "1",
        "0"
      ],
      "Required": false
    },
    "Code": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "ZipFile": {
            "Type": "String",
            "Description": {
              "en": "The Base64-encoded layer code package."
            },
            "Required": false
          },
          "Checksum": {
            "Type": "String",
            "Description": {
              "en": "The CRC-64 value of the code package. If a checksum is provided, Function Compute verifies that the checksum of the code package matches the provided checksum."
            },
            "Required": false
          },
          "OssObjectName": {
            "Type": "String",
            "Description": {
              "en": "The name of the OSS object that contains the layer's code package."
            },
            "Required": false
          },
          "OssBucketName": {
            "Type": "String",
            "Description": {
              "en": "The name of the OSS bucket that contains the layer's code package."
            },
            "Required": false
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "The code configuration for the layer."
      },
      "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": "The list of runtime environments that the layer supports.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CompatibleRuntime"
        ]
      }
    },
    "Description": {
      "Description": "The description of the version.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Description"
        ]
      }
    },
    "CodeSize": {
      "Description": "The size of the layer's code package, in bytes.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CodeSize"
        ]
      }
    },
    "LayerVersionArn": {
      "Description": "The ARN of the layer version. 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": "The name of the layer.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "LayerName"
        ]
      }
    },
    "CreateTime": {
      "Description": "The creation time of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "License": {
      "Description": "The license for the layer.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "License"
        ]
      }
    },
    "Acl": {
      "Description": "The access permission of the layer. 1: public, 0: private. Default value: private.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Acl"
        ]
      }
    }
  }
}