すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::APIG::HttpApi

最終更新日:Jan 23, 2025

ALIYUN::APIG::HttpApi は、HTTP API を作成するために使用されます。

構文

{
  "Type": "ALIYUN::APIG::HttpApi",
  "Properties": {
    "HttpApiName": String,
    "Protocols": List,
    "BasePath": String,
    "Description": String,
    "Type": String
  }
}

プロパティ

プロパティ

タイプ

必須

編集可能

説明

制約

HttpApiName

String

はい

いいえ

API名。

なし。

Protocols

List

はい

はい

API へのアクセスに使用されるプロトコル。

有効な値:

  • HTTP

  • HTTPS

BasePath

String

いいえ

はい

API のベースパス。

パスはスラッシュ (/) で始まる必要があります。

Description

String

いいえ

はい

API の説明。

なし。

Type

String

いいえ

いいえ

API タイプ。

有効な値:

  • Http

  • Rest

  • WebSocket

  • HttpIngress

戻り値

Fn::GetAtt

  • Environments: API が公開される環境。

  • HttpApiName: API名。

  • Type: API タイプ。

  • Protocols: API へのアクセスに使用されるプロトコル。

  • Description: API の説明。

  • BasePath: API のベースパス。

  • HttpApiId: API ID。

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  HttpApiName:
    Type: String
    Description:
      ja: API の名前。
    Required: true
    MinLength: 1
    MaxLength: 64
    Default: demo_api
  Type:
    Type: String
    Description:
      ja: |-
        HTTP API のタイプ。有効な値:
        * Http
        * Rest
        * WebSocket
        * HttpIngress
    AllowedValues:
      - Http
      - Rest
      - WebSocket
      - HttpIngress
    Default: Http
    Required: false
  Protocols:
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Description:
          ja: API プロトコル。
        AllowedValues:
          - HTTP
          - HTTPS
        Required: true
    AssociationProperty: List[Parameter]
    Type: Json
    Description:
      ja: API アクセスプロトコルのリスト。
    Required: true
    MaxLength: 2
    Default:
      - HTTP
  BasePath:
    Type: String
    Description:
      ja: API のベースパスは / で始まる必要があります。
    Required: false
    Default: /v1
Resources:
  ExtensionResource:
    Type: ALIYUN::APIG::HttpApi
    Properties:
      HttpApiName:
        Ref: HttpApiName
      Type:
        Ref: Type
      Protocols:
        Ref: Protocols
      BasePath:
        Ref: BasePath
Outputs:
  Environments:
    Description: API の公開環境情報。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Environments
  HttpApiName:
    Description: API の名前。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - HttpApiName
  Type:
    Description: HTTP API のタイプ
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Type
  Protocols:
    Description: API アクセスプロトコルのリスト。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Protocols
  Description:
    Description: API の説明。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Description
  BasePath:
    Description: API のベースパス。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BasePath
  HttpApiId:
    Description: API の ID。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - HttpApiId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "HttpApiName": {
      "Type": "String",
      "Description": {
        "ja": "API の名前。"
      },
      "Required": true,
      "MinLength": 1,
      "MaxLength": 64,
      "Default": "demo_api"
    },
    "Type": {
      "Type": "String",
      "Description": {
        "ja": "HTTP API のタイプ。有効な値:\n* Http\n* Rest\n* WebSocket\n* HttpIngress"
      },
      "AllowedValues": [
        "Http",
        "Rest",
        "WebSocket",
        "HttpIngress"
      ],
      "Default": "Http",
      "Required": false
    },
    "Protocols": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Description": {
            "ja": "API プロトコル。"
          },
          "AllowedValues": [
            "HTTP",
            "HTTPS"
          ],
          "Required": true
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "ja": "API アクセスプロトコルのリスト。"
      },
      "Required": true,
      "MaxLength": 2,
      "Default": [
        "HTTP"
      ]
    },
    "BasePath": {
      "Type": "String",
      "Description": {
        "ja": "API のベースパスは / で始まる必要があります。"
      },
      "Required": false,
      "Default": "/v1"
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::APIG::HttpApi",
      "Properties": {
        "HttpApiName": {
          "Ref": "HttpApiName"
        },
        "Type": {
          "Ref": "Type"
        },
        "Protocols": {
          "Ref": "Protocols"
        },
        "BasePath": {
          "Ref": "BasePath"
        }
      }
    }
  },
  "Outputs": {
    "Environments": {
      "Description": "API の公開環境情報。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Environments"
        ]
      }
    },
    "HttpApiName": {
      "Description": "API の名前。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "HttpApiName"
        ]
      }
    },
    "Type": {
      "Description": "HTTP API のタイプ",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Type"
        ]
      }
    },
    "Protocols": {
      "Description": "API アクセスプロトコルのリスト。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Protocols"
        ]
      }
    },
    "Description": {
      "Description": "API の説明。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Description"
        ]
      }
    },
    "BasePath": {
      "Description": "API のベースパス。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BasePath"
        ]
      }
    },
    "HttpApiId": {
      "Description": "API の ID。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "HttpApiId"
        ]
      }
    }
  }
}