All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ApiGateway::Deployment

Last Updated:Jul 18, 2024

ALIYUN::ApiGateway::Deployment is used to publish an API to a specific runtime environment, or switch a published API to a specific version.

Syntax

{
  "Type": "ALIYUN::ApiGateway::Deployment",
  "Properties": {
    "HistoryVersion": String ,
    "ApiId": String ,
    "Description": String ,
    "StageName": String ,
    "GroupId": String 
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

ApiId

String

Yes

No

The ID of the API.

None.

GroupId

String

Yes

No

The ID of the API group.

None.

StageName

String

Yes

Yes

The name of the runtime environment.

Valid values:

  • TEST

  • PRE

  • RELEASE

You cannot specify HistoryVersion and StageName at the same time.

Description

String

No

Yes

The description of the current publishing.

None.

HistoryVersion

String

No

Yes

The historical version of the API. If this property is specified, the published API is switched to the specified version. If this property is not specified, the API is published.

You cannot specify HistoryVersion and StageName at the same time.

Return values

Fn::GetAtt

None.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  GroupId:
    Type: 'String '
    Description: API group ID
  ApiId:
    Type: 'String '
    Description: API ID
Resources:
  Deployment:
    Type: ALIYUN::ApiGateway::Deployment
    Properties:
      GroupId:
        Ref: GroupId
      ApiId:
        Ref: ApiId
      StageName: PRE
      Description: TEST_ONLY_CHANGE

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "GroupId": {
      "Type": "String ",
      "Description": "API group ID"
    },
    "ApiId": {
      "Type": "String ",
      "Description": "API ID"
    }
  },
  "Resources": {
    "Deployment": {
      "Type": "ALIYUN::ApiGateway::Deployment",
      "Properties": {
        "GroupId": {
          "Ref": "GroupId"
        },
        "ApiId": {
          "Ref": "ApiId"
        },
        "StageName": "PRE",
        "Description": "TEST_ONLY_CHANGE"
      }
    }
  }
}