文档

ALIYUN::ServerlessDev::Project

更新时间:

ALIYUN::ServerlessDev::Project类型用于创建项目,并在指定模板配置时自动部署此项目。

语法

{
  "Type": "ALIYUN::ServerlessDev::Project",
  "Properties": {
    "Name": String,
    "Description": String,
    "Labels": Map,
    "Spec": Map
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Name

String

项目名称。

它需要是唯一的,且无法变更。

Description

String

描述信息。

Labels

Map

资源的标签。

Spec

Map

项目配置

更多信息,请参见Spec属性。

Spec语法

"Spec": {
  "TemplateConfig": Map,
  "RoleArn": String
}

Spec属性

属性名称

类型

必须

允许更新

描述

约束

RoleArn

String

开发平台部署您的项目时所需扮演的角色的 Arn。

默认为 acs:ram::${your_main_account_ID}:role/aliyundevsdefaultrole。

TemplateConfig

Map

项目的模板配置。

非空时会自动创建默认环境,并完成自动部署。详情参考TemplateConfig属性。

TemplateConfig语法

"TemplateConfig": {
  "Parameters": Map,
  "TemplateName": String
}

TemplateConfig属性

属性名称

类型

必须

允许更新

描述

约束

TemplateName

String

模板名称。

Parameters

Map

模板参数。

返回值

Fn::GetAtt

Name:项目名称

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      Project:
        Type: ALIYUN::ServerlessDev::Project
        Properties:
          Name: test
    Outputs:
      Name:
        Description: The name of the project.
        Value:
          Fn::GetAtt:
            - Project
            - Name
    
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "Project": {
          "Type": "ALIYUN::ServerlessDev::Project",
          "Properties": {
            "Name": "test"
          }
        }
      },
      "Outputs": {
        "Name": {
          "Description": "The name of the project.",
          "Value": {
            "Fn::GetAtt": [
              "Project",
              "Name"
            ]
          }
        }
      }
    }