DATASOURCE::VPC::Vpcs

Updated at: 2024-12-27 03:47

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

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

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.

Valid values:

  • true (default)

  • 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 VPC name.

None.

VpcOwnerId

String

No

Yes

The ID of the Alibaba Cloud account to which the VPC belongs.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

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 VPC ID.

Example: vpc-bp1qpo0kug3a20qqe****.

IsDefault

Boolean

Indicates whether the VPC is the default VPC in the region.

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-acfmxazb4ph****.

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 Attached is returned. The value indicates that the VPC is attached to a CEN instance.

This property is returned only 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 the 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"
        ]
      }
    }
  }
}
  • On this page (1, T)
  • Syntax
  • Properties
  • Return values (Fn::GetAtt)
  • Examples
Feedback