Adds a service resource to an endpoint service.
Operation description
Before you add a service resource to an endpoint service, ensure that the endpoint service is in the Active state. Call the GetVpcEndpointServiceAttribute operation to query the status of the endpoint service.
The AttachResourceToVpcEndpointService operation does not support concurrently adding service resources to the same endpoint service instance.
Try it now
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
privatelink:AttachResourceToVpcEndpointService | update | *VpcEndpointService
LoadBalancer
LoadBalancer
LoadBalancer
*NatGateway
| None | None |
Request parameters
Parameter | Type | Required | Description | Example |
RegionId | string | Yes | The ID of the region where the endpoint service is deployed. Call the DescribeRegions operation to obtain the region ID. | cn-hangzhou |
ResourceType | string | Yes | The type of the service resource. Valid values:
| slb |
ResourceId | string | Yes | The ID of the service resource. | lb-hp32z1wp5peaoox2q**** |
ZoneId | string | No | The zone where the service resource is located. This parameter is required if the service resource is an ALB, NLB, or GWLB instance. | cn-hangzhou-j |
ServiceId | string | Yes | The endpoint service to which you want to add the service resource. | epsrv-hp3vpx8yqxblby3i**** |
DryRun | boolean | No | Specifies whether to perform a dry run. Valid values:
| false |
ClientToken | string | No | 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 ClientToken can contain only ASCII characters. | 0c593ea1-3bea-11e9-b96b-88e9fe637760 |
RegionId | string | Yes | The ID of the region where the endpoint service is deployed. Call the DescribeRegions operation to obtain the region ID. | cn-hangzhou |
Response elements
Element | Type | Description | Example |
object | |||
RequestId | string | The request ID. | 0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
Examples
Success response
JSON format
{
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}Error codes
HTTP status code | Error code | Error message | Description |
400 | EndpointServiceNotFound | The specified Service does not exist. | The specified Service does not exist. |
400 | EndpointServiceOperationDenied | The specified operation of endpoint service is not allowed. | The specified operation of endpoint service is not allowed. |
400 | EndpointServiceResourceExist | The specified resource already exists. | The specified resource already exists. |
400 | LoadBalancerNotFound | The specified load balancer does not exist. | The specified Alb does not exist. |
400 | LoadBalancerNotSupportPrivateLink | The specified SLB does not support PrivateLink. | The specified SLB does not support PrivateLink. |
400 | AlbNotFound | The specified Alb does not exist. | The specified Alb does not exist. |
400 | EndpointServiceResourceTypeNotSupport | The specified resource type is not supported. | The specified resource type is not supported. |
400 | QuotaMisMatched | The resource you applied for has exceeded the quota. | The resource you applied for has exceeded the quota. |
400 | VSwitchNotFound | The specified VSwitch does not exist. | |
400 | ResourceNotFound.NatGateway | The specified resource %s is not found. | |
400 | Mismatch.ResourceType | The %s is mismatched for %s and %s. | The %s is mismatched for %s and %s. |
400 | EndpointServiceNotSupportedZone | The specified endpoint service does not support the zone. | The specified endpoint service does not support the zone. |
400 | ServiceResourceNotSupportIpv6 | The resource is not support ipv6. | The endpoint service does not support IPv6. |
400 | EndpointServiceResourceTypeNotEqual | the service resource type not equal request type. | |
400 | OperationDenied.ServiceResourceIpVersionMismatch | The endpoint service and service resource AddressIpVersion do not match. | The endpoint service and service resource AddressIpVersion do not match. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.