AttachDdosToAccelerator

Updated at:

Invokes the AttachDdosToAccelerator operation to attach an Anti-DDoS Pro or Anti-DDoS Premium instance to a Global Accelerator (GA) instance to protect applications from large-scale DDoS attacks and ensure service stability and availability.

Operation description

When you call this operation, take note of the following items:

  • AttachDdosToAccelerator is an asynchronous operation. After you send a request, the system returns a request ID, but the Anti-DDoS Pro or Anti-DDoS Premium instance is not yet attached to the Global Accelerator (GA) instance. The system is still running the association task in the background. You can call DescribeAccelerator or ListAccelerators to query the status of the GA instance:
    • If the GA instance is in the configuring state, the Anti-DDoS Pro or Anti-DDoS Premium instance is being attached to the GA instance. In this state, you can only perform query operations.

    • If the GA instance is in the active state, the Anti-DDoS Pro or Anti-DDoS Premium instance is attached to the GA instance.

  • You cannot call the AttachDdosToAccelerator operation to concurrently attach Anti-DDoS Pro or Anti-DDoS Premium instances to the same GA instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ga:AttachDdosToAccelerator

update

*Accelerator

acs:ga:{#regionId}:{#accountId}:ga/{#acceleratorId}

None None

Request parameters

Parameter

Type

Required

Description

Example

AcceleratorId

string

Yes

The ID of the Global Accelerator (GA) instance to which you want to attach the Anti-DDoS Pro or Anti-DDoS Premium instance.

ga-bp1odcab8tmno0hdq****

DdosId deprecated

string

No

The ID of the Anti-DDoS Pro or Anti-DDoS Premium instance that you want to attach to the GA instance.

ddoscoo-cn-zz11vq7j****

DdosRegionId deprecated

string

No

The region where the Anti-DDoS Pro or Anti-DDoS Premium instance is deployed. Valid values:

  • cn-hangzhou: the Chinese mainland.

  • ap-southeast-1: outside the Chinese mainland.

cn-hangzhou

RegionId

string

No

The region ID of the GA instance. Set the value to cn-hangzhou.

cn-hangzhou

DdosConfigList

array<object>

No

The list of Anti-DDoS Pro or Anti-DDoS Premium instances to attach to the GA instance.

object

No

The list of Anti-DDoS Pro or Anti-DDoS Premium instances to attach to the GA instance.

DdosId

string

No

The ID of the Anti-DDoS Pro or Anti-DDoS Premium instance to attach to the GA instance.

ddoscoo-cn-zz11vq7j****

DdosRegionId

string

No

The region where the Anti-DDoS Pro or Anti-DDoS Premium instance is deployed. Valid values:

  • cn-hangzhou: the Chinese mainland.

  • ap-southeast-1: outside the Chinese mainland.

cn-hangzhou

DryRun

boolean

No

Specifies whether to only precheck the request. Valid values:

  • true: prechecks the request without attaching the instances. The system checks whether the required parameters are specified, the request format is valid, and the service limits are met. If the request fails the precheck, an error is returned. If the request passes the precheck, an HTTP 2xx status code is returned.

  • false (default): sends the request. If the request passes the precheck, an HTTP 2xx status code is returned and the operation is performed.

true

Response elements

Element

Type

Description

Example

object

The response struct.

DdosId deprecated

string

The ID of the Anti-DDoS Pro or Anti-DDoS Premium instance that is attached to the GA instance.

ddoscoo-cn-zz11vq7j****

GaId

string

The ID of the GA instance to which the Anti-DDoS Pro or Anti-DDoS Premium instance is attached.

ga-bp1odcab8tmno0hdq****

RequestId

string

The request ID.

DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6

Examples

Success response

JSON format

{
  "DdosId": "ddoscoo-cn-zz11vq7j****",
  "GaId": "ga-bp1odcab8tmno0hdq****",
  "RequestId": "DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6"
}

Error codes

HTTP status code

Error code

Error message

Description

400 DdosId.Error Failed to find the DDoS instance based on the DDoS ID. Failed to find the DDoS instance based on the DDoS ID.
400 NoPermission.GaDdosRoleSession You are not authorized to perform the operation. The user does not have permissions to create service linked roles. Contact the Alibaba Cloud account owner or the permission administrator to grant the current user AliyunGlobalAccelerationFullAccess or create custom permission policies for service linked role. The following content describes the detailed information about custom permission policies: ServiceName: ddos.ga.aliyuncs.com. Service linked role name: AliyunServiceRoleForGaAntiDDos. Permission: ram:CreateServiceLinkedRole.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.