All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::APIG::Service

更新时间:Apr 18, 2025

ALIYUN::APIG::Service is used to create a service.

Syntax

{
  "Type": "ALIYUN::APIG::Service",
  "Properties": {
    "Addresses": List,
    "GatewayId": String,
    "ServiceName": String,
    "SourceType": String,
    "GroupName": String,
    "ResourceGroupId": String,
    "Namespace": String,
    "Qualifier": String,
    "AiServiceConfig": Map
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Addresses

List

No

Yes

The information about the addresses.

You can specify up to 10 IP addresses or domain names.

GatewayId

String

Yes

No

The ID of the Cloud-native API Gateway instance.

None.

GroupName

String

No

No

The name of the service group.

This property must be specified when SourceType is set to MSE_NACOS.

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

Namespace

String

No

No

The namespace of the service.

  • This property specifies the namespace of a Kubernetes service if SourceType is set to K8S.

  • This property specifies a namespace in Nacos if SourceType is set to MSE_NACOS.

This property must be specified when SourceType is set to K8S or MSE_NACOS.

Qualifier

String

No

No

The version or alias of the function.

None.

AiServiceConfig

Map

No

No

The configurations of the artificial intelligence (AI) service.

For more information, see the "AiServiceConfig properties" section of this topic.

ServiceName

String

No

No

The name of the service.

None.

SourceType

String

No

No

The type of the service source.

Set the value to DNS.

AiServiceConfig syntax

"AiServiceConfig": {
  "Provider": String,
  "Address": String,
  "Protocols": List,
  "ApiKeys": List,
  "EnableHealthCheck": Boolean
}

AiServiceConfig properties

Property

Type

Required

Editable

Description

Constraint

Provider

String

No

Yes

The provider of the large language model (LLM).

None.

Address

String

No

Yes

The address of the service.

None.

Protocols

List

No

Yes

The protocols of the LLM.

None.

ApiKeys

List

No

Yes

The API keys.

None.

EnableHealthCheck

Boolean

No

Yes

Specifies whether to enable the health check feature.

None.

Return values

Fn::GetAtt

  • Addresses: the information about the addresses.

  • ServiceName: the name of the service.

  • GatewayId: the ID of the Cloud-native API Gateway instance.

  • ServiceId: the ID of the service.

  • AiServiceConfig: the configurations of the AI service.

  • GroupName: the name of the service group.

  • Qualifier: the version or alias of the function.

  • ResourceGroupId: the ID of the resource group.

  • Namespace: the namespace of the service.

Examples

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"
        ]
      }
    }
  }
}