All Products
Search
Document Center

Server Load Balancer:LoadBalancerJoinSecurityGroup

Last Updated:Jul 15, 2024

Adds an Application Load Balancer (ALB) instance to a security group.

Operation description

  • By default, security groups are unavailable. To use security groups, contact your account manager.

  • Make sure that a security group is created. For more information about how to create security groups, see CreateSecurityGroup .

  • Each ALB instance can be added to at most four security groups.

  • To query the security groups of an ALB instance, call the GetLoadBalancerAttribute operation.

  • GetLoadBalancerAttribute is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the ListAsynJobs operation to query the status of the task.

    • If the task is in the Succeeded state, the ALB instance is added to the security group.
    • If the task is in the Processing state, the ALB instance is being added to the security group. In this case, you can query the task but cannot perform other operations.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
SecurityGroupIdsarrayYes

The security group IDs.

stringYes

The security group ID.

sg-m5e7xkprgt1pi1ik****
LoadBalancerIdstringYes

The ALB instance ID.

alb-h7kcw4g4nnvtqp****
DryRunbooleanNo

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
false
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
123e4567-e89b-12d3-a456-426655440000

Response parameters

ParameterTypeDescriptionExample
object

The task result.

JobIdstring

The ID of the asynchronous task.

8fe81f25-79a0-4fa0-9036-f2601fda****
RequestIdstring

The request ID.

D3B9AE45-F5DB-58E3-A4B5-EE58F1EC****

Examples

Sample success responses

JSONformat

{
  "JobId": "8fe81f25-79a0-4fa0-9036-f2601fda****",
  "RequestId": "D3B9AE45-F5DB-58E3-A4B5-EE58F1EC****"
}

Error codes

HTTP status codeError codeError messageDescription
400IncorrectStatus.LoadBalancerThe status of %s [%s] is incorrect.The status of %s [%s] is incorrect.
400ResourceAlreadyAssociated.SecurityGroupThe specified resource of %s is already associated.-
400ResourceQuotaExceeded.SecurityGroupNumThe quota of %s is exceeded for resource %s, usage %s/%s.-
400OperationDenied.SecurityGroupNotSupportThe operation is not allowed because of %s.-
400OperationDenied.LbAssociatedAclCanNotJoinSecurityGroupThe operation is not allowed because of loadBalancer associated acl can not join security group.This operation is not allowed because the listener under the Server Load Balancer instance has been bound to an access control policy. You are not allowed to join the security group again.
404ResourceNotFound.LoadBalancerThe specified resource %s is not found.The specified resource %s is not found.
404ResourceNotFound.SecurityGroupThe specified resource %s is not found.-

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

Change history

Change timeSummary of changesOperation
2024-06-18The Error code has changedView Change Details