All Products
Search
Document Center

Virtual Private Cloud:DescribeVpcAttribute

Last Updated:Oct 19, 2026

Queries the configuration of a specified VPC.

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

vpc:DescribeVpcAttribute

get

*VPC

acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}

  • vpc:tag
None

Request parameters

Parameter

Type

Required

Description

Example

VpcId

string

Yes

The ID of the VPC.

vpc-bp18sth14qii3pnv****

RegionId

string

Yes

The region ID of the VPC.

You can call the DescribeRegions operation to query the region ID.

cn-hangzhou

DryRun

boolean

No

Specifies whether to perform only a dry run for this request. Valid values:

  • true: sends a dry run request without querying the resource status. The system checks whether the AccessKey pair is valid, whether the Resource Access Management (RAM) user has the required authorization, and whether required parameters are specified. If the dry run fails, the corresponding error is returned. If the dry run succeeds, the DryRunOperation error code is returned.

  • false (default): sends a normal request. If the request passes the dry run, a 2xx HTTP status code is returned and the resource status is queried.

false

IsDefault

boolean

No

Specifies whether the VPC is the default VPC. Valid values:

  • false (default): The VPC is not the default VPC.

  • true: The VPC is the default VPC.

false

Response elements

Element

Type

Description

Example

object

The creation time of the VPC.

CreationTime

string

The time when the VPC was created. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format.

2021-10-16T07:31:09Z

Status

string

The status of the VPC. Valid values:

  • Available: The VPC is available.

  • Pending: The VPC is being configured.

Available

VpcId

string

The ID of the VPC.

vpc-bp18sth14qii3pnvo****

IsDefault

boolean

Indicates whether the VPC is the default VPC. Valid values:

  • true: The VPC is the default VPC.

  • false (default): The VPC is not the default VPC.

false

ClassicLinkEnabled deprecated

boolean

Indicates whether the ClassicLink feature is enabled. Valid values:

  • true: The ClassicLink feature is enabled.

  • false (default): The ClassicLink feature is disabled.

false

OwnerId

integer

The ID of the account to which the VPC belongs.

28311773240248****

RegionId

string

The region ID of the VPC.

cn-hangzhou

VpcName

string

The name of the VPC.

doctest2

VRouterId

string

The ID of the vRouter of the VPC.

vrt-bp1jso6ng1at0ajsc****

DhcpOptionsSetStatus

string

The status of the DHCP options set. Valid values:

  • Available: The DHCP options set is available.

  • InUse: The DHCP options set is in use.

  • Deleted: The DHCP options set is deleted.

  • Pending: The DHCP options set is being configured.

Available

CidrBlock

string

The IPv4 CIDR block of the VPC.

192.168.0.0/16

RequestId

string

The request ID.

7486AE4A-129D-43DB-A714-2432C074BA04

Description

string

The description of the VPC.

VPC

ResourceGroupId

string

The ID of the resource group.

rg-acfmxazbvgb4ph****

DhcpOptionsSetId

string

The ID of the DHCP options set.

dopt-o6w0df4epg9zo8isy****

Ipv6CidrBlock

string

The IPv6 CIDR block of the VPC.

2408:XXXX:0:a600::/56

VSwitchIds

object

VSwitchId

array

The list of vSwitches in the VPC.

string

The list of vSwitches in the VPC.

{"VSwitchId": [ "vsw-bp14cagpfysr29feg****" ]}

UserCidrs

object

UserCidr

array

The CIDR blocks of the user-side network. If multiple CIDR blocks are defined, they are separated by commas (,) in the response. A maximum of three CIDR blocks are supported.

string

The CIDR blocks of the user-side network. If multiple CIDR blocks are defined, they are separated by commas (,) in the response. A maximum of three CIDR blocks are supported.

172.16.0.1/24

SecondaryCidrBlocks

object

SecondaryCidrBlock

array

The secondary IPv4 CIDR blocks of the VPC.

string

The secondary IPv4 CIDR blocks of the VPC.

192.168.0.0/16

AssociatedCens

object

AssociatedCen

array<object>

The list of associated Cloud Enterprise Network (CEN) instances.

If the VPC is not associated with a CEN instance, this parameter is not returned.

object

The ID of the account to which the CEN instance belongs.

CenOwnerId

integer

The ID of the account to which the CEN instance belongs.

28311773240248****

CenId

string

The instance ID of the CEN instance attached to the VPC.

cen-7qthudw0ll6jmc****

CenStatus

string

The status of the VPC associated with the CEN instance.

This parameter returns Attached only when the VPC is associated with a CEN instance.

Attached

CloudResources

object

CloudResourceSetType

array<object>

The list of resources in the VPC.

object

The resource count in the VPC.

ResourceCount

integer

The resource count in the VPC.

1

ResourceType

string

The type of resource in the VPC. Valid values:

  • VSwitch: vSwitch.

  • VRouter: vRouter.

  • RouteTable: Route table.

VSwitch

Ipv6CidrBlocks

object

Ipv6CidrBlock

array<object>

The IPv6 CIDR block information of the VPC.

object

The IPv6 CIDR block information of the VPC.

Ipv6Isp

string

The ISP type of the IPv6 CIDR block of the VPC. Valid values:

  • BGP (default): Alibaba Cloud BGP IPv6.

  • ChinaMobile: China Mobile (single line).

  • ChinaUnicom: China Unicom (single line).

  • ChinaTelecom: China Telecom (single line).

Note

If you are added to the whitelist for single-line bandwidth, you can set this parameter to ChinaTelecom, ChinaUnicom, or ChinaMobile.

BGP

Ipv6CidrBlock

string

The IPv6 CIDR block of the VPC.

2408:XXXX:0:6a::/56

SupportIpv4Gateway

boolean

Indicates whether the VPC operates in the centralized control mode with the IPv4 gateway. Valid values:

  • true: The VPC operates in the centralized control mode with the IPv4 gateway. Internet traffic is centrally managed by the IPv4 gateway (the IPv4 gateway is activated after it is created and routes are configured), or the VPC is a private network-only VPC (the IPv4 gateway is deleted in private mode).

  • false: Direct Internet Access mode.

Note

For more information, see IPv4 gateway.

true

Ipv4GatewayId

string

The instance ID of the IPv4 gateway.

ipv4gw-5tsnc6s4ogsedtp3k****

Tags

object

Tag

array<object>

The list of tags.

object

The list of tags.

Key

string

The tag key.

FinanceDept

Value

string

The tag value.

FinanceJoshua

AssociatedPropagationSources

object

AssociatedPropagationSources

array<object>

The route propagation sources associated with the VPC.

object

SourceType

string

The type of the propagation source. Valid values:

  • CEN: Cloud Enterprise Network (CEN).

  • VPN: VPN gateway.

  • TR: Transit router (TR).

  • ECR: Express Connect Router (ECR).

CEN

SourceOwnerId

integer

The ID of the account to which the propagation source belongs.

153980532164****

SourceInstanceId

string

The instance ID of the propagation source.

cen-dc4vwznpwbobrl****

Status

string

The association status. Valid values:

  • Attaching: The resource is being associated.

  • Attached: The resource is associated.

  • Detaching: The resource is being disassociated.

Attaching

RoutePropagated

boolean

Indicates whether routes are propagated to the VPC.

true

EnabledIpv6

boolean

Indicates whether IPv6 is enabled.

Valid values:

  • false :

    false

  • true :

    true

false

DnsHostnameStatus

string

Indicates whether the DNS hostname feature is enabled.

DISABLED

Examples

Success response

JSON format

{
  "CreationTime": "2021-10-16T07:31:09Z",
  "Status": "Available",
  "VpcId": "vpc-bp18sth14qii3pnvo****",
  "IsDefault": false,
  "ClassicLinkEnabled": false,
  "OwnerId": 0,
  "RegionId": "cn-hangzhou",
  "VpcName": "doctest2",
  "VRouterId": "vrt-bp1jso6ng1at0ajsc****",
  "DhcpOptionsSetStatus": "Available",
  "CidrBlock": "192.168.0.0/16",
  "RequestId": "7486AE4A-129D-43DB-A714-2432C074BA04",
  "Description": "VPC",
  "ResourceGroupId": "rg-acfmxazbvgb4ph****",
  "DhcpOptionsSetId": "dopt-o6w0df4epg9zo8isy****",
  "Ipv6CidrBlock": "2408:XXXX:0:a600::/56",
  "VSwitchIds": {
    "VSwitchId": [
      "{\"VSwitchId\": [ \"vsw-bp14cagpfysr29feg****\" ]}"
    ]
  },
  "UserCidrs": {
    "UserCidr": [
      "172.16.0.1/24"
    ]
  },
  "SecondaryCidrBlocks": {
    "SecondaryCidrBlock": [
      "192.168.0.0/16"
    ]
  },
  "AssociatedCens": {
    "AssociatedCen": [
      {
        "CenOwnerId": 0,
        "CenId": "cen-7qthudw0ll6jmc****",
        "CenStatus": "Attached"
      }
    ]
  },
  "CloudResources": {
    "CloudResourceSetType": [
      {
        "ResourceCount": 1,
        "ResourceType": "VSwitch"
      }
    ]
  },
  "Ipv6CidrBlocks": {
    "Ipv6CidrBlock": [
      {
        "Ipv6Isp": "BGP",
        "Ipv6CidrBlock": "2408:XXXX:0:6a::/56"
      }
    ]
  },
  "SupportIpv4Gateway": true,
  "Ipv4GatewayId": "ipv4gw-5tsnc6s4ogsedtp3k****",
  "Tags": {
    "Tag": [
      {
        "Key": "FinanceDept",
        "Value": "FinanceJoshua"
      }
    ]
  },
  "AssociatedPropagationSources": {
    "AssociatedPropagationSources": [
      {
        "SourceType": "CEN",
        "SourceOwnerId": 0,
        "SourceInstanceId": "cen-dc4vwznpwbobrl****",
        "Status": "Attaching",
        "RoutePropagated": true
      }
    ]
  },
  "EnabledIpv6": false,
  "DnsHostnameStatus": "DISABLED"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IncorrectVpcStatus Current VPC status does not support this operation.
400 Forbidden.VpcNotFound Specified VPC does not exist.
500 InternalError The request processing has failed due to some unknown error.
404 InvalidVpcId.NotFound Specified VPC does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.