ALIYUN::ApiGateway::App is used to create an application. Before you call a third-party API, you must create an application and use the application as an identity to call the API.

Syntax

{
  "Type": "ALIYUN::ApiGateway::App",
  "Properties": {
    "Description": String,
    "Tags": List,
    "AppName": String
  }
}   

Properties

Property Type Required Editable Description Constraint
AppName String Yes Yes The name of the application. The name must be globally unique. We recommend that you add a special identifier to ensure that the name is unique.

The name must be 4 to 15 characters in length and can contain letters, digits, and underscores (_). The name must start with a letter.

Tags List No Yes The tags. You can specify up to 20 tags.
Description String No Yes The description of the application. The description can be up to 180 characters in length.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]  

Tags properties

Property Type Required Editable Description Constraint
Key String Yes No The key of the tag. None
Value String No No The value of the tag. None

Response parameters

Fn::GetAtt

  • AppKey: the key of the application.
  • AppSecret: the secret of the application.
  • AppId: the ID of the application.
  • Tags: the tags of the application.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Description": {
      "Type": "String",
      "Description": "Description of the App, less than 180 characters."
    },
    "Tags": {
      "Type": "Json",
      "Description": "Tags to attach to app. Max support 20 tags to add during create app. Each tag with two properties Key and Value, and Key is required.",
      "MaxLength": 20
    },
    "AppName": {
      "Type": "String",
      "Description": "The name of the App.Need [4, 15] Chinese\\English\\Number characters or \"_\",and should start with Chinese/English character."
    }
  },
  "Resources": {
    "APP": {
      "Type": "ALIYUN::ApiGateway::App",
      "Properties": {
        "Description": {
          "Ref": "Description"
        },
        "Tags": {
          "Ref": "Tags"
        },
        "AppName": {
          "Ref": "AppName"
        }
      }
    }
  },
  "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"
        ]
      }
    },
    "Tags": {
      "Description": "Tags of app",
      "Value": {
        "Fn::GetAtt": [
          "APP",
          "Tags"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Description:
    Type: String
    Description: 'Description of the App, less than 180 characters.'
  Tags:
    Type: Json
    Description: >-
      Tags to attach to app. Max support 20 tags to add during create app. Each
      tag with two properties Key and Value, and Key is required.
    MaxLength: 20
  AppName:
    Type: String
    Description: >-
      The name of the App.Need [4, 15] Chinese\English\Number characters or
      "_",and should start with Chinese/English character.
Resources:
  APP:
    Type: 'ALIYUN::ApiGateway::App'
    Properties:
      Description:
        Ref: Description
      Tags:
        Ref: Tags
      AppName:
        Ref: AppName
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
  Tags:
    Description: Tags of app
    Value:
      'Fn::GetAtt':
        - APP
        - Tags