ALIYUN::APIG::Service

ALIYUN::APIG::Service类型用于创建服务。

语法

{
  "Type": "ALIYUN::APIG::Service",
  "Properties": {
    "Addresses": List,
    "GatewayId": String,
    "ServiceName": String,
    "SourceType": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Addresses

List

地址信息。

IP或者域名列表,最多支持输入10组地址。

GatewayId

String

网关实例 ID。

ServiceName

String

服务名。

SourceType

String

服务来源类型。

取值:DNS

返回值

Fn::GetAtt

  • Addresses:地址信息。

  • ServiceName:服务名。

  • SourceType:服务来源类型。

  • GatewayId:网关实例 ID。

  • ServiceId:服务ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  GatewayId:
    Type: String
    Description:
      en: The ID of the Cloud Native API Gateway.
    Required: true
    AssociationProperty: ALIYUN::APIG::Gateway::GatewayId
Resources:
  ExtensionResource:
    Type: ALIYUN::APIG::Service
    Properties:
      GatewayId:
        Ref: GatewayId
      SourceType: DNS
      ServiceName: test1
      Addresses:
        - ros.test:80
        - ros.test:801
Outputs:
  Addresses:
    Description: Service Address List.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Addresses
  ServiceName:
    Description: The Name of the service .
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceName
  SourceType:
    Description: Service source type.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SourceType
  GatewayId:
    Description: The ID of the Cloud Native API Gateway.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GatewayId
  ServiceId:
    Description: The ID of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "GatewayId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the Cloud Native API Gateway."
      },
      "Required": true,
      "AssociationProperty":"ALIYUN::APIG::Gateway::GatewayId"
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::APIG::Service",
      "Properties": {
        "GatewayId": {
          "Ref": "GatewayId"
        },
        "SourceType": "DNS",
        "ServiceName": "test1",
        "Addresses": [
          "ros.test:80",
          "ros.test:801"
        ]
      }
    }
  },
  "Outputs": {
    "Addresses": {
      "Description": "Service Address List.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Addresses"
        ]
      }
    },
    "ServiceName": {
      "Description": "The Name of the service .",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceName"
        ]
      }
    },
    "SourceType": {
      "Description": "Service source type.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SourceType"
        ]
      }
    },
    "GatewayId": {
      "Description": "The ID of the Cloud Native API Gateway.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GatewayId"
        ]
      }
    },
    "ServiceId": {
      "Description": "The ID of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceId"
        ]
      }
    }
  }
}