DATASOURCE::VPC::Vpc

Updated at: 2025-02-05 07:27

DATASOURCE::VPC::Vpc is used to query the information about a virtual private cloud (VPC).

Syntax

{
  "Type": "DATASOURCE::VPC::Vpc",
  "Properties": {
    "VpcId": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Property

Type

Required

Editable

Description

Constraint

VpcId

String

Yes

Yes

The VPC ID.

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

  • IsDefault: indicates whether the default VPC in the specified region is queried.

  • Description: the description of the VPC.

  • ClassicLinkEnabled: the ClassicLink state of the VPC.

  • ResourceGroupId: the ID of the resource group to which the VPC belongs.

  • SecondaryCidrBlocks: the information about the secondary CIDR blocks.

  • VSwitchIds: the information about vSwitches in the VPC.

  • CreateTime: the time when the VPC was created.

  • RouterId: the router ID of the VPC.

  • CidrBlock: the IPv4 CIDR block of the VPC.

  • UserCidrs: the user CIDR blocks of the VPC.

  • DhcpOptionsSetId: the ID of the Dynamic Host Configuration Protocol (DHCP) options set.

  • VpcId: the VPC ID.

  • VpcName: the VPC name.

  • Ipv6CidrBlock: the IPv6 CIDR block of the VPC.

  • Ipv6CidrBlocks: the information about IPv6 CIDR blocks of the VPC.

  • Tags: the information about tags that are added to the VPC.

Examples

YAML
JSON
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      en: The ID of the VPC.
    Required: true
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::VPC::Vpc
    Properties:
      VpcId:
        Ref: VpcId
Outputs:
  IsDefault:
    Description: |-
      Indicates whether to query the default VPC in the specified region. Valid values: 
      - true (default): All VPCs in the specified region are queried.
      - false: The default VPC is not queried.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - IsDefault
  Description:
    Description: The description of the VPC.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Description
  ClassicLinkEnabled:
    Description: status of vpc  ClassicLink..
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ClassicLinkEnabled
  ResourceGroupId:
    Description: The ID of the resource group to which the VPC belongs.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ResourceGroupId
  SecondaryCidrBlocks:
    Description: Additional network segment information.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - SecondaryCidrBlocks
  VSwitchIds:
    Description: A list of VSwitches in the VPC.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - VSwitchIds
  CreateTime:
    Description: The time at which the VPC was created.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - CreateTime
  RouterId:
    Description: The ID of the VRouter.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - RouterId
  CidrBlock:
    Description: The IPv4 CIDR block of the VPC.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - CidrBlock
  UserCidrs:
    Description: A list of user CIDRs.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - UserCidrs
  DhcpOptionsSetId:
    Description: The ID of the DHCP option set.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - DhcpOptionsSetId
  VpcId:
    Description: The ID of the VPC.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - VpcId
  VpcName:
    Description: The name of the VPC.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - VpcName
  Ipv6CidrBlock:
    Description: The ipv6 cidr block of vpc.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Ipv6CidrBlock
  Ipv6CidrBlocks:
    Description: The IPv6 network segment of the VPC.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Ipv6CidrBlocks
  Tags:
    Description: The tags of Vpc.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Tags
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "en": "The ID of the VPC."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::VPC::Vpc",
      "Properties": {
        "VpcId": {
          "Ref": "VpcId"
        }
      }
    }
  },
  "Outputs": {
    "IsDefault": {
      "Description": "Indicates whether to query the default VPC in the specified region. Valid values: \n- true (default): All VPCs in the specified region are queried.\n- false: The default VPC is not queried.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "IsDefault"
        ]
      }
    },
    "Description": {
      "Description": "The description of the VPC.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Description"
        ]
      }
    },
    "ClassicLinkEnabled": {
      "Description": "status of vpc  ClassicLink..",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ClassicLinkEnabled"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The ID of the resource group to which the VPC belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ResourceGroupId"
        ]
      }
    },
    "SecondaryCidrBlocks": {
      "Description": "Additional network segment information.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "SecondaryCidrBlocks"
        ]
      }
    },
    "VSwitchIds": {
      "Description": "A list of VSwitches in the VPC.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VSwitchIds"
        ]
      }
    },
    "CreateTime": {
      "Description": "The time at which the VPC was created.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CreateTime"
        ]
      }
    },
    "RouterId": {
      "Description": "The ID of the VRouter.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "RouterId"
        ]
      }
    },
    "CidrBlock": {
      "Description": "The IPv4 CIDR block of the VPC.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CidrBlock"
        ]
      }
    },
    "UserCidrs": {
      "Description": "A list of user CIDRs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "UserCidrs"
        ]
      }
    },
    "DhcpOptionsSetId": {
      "Description": "The ID of the DHCP option set.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "DhcpOptionsSetId"
        ]
      }
    },
    "VpcId": {
      "Description": "The ID of the VPC.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VpcId"
        ]
      }
    },
    "VpcName": {
      "Description": "The name of the VPC.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VpcName"
        ]
      }
    },
    "Ipv6CidrBlock": {
      "Description": "The ipv6 cidr block of vpc.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Ipv6CidrBlock"
        ]
      }
    },
    "Ipv6CidrBlocks": {
      "Description": "The IPv6 network segment of the VPC.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Ipv6CidrBlocks"
        ]
      }
    },
    "Tags": {
      "Description": "The tags of Vpc.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Tags"
        ]
      }
    }
  }
}
                        
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      VpcId:
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
        Type: String
        Description:
          en: The ID of the VPC.
        Required: true
    Resources:
      ExtensionDataSource:
        Type: DATASOURCE::VPC::Vpc
        Properties:
          VpcId:
            Ref: VpcId
    Outputs:
      IsDefault:
        Description: |-
          Indicates whether to query the default VPC in the specified region. Valid values: 
          - true (default): All VPCs in the specified region are queried.
          - false: The default VPC is not queried.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - IsDefault
      Description:
        Description: The description of the VPC.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - Description
      ClassicLinkEnabled:
        Description: status of vpc  ClassicLink..
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - ClassicLinkEnabled
      ResourceGroupId:
        Description: The ID of the resource group to which the VPC belongs.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - ResourceGroupId
      SecondaryCidrBlocks:
        Description: Additional network segment information.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - SecondaryCidrBlocks
      VSwitchIds:
        Description: A list of VSwitches in the VPC.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - VSwitchIds
      CreateTime:
        Description: The time at which the VPC was created.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - CreateTime
      RouterId:
        Description: The ID of the VRouter.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - RouterId
      CidrBlock:
        Description: The IPv4 CIDR block of the VPC.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - CidrBlock
      UserCidrs:
        Description: A list of user CIDRs.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - UserCidrs
      DhcpOptionsSetId:
        Description: The ID of the DHCP option set.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - DhcpOptionsSetId
      VpcId:
        Description: The ID of the VPC.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - VpcId
      VpcName:
        Description: The name of the VPC.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - VpcName
      Ipv6CidrBlock:
        Description: The ipv6 cidr block of vpc.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - Ipv6CidrBlock
      Ipv6CidrBlocks:
        Description: The IPv6 network segment of the VPC.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - Ipv6CidrBlocks
      Tags:
        Description: The tags of Vpc.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - Tags
    
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "VpcId": {
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
          "Type": "String",
          "Description": {
            "en": "The ID of the VPC."
          },
          "Required": true
        }
      },
      "Resources": {
        "ExtensionDataSource": {
          "Type": "DATASOURCE::VPC::Vpc",
          "Properties": {
            "VpcId": {
              "Ref": "VpcId"
            }
          }
        }
      },
      "Outputs": {
        "IsDefault": {
          "Description": "Indicates whether to query the default VPC in the specified region. Valid values: \n- true (default): All VPCs in the specified region are queried.\n- false: The default VPC is not queried.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "IsDefault"
            ]
          }
        },
        "Description": {
          "Description": "The description of the VPC.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "Description"
            ]
          }
        },
        "ClassicLinkEnabled": {
          "Description": "status of vpc  ClassicLink..",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "ClassicLinkEnabled"
            ]
          }
        },
        "ResourceGroupId": {
          "Description": "The ID of the resource group to which the VPC belongs.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "ResourceGroupId"
            ]
          }
        },
        "SecondaryCidrBlocks": {
          "Description": "Additional network segment information.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "SecondaryCidrBlocks"
            ]
          }
        },
        "VSwitchIds": {
          "Description": "A list of VSwitches in the VPC.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "VSwitchIds"
            ]
          }
        },
        "CreateTime": {
          "Description": "The time at which the VPC was created.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "CreateTime"
            ]
          }
        },
        "RouterId": {
          "Description": "The ID of the VRouter.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "RouterId"
            ]
          }
        },
        "CidrBlock": {
          "Description": "The IPv4 CIDR block of the VPC.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "CidrBlock"
            ]
          }
        },
        "UserCidrs": {
          "Description": "A list of user CIDRs.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "UserCidrs"
            ]
          }
        },
        "DhcpOptionsSetId": {
          "Description": "The ID of the DHCP option set.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "DhcpOptionsSetId"
            ]
          }
        },
        "VpcId": {
          "Description": "The ID of the VPC.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "VpcId"
            ]
          }
        },
        "VpcName": {
          "Description": "The name of the VPC.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "VpcName"
            ]
          }
        },
        "Ipv6CidrBlock": {
          "Description": "The ipv6 cidr block of vpc.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "Ipv6CidrBlock"
            ]
          }
        },
        "Ipv6CidrBlocks": {
          "Description": "The IPv6 network segment of the VPC.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "Ipv6CidrBlocks"
            ]
          }
        },
        "Tags": {
          "Description": "The tags of Vpc.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "Tags"
            ]
          }
        }
      }
    }
                            
  • On this page (1, T)
  • Syntax
  • Properties
  • Return values
  • Examples
Feedback