DATASOURCE::VPC::Vpcs is used to query the virtual private clouds (VPCs) that you created.

Syntax

{
  "Type": "DATASOURCE::VPC::Vpcs",
  "Properties": {
    "IsDefault": Boolean,
    "DhcpOptionsSetId": String,
    "ResourceGroupId": String,
    "VpcIds": List,
    "VpcName": String,
    "VpcOwnerId": String
  }
}

Properties

Property Type Required Editable Description Constraint
IsDefault Boolean No Yes Specifies whether to query the default VPC in the region where the stack is deployed. Default value: true. Valid values:
  • true
  • false
DhcpOptionsSetId String No Yes The ID of the Dynamic Host Configuration Protocol (DHCP) options set. None.
ResourceGroupId String No Yes The ID of the resource group to which the VPC belongs. None.
VpcIds List No Yes The IDs of VPCs. You can specify up to 20 IDs.
VpcName String No Yes The name of the VPC. None.
VpcOwnerId String No Yes The ID of the Alibaba Cloud account to which the VPC belongs. None.

Return values (Fn::GetAtt)

  • VpcIds: the IDs of the VPCs.
  • Vpcs: details of the VPCs.
Property Type Description Constraint
VpcIds List The IDs of VPCs. Example: ["vpc-bp17er0y7lbw5ovjw****", "vpc-bp1ww1tfitr8bpq23****"].
Vpcs List Details of the VPCs. None.
Status String The status of the VPC. Valid values:
  • Pending: The VPC is being configured.
  • Available: The VPC is available.
VpcId String The ID of the VPC. Example: vpc-bp1qpo0kug3a20qqe****.
IsDefault Boolean Indicates whether the default VPC in the region where the stack is deployed is queried. Valid values:
  • true
  • false
OwnerId String The ID of the Alibaba Cloud account to which the VPC belongs. None.
VpcName String The name of the VPC. None.
VRouterId String The ID of the vRouter that is automatically created by the system after the VPC is created. Example: vrt-bp1jcg5cmxjbl9xgc****.
DhcpOptionsSetStatus String The status of the DHCP options set. Valid values:
  • Available: The DHCP options set is available.
  • InUse: The DHCP options set is being used.
  • Deleted: The DHCP options set is deleted.
  • Pending: The DHCP options set is being configured.
CidrBlock String The IPv4 CIDR block of the VPC. None.
Description String The description of the VPC. None.
ResourceGroupId String The ID of the resource group to which the VPC belongs. Example: rg-bp67acfmxazb4p****.
DhcpOptionsSetId String The ID of the DHCP options set. Example: dopt-o6w0df4epg9zo8isy****.
Ipv6CidrBlock String The IPv6 CIDR block of the VPC. None.
CenStatus String The status of the Cloud Enterprise Network (CEN) instance to which the VPC is attached. The value must be Attached, which indicates that the VPC is attached to a CEN instance.

This property is returned when the VPC is attached to a CEN instance.

Tags List The tags of the VPC. Example:
[{
    "Value": "abc",
    "Key": "test"
}]
Ipv6CidrBlocks List The IPv6 CIDR blocks of the VPC. None.
VSwitchIds List The IDs of vSwitches. Example: [vsw-bp1nhbnpv2blyz8dl****].
SecondaryCidrBlocks List The secondary IPv4 CIDR blocks of the VPC. None.
UserCidrs List The user CIDR blocks of the VPC. Example: [10.0.0.0/8].
NatGatewayIds List The IDs of NAT gateways. Example: [nat-245xxxftwt45bg****].
RouterTableIds List The IDs of route tables. Example: [vtb-bp1krxxzp0c29fmon****].

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "VpcName": {
      "Type": "String",
      "Description": "The name of the VPC.",
      "Default": "TestVpc"
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::VPC::Vpcs",
      "Properties": {
        "VpcName": {
          "Ref": "VpcName"
        }
      }
    }
  },
  "Outputs": {
    "Vpcs": {
      "Description": "The detailed information about the VPCs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Vpcs"
        ]
      }
    },
    "VpcIds": {
      "Description": "The list of The VPC IDs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VpcIds"
        ]
      }
    }
  }
}