All Products
Search
Document Center

EventBridge:CreateConnection

Last Updated:Dec 04, 2024

Creates a connection.

Operation description

You can call this API operation to create a connection.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
eventbridge:CreateConnectioncreate
*Connection
acs:eventbridge:{#regionId}:{#accountId}:connection/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ConnectionNamestringYes

The name of the connection. The name must be 2 to 127 characters in length.

connection-name
DescriptionstringNo

The description of the connection. The description can be up to 255 characters in length.

demo
NetworkParametersobjectYes

The parameters that are configured for the network.

NetworkTypestringYes
  • PublicNetwork: the Internet.
  • PrivateNetwork: virtual private cloud (VPC).
Note If you set this parameter to PrivateNetwork, you must also configure VpcId, VswitchId, and SecurityGroupId.
PublicNetwork
VpcIdstringNo

The VPC ID.

eb-test/vpc-bp1symadadwnwg****
VswitcheIdstringNo

The vSwitch ID.

vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeq****
SecurityGroupIdstringNo

The security group ID.

eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9****
AuthParametersobjectNo

The parameters that are configured for authentication.

AuthorizationTypestringNo

The authentication type. Valid values:

  • BASIC: basic authentication. Basic authentication is a simple authentication scheme built into the HTTP protocol. When you use the HTTP protocol for communications, the authentication method that the HTTP server uses to authenticate user identities on the client is defined in the protocol. The request header is in the Authorization: Basic Base64-encoded string (Username:Password) format. If you use this authentication method, you must configure Username and Password.
  • API_KEY_AUTH: API key authentication. The request header is in the Token: Token value format. If you use this authentication method, you must configure ApiKeyName and ApiKeyValue.
  • OAUTH_AUTH: OAuth authentication. OAuth2.0 is an authentication mechanism. In normal cases, a system that does not use OAuth2.0 can access the resources of the server from the client. To ensure access security, access tokens are used to authenticate users in OAuth 2.0. The client must use an access token to access protected resources. This way, OAuth 2.0 protects resources from being accessed from malicious clients and improves system security. If you use this authentication method, you must configure AuthorizationEndpoint, OAuthHttpParameters, and HttpMethod.
BASIC_AUTH
ApiKeyAuthParametersobjectNo

The parameters that are configured for API key authentication.

ApiKeyNamestringNo

The key of the API key.

Token
ApiKeyValuestringNo

The value of the API key.

adkjnakddh****
BasicAuthParametersobjectNo

The parameters that are configured for basic authentication.

PasswordstringNo

The password for basic authentication.

*******
UsernamestringNo

The username for basic authentication.

admin
OAuthParametersobjectNo

The parameters that are configured for OAuth authentication.

AuthorizationEndpointstringNo

The endpoint of the authorized client. The endpoint can be up to 127 characters in length.

http://localhost:8080/oauth/token
ClientParametersobjectNo

The parameters that are configured for the client.

ClientIDstringNo

The client ID.

ClientID
ClientSecretstringNo

The AccessKey secret of the client.

Qo57Q~F249~S74GmNPA36pZJoJK4f4LY****
HttpMethodstringNo

The HTTP request method. Valid values:

  • GET
  • POST
  • HEAD
  • DELETE
  • PUT
  • PATCH
POST
OAuthHttpParametersobjectNo

The request parameters of OAuth authentication.

BodyParametersarray<object>No

The parameters that are configured for the request body.

objectNo
IsValueSecretstringNo

Specifies whether to enable authentication.

false
KeystringNo

The key of the request body.

keyDemo
ValuestringNo

The value of the request body.

keyValue
HeaderParametersarray<object>No

The parameters that are configured for the request header.

objectNo
IsValueSecretstringNo

Specifies whether to enable authentication.

false
KeystringNo

The key of the request header.

keyDemo
ValuestringNo

The value of the request header.

keyValue
QueryStringParametersarray<object>No

The parameters that are configured for the request path.

objectNo
IsValueSecretstringNo

Specifies whether to enable authentication.

false
KeystringNo

The key of the request path.

keyDemo
ValuestringNo

The value of the request path.

valueDemo

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

7DA60DED-CD36-5837-B848-C01A23D2****
Messagestring

The returned message. If the request is successful, success is returned. If the request failed, an error code is returned.

success
Codestring

The returned response code. The value Success indicates that the request is successful.

Success
Dataobject

The returned data.

ConnectionNamestring

The connection name.

connection-demo

Examples

Sample success responses

JSONformat

{
  "RequestId": "7DA60DED-CD36-5837-B848-C01A23D2****",
  "Message": "success",
  "Code": "Success",
  "Data": {
    "ConnectionName": "connection-demo"
  }
}

Error codes

HTTP status codeError codeError message
409RequestParameterExceptionRequest parameter exception
409ConnectionAlreadyExistThe Connection already existed!
409ConnectionCountExceedLimitThe current count of connection, which will exceed the limit quota.
409BasicRequiredParameterIsEmptyBasic required parameters are empty, the required parameters are username and password!
409BasicUserNameLengthExceedBasic username length cannot exceed 127!
409BasicPassWordLengthExceedBasic password length cannot exceed 127!
409ApiKeyRequiredParameterIsEmptyApi Key required parameters are empty, the required parameters are apiKeyName and apiKeyValue!
409ApiKeyNameLengthExceedApi key name length cannot exceed 127!
409ApiKeyValueLengthExceedApi key value length cannot exceed 127!
409OAuthRequiredParameterIsEmptyOAuth required parameters are empty, the required parameters are authorizationEndpoint and httpMethod!
409AuthorizationEndpointLengthExceedAuthorization endpoint length cannot exceed 127!
409ClientIDLengthExceedClientID length cannot exceed 127!
409ClientSecretLengthExceedClientSecret length cannot exceed 127!
409OauthHttpParametersEmptyOauthHttpParameters is Empty.
409SecretManagerAPICreateSecretNameFailedCreate secret manager api secret name failed
500InternalErrorInternalError

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-13The Error code has changedView Change Details
2023-04-12The Error code has changedView Change Details
2023-04-06The Error code has changedView Change Details