全部产品
Search
文档中心

资源编排:ALIYUN::ApiGateway::Authorization

更新时间:Jun 14, 2024

ALIYUN::ApiGateway::Authorization类型用于给API授权App的访问权限。

语法

  {
  "Type": "ALIYUN::ApiGateway::Authorization",
  "Properties": {
    "ApiIds": List,
    "AppIds": List,
    "GroupId": String,
    "StageName": String,
    "Description": String,
    "AuthValidTime": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ApiIds

List

指定操作的API编号。

支持输入多个,最多支持 100 个。

AppIds

List

应用编号列表。

由系统生成,全局唯一。支持输入多个。

GroupId

String

API分组ID。

由系统生成,全局唯一。

StageName

String

环境名称。

取值:

  • TEST

  • PRE

  • RELEASE

AuthValidTime

String

授权有效时间的截止时间。

请设置格林尼治标准时间

(GMT),如果为空,即为授权永久有效。

Description

String

授权说明 。

返回值

Fn::GetAtt

无。

示例

说明

请您根据实际情况更改脱敏的参数取值。例如GroupId、AppId、ApiId。

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  GroupId:
    Type: String
    Default: 10b1b4dc7a2e6ba8ca3****
    Description: 操作的分组
  AppId:
    Type: Number
    Default: 577****
    Description: APP ID
  ApiId:
    Type: String
    Default: 2a8b6d4ce2ad1f95cb****
    Description: API ID
Resources:
  Authorization:
    Type: ALIYUN::ApiGateway::Authorization
    Properties:
      GroupId:
        Ref: GroupId
      StageName: TEST
      AppIds:
        - Ref: AppId
      ApiIds:
        - Ref: ApiId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "GroupId": {
      "Type": "String",
      "Default": "10b1b4dc7a2e6ba8ca3****",
      "Description": "操作的分组"
    },
    "AppId": {
      "Type": "Number",
      "Default": "577****",
      "Description": "APP ID"
    },
    "ApiId": {
      "Type": "String",
      "Default": "2a8b6d4ce2ad1f95cb****",
      "Description": "API ID"
    }
  },
  "Resources": {
    "Authorization": {
      "Type": "ALIYUN::ApiGateway::Authorization",
      "Properties": {
        "GroupId": {
          "Ref": "GroupId"
        },
        "StageName": "TEST",
        "AppIds": [
          {
            "Ref": "AppId"
          }
        ],
        "ApiIds": [
          {
            "Ref": "ApiId"
          }
        ]
      }
    }
  }
}