全部產品
Search
文件中心

:ALIYUN::ApiGateway::PluginAttachment

更新時間:Jun 15, 2024

ALIYUN::ApiGateway::PluginAttachment類型用於將外掛程式綁定到API。

文法

{
  "Type": "ALIYUN::ApiGateway::PluginAttachment",
  "Properties": {
    "StageName": String,
    "PluginId": String,
    "ApiId": String
  }
}

屬性

屬性名稱

類型

必須

允許更新

描述

約束

ApiId

String

API編號。

PluginId

String

外掛程式ID。

StageName

String

操作API的環境。

取值:

  • RELEASE:發布環境。

  • PRE:預發布環境。

  • TEST:測試環境。

傳回值

Fn::GetAtt

  • PluginId:外掛程式ID。

  • ApiId:API編號。

樣本

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ApiId:
    Description: The ID of the API to which you want to bind the plug-in.
    Type: String
  PluginId:
    Description: The ID of the plugin that you want to bind.
    Type: String
  StageName:
    AllowedValues:
    - RELEASE
    - PRE
    - TEST
    Description: "The name of the runtime environment. Valid values: \nRELEASE: indicates\
      \ the release environment.\nPRE: indicates the pre-release environment.\nTEST:\
      \ indicates the test environment."
    Type: String
Resources:
  PluginAttachment:
    Properties:
      ApiId:
        Ref: ApiId
      PluginId:
        Ref: PluginId
      StageName:
        Ref: StageName
    Type: ALIYUN::ApiGateway::PluginAttachment
Outputs:
  ApiId:
    Description: The api id.
    Value:
      Fn::GetAtt:
      - PluginAttachment
      - ApiId
  PluginId:
    Description: The plugin id.
    Value:
      Fn::GetAtt:
      - PluginAttachment
      - PluginId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "StageName": {
      "Type": "String",
      "Description": "The name of the runtime environment. Valid values: \nRELEASE: indicates the release environment.\nPRE: indicates the pre-release environment.\nTEST: indicates the test environment.",
      "AllowedValues": [
        "RELEASE",
        "PRE",
        "TEST"
      ]
    },
    "PluginId": {
      "Type": "String",
      "Description": "The ID of the plugin that you want to bind."
    },
    "ApiId": {
      "Type": "String",
      "Description": "The ID of the API to which you want to bind the plug-in."
    }
  },
  "Resources": {
    "PluginAttachment": {
      "Type": "ALIYUN::ApiGateway::PluginAttachment",
      "Properties": {
        "StageName": {
          "Ref": "StageName"
        },
        "PluginId": {
          "Ref": "PluginId"
        },
        "ApiId": {
          "Ref": "ApiId"
        }
      }
    }
  },
  "Outputs": {
    "PluginId": {
      "Description": "The plugin id.",
      "Value": {
        "Fn::GetAtt": [
          "PluginAttachment",
          "PluginId"
        ]
      }
    },
    "ApiId": {
      "Description": "The api id.",
      "Value": {
        "Fn::GetAtt": [
          "PluginAttachment",
          "ApiId"
        ]
      }
    }
  }
}