ALIYUN::ApiGateway::App类型用于创建App。App是您调用第三方API时的身份,要调用第三方API必须创建App。
语法
{
  "Type": "ALIYUN::ApiGateway::App",
  "Properties": {
    "Description": String,
    "Tags": List,
    "AppName": String,
    "AppSecret": String,
    "AppCode": String,
    "AppKey": String
  }
}   属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| AppName | String | 是 | 是 | App的名称。 | 全局唯一。建议命名时加上特定标识,避免重名。 长度为4~15个字符,必须以英文字符或中文字符开头,可包含英文字符、中文字符、数字和下划线(_)。 | 
| AppCode | String | 否 | 否 | 应用的AppCode。 | 无 | 
| AppKey | String | 否 | 否 | App的密钥。 | 用于调用API时使用。 | 
| AppSecret | String | 否 | 否 | App密码。 | 无 | 
| Description | String | 否 | 是 | App描述信息。 | 长度不超过180个字符。 | 
| Tags | List | 否 | 是 | 标签。 | 最多设置20个标签。 | 
Tags语法
"Tags": [
  {
    "Value": String,
    "Key": String
  }
]  Tags属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Key | String | 是 | 否 | 标签键。 | 长度为1~128个字符,不能以 | 
| Value | String | 否 | 否 | 标签值。 | 长度为0~128个字符,不能以 | 
返回值
Fn::GetAtt
- AppKey:App的密钥。 
- AppSecret:App的密码。 
- AppId:App的ID。 
- Tags:标签。 
- AppCode:应用的AppCode。 
示例
YAML格式 
ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  APP:
    Type: ALIYUN::ApiGateway::App
    Properties:
      Description: Test Create App
      AppName: DemoApp
Outputs:
  AppId:
    Description: The id of the created APP
    Value:
      Fn::GetAtt:
        - APP
        - AppId
  AppKey:
    Description: The key of the APP
    Value:
      Fn::GetAtt:
        - APP
        - AppKey
  AppSecret:
    Description: The secret of the APP
    Value:
      Fn::GetAtt:
        - APP
        - AppSecretJSON格式 
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
  },
  "Resources": {
    "APP": {
      "Type": "ALIYUN::ApiGateway::App",
      "Properties": {
        "Description": "Test Create App",
        "AppName": "DemoApp"
      }
    }
  },
  "Outputs": {
    "AppId": {
      "Description": "The id of the created APP",
      "Value": {
        "Fn::GetAtt": [
          "APP",
          "AppId"
        ]
      }
    },
    "AppKey": {
      "Description": "The key of the APP",
      "Value": {
        "Fn::GetAtt": [
          "APP",
          "AppKey"
        ]
      }
    },
    "AppSecret": {
      "Description": "The secret of the APP",
      "Value": {
        "Fn::GetAtt": [
          "APP",
          "AppSecret"
        ]
      }
    }
  }
}该文章对您有帮助吗?