All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ApiGateway::Authorization

Last Updated:Jul 18, 2024

ALIYUN::ApiGateway::Authorization is used to authorize applications to call APIs.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

ApiIds

List

Yes

Yes

The IDs of the APIs.

You can specify up to 100 IDs.

AppIds

List

Yes

Yes

The IDs of the applications.

Each ID is a globally unique identifier (GUID) that is generated by the system. You can specify multiple IDs.

GroupId

String

Yes

Yes

The ID of the API group.

Each ID is a GUID that is generated by the system.

StageName

String

Yes

Yes

The environment name.

Valid values:

  • TEST

  • PRE

  • RELEASE

AuthValidTime

String

No

Yes

The time when the authorization expires.

The time must be in UTC.

If you leave this property empty, the authorization does not expire.

Description

String

No

Yes

The description of the authorization.

None.

Return values

Fn::GetAtt

None.

Examples

Note

Change the values of masked parameters, such as GroupId, AppId, and ApiId, based on your business requirements.

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  GroupId:
    Type: String
    Default: 10b1b4dc7a2e6ba8ca3****
    Description: the ID of the API group.
  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 format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "GroupId": {
      "Type": "String",
      "Default": "10b1b4dc7a2e6ba8ca3****",
      "Description": "the ID of the API group"
    },
    "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"
          }
        ]
      }
    }
  }
}