Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::EventBridge::Connection

Última atualização: Sep 18, 2026

ALIYUN::EventBridge::Connection é utilizado para criar configurações de conexão.

Sintaxe

{
  "Type": "ALIYUN::EventBridge::Connection",
  "Properties": {
    "ConnectionName": String,
    "NetworkParameters": Map,
    "AuthParameters": Map,
    "Description": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

ConnectionName

String

Sim

Não

Nome da configuração de conexão.

Comprimento máximo: 127 caracteres. Comprimento mínimo: 2 caracteres.

NetworkParameters

Map

Sim

Sim

Estrutura de dados da configuração de rede.

Para mais informações, consulte NetworkParameters properties.

AuthParameters

Map

Não

Sim

Estrutura de dados de autenticação.

Para mais informações, consulte AuthParameters properties.

Description

String

Não

Sim

Descrição da configuração de conexão.

Comprimento máximo: 255 caracteres.

Sintaxe de AuthParameters

"AuthParameters": {
  "OauthParameters": Map,
  "BasicAuthParameters": Map,
  "ApiKeyAuthParameters": Map,
  "AuthorizationType": String
}

Propriedades de AuthParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

ApiKeyAuthParameters

Map

Não

Sim

Estrutura de dados de API KEY.

Para mais informações, consulte ApiKeyAuthParameters properties.

AuthorizationType

String

Não

Sim

Tipo de autenticação.

Valores válidos:

  • BASIC_AUTH: autenticação básica. Adiciona Authorization: Basic Base64(username:password) ao cabeçalho da requisição. Username e Password são obrigatórios.

  • API_KEY_AUTH: autenticação por chave de API. Adiciona Token: token_value ao cabeçalho da requisição. ApiKeyName e ApiKeyValue são obrigatórios.

  • OAUTH_AUTH: autorização OAuth 2.0. Utiliza um mecanismo de Access Token para acessar recursos protegidos com segurança. AuthorizationEndpoint, OauthHttpParameters e HttpMethod são obrigatórios.

BasicAuthParameters

Map

Não

Sim

Estrutura de dados de autenticação básica.

Para mais informações, consulte BasicAuthParameters properties.

OauthParameters

Map

Não

Sim

Estrutura de dados dos parâmetros de autenticação OAuth.

Para mais informações, consulte OauthParameters properties.

Sintaxe de OauthParameters

"OauthParameters": {
  "ClientParameters": Map,
  "OauthHttpParameters": Map,
  "AuthorizationEndpoint": String,
  "HttpMethod": String
}

Propriedades de OauthParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

AuthorizationEndpoint

String

Não

Sim

Endereço do endpoint de autorização.

Comprimento máximo: 127 caracteres.

ClientParameters

Map

Não

Sim

Estrutura de dados de parâmetros personalizados.

Para mais informações, consulte ClientParameters properties.

HttpMethod

String

Não

Sim

Método para o tipo de sondagem.

Valores válidos: GET, POST, HEAD, DELETE, PUT e PATCH.

OauthHttpParameters

Map

Não

Sim

Parâmetros da requisição de autenticação OAuth.

Para mais informações, consulte OauthHttpParameters properties.

Sintaxe de ClientParameters

"ClientParameters": {
  "ClientSecret": String,
  "ClientId": String
}

Propriedades de ClientParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

ClientId

String

Não

Sim

ID do cliente.

Nenhuma.

ClientSecret

String

Não

Sim

Segredo do cliente da aplicação.

Nenhuma.

Sintaxe de OauthHttpParameters

"OauthHttpParameters": {
  "HeaderParameters": List,
  "QueryStringParameters": List,
  "BodyParameters": List
}

Propriedades de OauthHttpParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

BodyParameters

List

Não

Sim

Lista da estrutura de dados dos parâmetros do corpo da requisição.

Para mais informações, consulte BodyParameters properties.

HeaderParameters

List

Não

Sim

Lista de parâmetros do cabeçalho da requisição.

Para mais informações, consulte HeaderParameters properties.

QueryStringParameters

List

Não

Sim

Estrutura de dados dos parâmetros de caminho da requisição.

Para mais informações, consulte QueryStringParameters properties.

Sintaxe de HeaderParameters

"HeaderParameters": [
  {
    "IsValueSecret": Boolean,
    "Value": String,
    "Key": String
  }
]

Propriedades de HeaderParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

IsValueSecret

Boolean

Não

Sim

Indica se a autenticação é necessária.

Nenhuma.

Key

String

Não

Sim

Chave do parâmetro do cabeçalho da requisição.

Nenhuma.

Value

String

Não

Sim

Valor do parâmetro do cabeçalho da requisição.

Nenhuma.

Sintaxe de QueryStringParameters

"QueryStringParameters": [
  {
    "IsValueSecret": Boolean,
    "Value": String,
    "Key": String
  }
]

Propriedades de QueryStringParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

IsValueSecret

Boolean

Não

Sim

Indica se a autenticação é necessária.

Nenhuma.

Key

String

Não

Sim

Chave do parâmetro de caminho da requisição.

Nenhuma.

Value

String

Não

Sim

Valor do parâmetro de caminho da requisição.

Nenhuma.

Sintaxe de BodyParameters

"BodyParameters": [
  {
    "IsValueSecret": Boolean,
    "Value": String,
    "Key": String
  }
]

Propriedades de BodyParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

IsValueSecret

Boolean

Não

Sim

Indica se a autenticação é necessária.

Nenhuma.

Key

String

Não

Sim

Chave do parâmetro do corpo da requisição.

Nenhuma.

Value

String

Não

Sim

Valor do parâmetro do corpo da requisição.

Nenhuma.

Sintaxe de BasicAuthParameters

"BasicAuthParameters": {
  "Username": String,
  "Password": String
}

Propriedades de BasicAuthParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

Password

String

Não

Sim

Senha da autenticação básica.

Nenhuma.

Username

String

Não

Sim

Nome de usuário da autenticação básica.

Nenhuma.

Sintaxe de ApiKeyAuthParameters

"ApiKeyAuthParameters": {
  "ApiKeyValue": String,
  "ApiKeyName": String
}

Propriedades de ApiKeyAuthParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

ApiKeyName

String

Não

Sim

Nome da chave de API.

Nenhuma.

ApiKeyValue

String

Não

Sim

Valor da chave de API.

Nenhuma.

Sintaxe de NetworkParameters

"NetworkParameters": {
  "VpcId": String,
  "NetworkType": String,
  "SecurityGroupId": String,
  "VswitcheId": String
}

Propriedades de NetworkParameters

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

NetworkType

String

Sim

Sim

Tipo de rede.

Valores válidos:

  • PublicNetwork: rede pública.

  • PrivateNetwork: rede privada.

Observação: ao selecionar PrivateNetwork, os parâmetros VpcId, VswitcheId e SecurityGroupId são obrigatórios.

SecurityGroupId

String

Não

Sim

ID do grupo de segurança.

Nenhuma.

VpcId

String

Não

Sim

ID da VPC.

Nenhuma.

VswitcheId

String

Não

Sim

ID do vSwitch.

Nenhuma.

Valores de retorno

Fn::GetAtt

  • ConnectionName: nome da configuração de conexão.

  • AuthParameters: estrutura de dados de autenticação.

  • Description: descrição da configuração de conexão.

  • NetworkParameters: estrutura de dados da configuração de rede.

  • CreateTime: horário em que o recurso foi criado.

Exemplos

Cenário 1: Criar uma conexão EventBridge em rede pública com autenticação Basic Auth

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建使用Basic Auth认证的公网EventBridge连接。
  en: Create a public network EventBridge connection with Basic Auth.
Parameters:
  ConnectionName:
    Type: String
    Label:
      zh-cn: 连接名称
      en: Connection Name
    Description:
      zh-cn: EventBridge连接配置的名称,2~127个字符。
      en: The name of the EventBridge connection, 2 to 127 characters.
    MinLength: 2
    MaxLength: 127
    Default: basic-auth-connection
  Username:
    Type: String
    Label:
      zh-cn: 认证用户名
      en: Auth Username
    Description:
      zh-cn: Basic Auth认证的用户名。
      en: Username for Basic Auth authentication.
    MinLength: 1
  Password:
    Type: String
    Label:
      zh-cn: 认证密码
      en: Auth Password
    Description:
      zh-cn: Basic Auth认证的密码。
      en: Password for Basic Auth authentication.
    NoEcho: true
    MinLength: 1
Resources:
  Connection:
    Type: ALIYUN::EventBridge::Connection
    Properties:
      ConnectionName:
        Ref: ConnectionName
      Description: Basic Auth公网连接,用于对接外部Webhook服务。
      NetworkParameters:
        NetworkType: PublicNetwork
      AuthParameters:
        AuthorizationType: BASIC_AUTH
        BasicAuthParameters:
          Username:
            Ref: Username
          Password:
            Ref: Password
Outputs:
  ConnectionName:
    Label:
      zh-cn: 连接名称
      en: Connection Name
    Description:
      zh-cn: 创建成功的连接配置名称。
      en: The name of the created connection.
    Value:
      Fn::GetAtt:
        - Connection
        - ConnectionName
  CreateTime:
    Label:
      zh-cn: 创建时间
      en: Create Time
    Value:
      Fn::GetAtt:
        - Connection
        - CreateTime
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建使用Basic Auth认证的公网EventBridge连接。",
    "en": "Create a public network EventBridge connection with Basic Auth."
  },
  "Parameters": {
    "ConnectionName": {
      "Type": "String",
      "Label": {
        "zh-cn": "连接名称",
        "en": "Connection Name"
      },
      "Description": {
        "zh-cn": "EventBridge连接配置的名称,2~127个字符。",
        "en": "The name of the EventBridge connection, 2 to 127 characters."
      },
      "MinLength": 2,
      "MaxLength": 127,
      "Default": "basic-auth-connection"
    },
    "Username": {
      "Type": "String",
      "Label": {
        "zh-cn": "认证用户名",
        "en": "Auth Username"
      },
      "Description": {
        "zh-cn": "Basic Auth认证的用户名。",
        "en": "Username for Basic Auth authentication."
      },
      "MinLength": 1
    },
    "Password": {
      "Type": "String",
      "Label": {
        "zh-cn": "认证密码",
        "en": "Auth Password"
      },
      "Description": {
        "zh-cn": "Basic Auth认证的密码。",
        "en": "Password for Basic Auth authentication."
      },
      "NoEcho": true,
      "MinLength": 1
    }
  },
  "Resources": {
    "Connection": {
      "Type": "ALIYUN::EventBridge::Connection",
      "Properties": {
        "ConnectionName": {
          "Ref": "ConnectionName"
        },
        "Description": "Basic Auth公网连接,用于对接外部Webhook服务。",
        "NetworkParameters": {
          "NetworkType": "PublicNetwork"
        },
        "AuthParameters": {
          "AuthorizationType": "BASIC_AUTH",
          "BasicAuthParameters": {
            "Username": {
              "Ref": "Username"
            },
            "Password": {
              "Ref": "Password"
            }
          }
        }
      }
    }
  },
  "Outputs": {
    "ConnectionName": {
      "Label": {
        "zh-cn": "连接名称",
        "en": "Connection Name"
      },
      "Description": {
        "zh-cn": "创建成功的连接配置名称。",
        "en": "The name of the created connection."
      },
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "ConnectionName"
        ]
      }
    },
    "CreateTime": {
      "Label": {
        "zh-cn": "创建时间",
        "en": "Create Time"
      },
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "CreateTime"
        ]
      }
    }
  }
}

Cenário 2: Criar uma conexão EventBridge em rede privada VPC com autenticação por chave de API

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建使用API Key认证的VPC私网EventBridge连接。
  en: Create a VPC private network EventBridge connection with API Key auth.
Parameters:
  ConnectionName:
    Type: String
    Label:
      zh-cn: 连接名称
      en: Connection Name
    Description:
      zh-cn: EventBridge连接配置的名称,2~127个字符。
      en: The name of the EventBridge connection, 2 to 127 characters.
    MinLength: 2
    MaxLength: 127
    Default: apikey-vpc-connection
  VpcId:
    Type: String
    Label:
      zh-cn: VPC ID
      en: VPC ID
    Description:
      zh-cn: EventBridge连接所在的VPC ID。
      en: The VPC ID for the EventBridge connection.
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
  VswitcheId:
    Type: String
    Label:
      zh-cn: 交换机ID
      en: VSwitch ID
    Description:
      zh-cn: VPC中的交换机ID。
      en: The VSwitch ID within the VPC.
    AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
  SecurityGroupId:
    Type: String
    Label:
      zh-cn: 安全组ID
      en: Security Group ID
    Description:
      zh-cn: VPC中的安全组ID,需允许EventBridge访问目标服务端口。
      en: Security group ID in the VPC. Must allow EventBridge to access target service port.
    AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
  ApiKeyName:
    Type: String
    Label:
      zh-cn: API Key名称
      en: API Key Name
    Description:
      zh-cn: API Key的键名,将作为请求头的Header名称传递。
      en: The key name of the API Key, passed as a request header name.
    Default: X-Api-Key
  ApiKeyValue:
    Type: String
    Label:
      zh-cn: API Key值
      en: API Key Value
    Description:
      zh-cn: API Key的值,将作为请求头的Header值传递。
      en: The value of the API Key, passed as the request header value.
    NoEcho: true
    MinLength: 1
Resources:
  Connection:
    Type: ALIYUN::EventBridge::Connection
    Properties:
      ConnectionName:
        Ref: ConnectionName
      Description:
        Fn::Sub: API Key私网连接 - VPC ${VpcId}
      NetworkParameters:
        NetworkType: PrivateNetwork
        VpcId:
          Ref: VpcId
        VswitcheId:
          Ref: VswitcheId
        SecurityGroupId:
          Ref: SecurityGroupId
      AuthParameters:
        AuthorizationType: API_KEY_AUTH
        ApiKeyAuthParameters:
          ApiKeyName:
            Ref: ApiKeyName
          ApiKeyValue:
            Ref: ApiKeyValue
Outputs:
  ConnectionName:
    Label:
      zh-cn: 连接名称
      en: Connection Name
    Value:
      Fn::GetAtt:
        - Connection
        - ConnectionName
  NetworkParameters:
    Label:
      zh-cn: 网络配置
      en: Network Parameters
    Description:
      zh-cn: 连接的网络配置信息,包含VPC、交换机和安全组。
      en: Network configuration including VPC, VSwitch and security group.
    Value:
      Fn::GetAtt:
        - Connection
        - NetworkParameters
  CreateTime:
    Label:
      zh-cn: 创建时间
      en: Create Time
    Value:
      Fn::GetAtt:
        - Connection
        - CreateTime
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建使用API Key认证的VPC私网EventBridge连接。",
    "en": "Create a VPC private network EventBridge connection with API Key auth."
  },
  "Parameters": {
    "ConnectionName": {
      "Type": "String",
      "Label": {
        "zh-cn": "连接名称",
        "en": "Connection Name"
      },
      "Description": {
        "zh-cn": "EventBridge连接配置的名称,2~127个字符。",
        "en": "The name of the EventBridge connection, 2 to 127 characters."
      },
      "MinLength": 2,
      "MaxLength": 127,
      "Default": "apikey-vpc-connection"
    },
    "VpcId": {
      "Type": "String",
      "Label": {
        "zh-cn": "VPC ID",
        "en": "VPC ID"
      },
      "Description": {
        "zh-cn": "EventBridge连接所在的VPC ID。",
        "en": "The VPC ID for the EventBridge connection."
      },
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
    },
    "VswitcheId": {
      "Type": "String",
      "Label": {
        "zh-cn": "交换机ID",
        "en": "VSwitch ID"
      },
      "Description": {
        "zh-cn": "VPC中的交换机ID。",
        "en": "The VSwitch ID within the VPC."
      },
      "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}"
      }
    },
    "SecurityGroupId": {
      "Type": "String",
      "Label": {
        "zh-cn": "安全组ID",
        "en": "Security Group ID"
      },
      "Description": {
        "zh-cn": "VPC中的安全组ID,需允许EventBridge访问目标服务端口。",
        "en": "Security group ID in the VPC. Must allow EventBridge to access target service port."
      },
      "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}"
      }
    },
    "ApiKeyName": {
      "Type": "String",
      "Label": {
        "zh-cn": "API Key名称",
        "en": "API Key Name"
      },
      "Description": {
        "zh-cn": "API Key的键名,将作为请求头的Header名称传递。",
        "en": "The key name of the API Key, passed as a request header name."
      },
      "Default": "X-Api-Key"
    },
    "ApiKeyValue": {
      "Type": "String",
      "Label": {
        "zh-cn": "API Key值",
        "en": "API Key Value"
      },
      "Description": {
        "zh-cn": "API Key的值,将作为请求头的Header值传递。",
        "en": "The value of the API Key, passed as the request header value."
      },
      "NoEcho": true,
      "MinLength": 1
    }
  },
  "Resources": {
    "Connection": {
      "Type": "ALIYUN::EventBridge::Connection",
      "Properties": {
        "ConnectionName": {
          "Ref": "ConnectionName"
        },
        "Description": {
          "Fn::Sub": "API Key私网连接 - VPC ${VpcId}"
        },
        "NetworkParameters": {
          "NetworkType": "PrivateNetwork",
          "VpcId": {
            "Ref": "VpcId"
          },
          "VswitcheId": {
            "Ref": "VswitcheId"
          },
          "SecurityGroupId": {
            "Ref": "SecurityGroupId"
          }
        },
        "AuthParameters": {
          "AuthorizationType": "API_KEY_AUTH",
          "ApiKeyAuthParameters": {
            "ApiKeyName": {
              "Ref": "ApiKeyName"
            },
            "ApiKeyValue": {
              "Ref": "ApiKeyValue"
            }
          }
        }
      }
    }
  },
  "Outputs": {
    "ConnectionName": {
      "Label": {
        "zh-cn": "连接名称",
        "en": "Connection Name"
      },
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "ConnectionName"
        ]
      }
    },
    "NetworkParameters": {
      "Label": {
        "zh-cn": "网络配置",
        "en": "Network Parameters"
      },
      "Description": {
        "zh-cn": "连接的网络配置信息,包含VPC、交换机和安全组。",
        "en": "Network configuration including VPC, VSwitch and security group."
      },
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "NetworkParameters"
        ]
      }
    },
    "CreateTime": {
      "Label": {
        "zh-cn": "创建时间",
        "en": "Create Time"
      },
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "CreateTime"
        ]
      }
    }
  }
}

Cenário 3: Criar uma conexão EventBridge em rede privada VPC com autenticação OAuth 2.0 e parâmetros de autorização completos configurados

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建使用OAuth 2.0认证的VPC私网EventBridge连接,配置完整的授权参数。
  en: Create a VPC EventBridge connection with OAuth 2.0 and full authorization config.
Parameters:
  ConnectionName:
    Type: String
    Label:
      zh-cn: 连接名称
      en: Connection Name
    Description:
      zh-cn: EventBridge连接配置的名称,2~127个字符。
      en: The name of the EventBridge connection, 2 to 127 characters.
    MinLength: 2
    MaxLength: 127
    Default: oauth-vpc-connection
  Description:
    Type: String
    Label:
      zh-cn: 连接描述
      en: Connection Description
    Description:
      zh-cn: 连接配置的描述信息,最大255个字符。
      en: Connection description, up to 255 characters.
    MaxLength: 255
    Default: OAuth 2.0私网连接,对接企业SaaS平台。
  VpcId:
    Type: String
    Label:
      zh-cn: VPC ID
      en: VPC ID
    Description:
      zh-cn: EventBridge连接所在的VPC ID。
      en: The VPC ID for the EventBridge connection.
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
  VswitcheId:
    Type: String
    Label:
      zh-cn: 交换机ID
      en: VSwitch ID
    Description:
      zh-cn: VPC中的交换机ID。
      en: The VSwitch ID within the VPC.
    AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
  SecurityGroupId:
    Type: String
    Label:
      zh-cn: 安全组ID
      en: Security Group ID
    Description:
      zh-cn: VPC中的安全组ID。
      en: Security group ID in the VPC.
    AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
  AuthorizationEndpoint:
    Type: String
    Label:
      zh-cn: OAuth授权端点
      en: Authorization Endpoint
    Description:
      zh-cn: >-
        OAuth 2.0的Token获取端点地址,最大127个字符。
        例如:https://auth.example.com/oauth/token
      en: >-
        OAuth 2.0 token endpoint URL, up to 127 characters.
        e.g. https://auth.example.com/oauth/token
    MaxLength: 127
  HttpMethod:
    Type: String
    Label:
      zh-cn: 授权请求方法
      en: Auth Request Method
    Description:
      zh-cn: 获取OAuth Token时使用的HTTP方法。
      en: HTTP method used to obtain the OAuth token.
    Default: POST
    AllowedValues:
      - GET
      - POST
      - PUT
  ClientId:
    Type: String
    Label:
      zh-cn: 客户端ID
      en: Client ID
    Description:
      zh-cn: OAuth 2.0应用的客户端ID。
      en: The client ID of the OAuth 2.0 application.
    MinLength: 1
  ClientSecret:
    Type: String
    Label:
      zh-cn: 客户端密钥
      en: Client Secret
    Description:
      zh-cn: OAuth 2.0应用的客户端密钥。
      en: The client secret of the OAuth 2.0 application.
    NoEcho: true
    MinLength: 1
Resources:
  Connection:
    Type: ALIYUN::EventBridge::Connection
    Properties:
      ConnectionName:
        Ref: ConnectionName
      Description:
        Ref: Description
      NetworkParameters:
        NetworkType: PrivateNetwork
        VpcId:
          Ref: VpcId
        VswitcheId:
          Ref: VswitcheId
        SecurityGroupId:
          Ref: SecurityGroupId
      AuthParameters:
        AuthorizationType: OAUTH_AUTH
        OauthParameters:
          AuthorizationEndpoint:
            Ref: AuthorizationEndpoint
          HttpMethod:
            Ref: HttpMethod
          ClientParameters:
            ClientId:
              Ref: ClientId
            ClientSecret:
              Ref: ClientSecret
          OauthHttpParameters:
            HeaderParameters:
              - Key: Content-Type
                Value: application/x-www-form-urlencoded
                IsValueSecret: false
            BodyParameters:
              - Key: grant_type
                Value: client_credentials
                IsValueSecret: false
              - Key: scope
                Value: events:write
                IsValueSecret: false
Outputs:
  ConnectionName:
    Label:
      zh-cn: 连接名称
      en: Connection Name
    Value:
      Fn::GetAtt:
        - Connection
        - ConnectionName
  NetworkParameters:
    Label:
      zh-cn: 网络配置
      en: Network Parameters
    Value:
      Fn::GetAtt:
        - Connection
        - NetworkParameters
  AuthParameters:
    Label:
      zh-cn: 认证配置
      en: Auth Parameters
    Description:
      zh-cn: 连接的OAuth 2.0认证配置信息。
      en: The OAuth 2.0 authentication configuration of the connection.
    Value:
      Fn::GetAtt:
        - Connection
        - AuthParameters
  CreateTime:
    Label:
      zh-cn: 创建时间
      en: Create Time
    Value:
      Fn::GetAtt:
        - Connection
        - CreateTime
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建使用OAuth 2.0认证的VPC私网EventBridge连接,配置完整的授权参数。",
    "en": "Create a VPC EventBridge connection with OAuth 2.0 and full authorization config."
  },
  "Parameters": {
    "ConnectionName": {
      "Type": "String",
      "Label": {
        "zh-cn": "连接名称",
        "en": "Connection Name"
      },
      "Description": {
        "zh-cn": "EventBridge连接配置的名称,2~127个字符。",
        "en": "The name of the EventBridge connection, 2 to 127 characters."
      },
      "MinLength": 2,
      "MaxLength": 127,
      "Default": "oauth-vpc-connection"
    },
    "Description": {
      "Type": "String",
      "Label": {
        "zh-cn": "连接描述",
        "en": "Connection Description"
      },
      "Description": {
        "zh-cn": "连接配置的描述信息,最大255个字符。",
        "en": "Connection description, up to 255 characters."
      },
      "MaxLength": 255,
      "Default": "OAuth 2.0私网连接,对接企业SaaS平台。"
    },
    "VpcId": {
      "Type": "String",
      "Label": {
        "zh-cn": "VPC ID",
        "en": "VPC ID"
      },
      "Description": {
        "zh-cn": "EventBridge连接所在的VPC ID。",
        "en": "The VPC ID for the EventBridge connection."
      },
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
    },
    "VswitcheId": {
      "Type": "String",
      "Label": {
        "zh-cn": "交换机ID",
        "en": "VSwitch ID"
      },
      "Description": {
        "zh-cn": "VPC中的交换机ID。",
        "en": "The VSwitch ID within the VPC."
      },
      "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}"
      }
    },
    "SecurityGroupId": {
      "Type": "String",
      "Label": {
        "zh-cn": "安全组ID",
        "en": "Security Group ID"
      },
      "Description": {
        "zh-cn": "VPC中的安全组ID。",
        "en": "Security group ID in the VPC."
      },
      "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}"
      }
    },
    "AuthorizationEndpoint": {
      "Type": "String",
      "Label": {
        "zh-cn": "OAuth授权端点",
        "en": "Authorization Endpoint"
      },
      "Description": {
        "zh-cn": "OAuth 2.0的Token获取端点地址,最大127个字符。例如:https://auth.example.com/oauth/token",
        "en": "OAuth 2.0 token endpoint URL, up to 127 characters. e.g. https://auth.example.com/oauth/token"
      },
      "MaxLength": 127
    },
    "HttpMethod": {
      "Type": "String",
      "Label": {
        "zh-cn": "授权请求方法",
        "en": "Auth Request Method"
      },
      "Description": {
        "zh-cn": "获取OAuth Token时使用的HTTP方法。",
        "en": "HTTP method used to obtain the OAuth token."
      },
      "Default": "POST",
      "AllowedValues": [
        "GET",
        "POST",
        "PUT"
      ]
    },
    "ClientId": {
      "Type": "String",
      "Label": {
        "zh-cn": "客户端ID",
        "en": "Client ID"
      },
      "Description": {
        "zh-cn": "OAuth 2.0应用的客户端ID。",
        "en": "The client ID of the OAuth 2.0 application."
      },
      "MinLength": 1
    },
    "ClientSecret": {
      "Type": "String",
      "Label": {
        "zh-cn": "客户端密钥",
        "en": "Client Secret"
      },
      "Description": {
        "zh-cn": "OAuth 2.0应用的客户端密钥。",
        "en": "The client secret of the OAuth 2.0 application."
      },
      "NoEcho": true,
      "MinLength": 1
    }
  },
  "Resources": {
    "Connection": {
      "Type": "ALIYUN::EventBridge::Connection",
      "Properties": {
        "ConnectionName": {
          "Ref": "ConnectionName"
        },
        "Description": {
          "Ref": "Description"
        },
        "NetworkParameters": {
          "NetworkType": "PrivateNetwork",
          "VpcId": {
            "Ref": "VpcId"
          },
          "VswitcheId": {
            "Ref": "VswitcheId"
          },
          "SecurityGroupId": {
            "Ref": "SecurityGroupId"
          }
        },
        "AuthParameters": {
          "AuthorizationType": "OAUTH_AUTH",
          "OauthParameters": {
            "AuthorizationEndpoint": {
              "Ref": "AuthorizationEndpoint"
            },
            "HttpMethod": {
              "Ref": "HttpMethod"
            },
            "ClientParameters": {
              "ClientId": {
                "Ref": "ClientId"
              },
              "ClientSecret": {
                "Ref": "ClientSecret"
              }
            },
            "OauthHttpParameters": {
              "HeaderParameters": [
                {
                  "Key": "Content-Type",
                  "Value": "application/x-www-form-urlencoded",
                  "IsValueSecret": false
                }
              ],
              "BodyParameters": [
                {
                  "Key": "grant_type",
                  "Value": "client_credentials",
                  "IsValueSecret": false
                },
                {
                  "Key": "scope",
                  "Value": "events:write",
                  "IsValueSecret": false
                }
              ]
            }
          }
        }
      }
    }
  },
  "Outputs": {
    "ConnectionName": {
      "Label": {
        "zh-cn": "连接名称",
        "en": "Connection Name"
      },
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "ConnectionName"
        ]
      }
    },
    "NetworkParameters": {
      "Label": {
        "zh-cn": "网络配置",
        "en": "Network Parameters"
      },
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "NetworkParameters"
        ]
      }
    },
    "AuthParameters": {
      "Label": {
        "zh-cn": "认证配置",
        "en": "Auth Parameters"
      },
      "Description": {
        "zh-cn": "连接的OAuth 2.0认证配置信息。",
        "en": "The OAuth 2.0 authentication configuration of the connection."
      },
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "AuthParameters"
        ]
      }
    },
    "CreateTime": {
      "Label": {
        "zh-cn": "创建时间",
        "en": "Create Time"
      },
      "Value": {
        "Fn::GetAtt": [
          "Connection",
          "CreateTime"
        ]
      }
    }
  }
}