UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

80 lines 3.18 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getSubnetsOutput = exports.getSubnets = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Use this data source to get a list of VPC subnet. * * ## Example Usage * * An example filter by name and tag * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const subnet = huaweicloud.Vpc.getSubnets({ * name: _var.subnet_name, * tags: { * foo: "bar", * }, * }); * export const subnetVpcIds = [subnet.then(subnet => subnet.subnets)].map(__item => __item?.vpcId); * ``` * ## **Attributes Reference** * * The following attributes are exported: * * * `id` - Indicates a data source ID. * * `subnets` - Indicates a list of all subnets found. Structure is documented below. * * The `subnets` block supports: * * * `id` - Indicates the ID of the subnet. * * `name` - Indicates the name of the subnet. * * `description` - Indicates the description of the subnet. * * `cidr` - Indicates the cidr block of the subnet. * * `status` - Indicates the current status of the subnet. * * `vpcId` - Indicates the Id of the VPC that the subnet belongs to. * * `gatewayIp` - Indicates the subnet gateway address of the subnet. * * `primaryDns` - Indicates the IP address of DNS server 1 on the subnet. * * `secondaryDns` - Indicates the IP address of DNS server 2 on the subnet. * * `availabilityZone` - Indicates the availability zone (AZ) to which the subnet belongs to. * * `dhcpEnable` - Indicates whether the DHCP is enabled. * * `dnsList` - Indicates The IP address list of DNS servers on the subnet. * * `ipv4SubnetId` - Indicates the ID of the IPv4 subnet (Native OpenStack API). * * `ipv6Enable` - Indicates whether the IPv6 is enabled. * * `ipv6SubnetId` - Indicates the ID of the IPv6 subnet (Native OpenStack API). * * `ipv6Cidr` - Indicates the IPv6 subnet CIDR block. * * `ipv6Gateway` - Indicates the IPv6 subnet gateway. * * `tags` - Indicates the key/value pairs which associated with the subnet. */ function getSubnets(args, opts) { args = args || {}; if (!opts) { opts = {}; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("huaweicloud:Vpc/getSubnets:getSubnets", { "availabilityZone": args.availabilityZone, "cidr": args.cidr, "gatewayIp": args.gatewayIp, "id": args.id, "name": args.name, "primaryDns": args.primaryDns, "region": args.region, "secondaryDns": args.secondaryDns, "status": args.status, "tags": args.tags, "vpcId": args.vpcId, }, opts); } exports.getSubnets = getSubnets; function getSubnetsOutput(args, opts) { return pulumi.output(args).apply(a => getSubnets(a, opts)); } exports.getSubnetsOutput = getSubnetsOutput; //# sourceMappingURL=getSubnets.js.map