@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
156 lines (155 loc) • 7.33 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Use this data source to get the IP addresses from different special IP ranges on Google Cloud Platform.
*
* ## Example Usage
*
* ### Cloud Ranges
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const netblock = gcp.compute.getNetblockIPRanges({});
* export const cidrBlocks = netblock.then(netblock => netblock.cidrBlocks);
* export const cidrBlocksIpv4 = netblock.then(netblock => netblock.cidrBlocksIpv4s);
* export const cidrBlocksIpv6 = netblock.then(netblock => netblock.cidrBlocksIpv6s);
* ```
*
* ### Allow Health Checks
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const legacy_hcs = gcp.compute.getNetblockIPRanges({
* rangeType: "legacy-health-checkers",
* });
* const _default = new gcp.compute.Network("default", {name: "test-network"});
* const allow_hcs = new gcp.compute.Firewall("allow-hcs", {
* name: "allow-hcs",
* network: _default.name,
* allows: [{
* protocol: "tcp",
* ports: ["80"],
* }],
* sourceRanges: legacy_hcs.then(legacy_hcs => legacy_hcs.cidrBlocksIpv4s),
* });
* ```
*/
export declare function getNetblockIPRanges(args?: GetNetblockIPRangesArgs, opts?: pulumi.InvokeOptions): Promise<GetNetblockIPRangesResult>;
/**
* A collection of arguments for invoking getNetblockIPRanges.
*/
export interface GetNetblockIPRangesArgs {
/**
* The type of range for which to provide results.
*
* Defaults to `cloud-netblocks`. The following `rangeType`s are supported:
*
* * `cloud-netblocks` - Corresponds to the IP addresses used for resources on Google Cloud Platform. [More details.](https://cloud.google.com/compute/docs/faq#where_can_i_find_product_name_short_ip_ranges)
*
* * `google-netblocks` - Corresponds to IP addresses used for Google services. [More details.](https://cloud.google.com/compute/docs/faq#where_can_i_find_product_name_short_ip_ranges)
*
* * `restricted-googleapis` - Corresponds to the IP addresses used for Private Google Access only for services that support VPC Service Controls API access. [More details.](https://cloud.google.com/vpc/docs/private-access-options#domain-vips)
*
* * `private-googleapis` - Corresponds to the IP addresses used for Private Google Access for services that do not support VPC Service Controls. [More details.](https://cloud.google.com/vpc/docs/private-access-options#domain-vips)
*
* * `dns-forwarders` - Corresponds to the IP addresses used to originate Cloud DNS outbound forwarding. [More details.](https://cloud.google.com/dns/zones/#creating-forwarding-zones)
*
* * `iap-forwarders` - Corresponds to the IP addresses used for Cloud IAP for TCP forwarding. [More details.](https://cloud.google.com/iap/docs/using-tcp-forwarding)
*
* * `health-checkers` - Corresponds to the IP addresses used for health checking in Cloud Load Balancing. [More details.](https://cloud.google.com/load-balancing/docs/health-checks)
*
* * `legacy-health-checkers` - Corresponds to the IP addresses used for legacy style health checkers (used by Network Load Balancing). [ More details.](https://cloud.google.com/load-balancing/docs/health-checks)
*/
rangeType?: string;
}
/**
* A collection of values returned by getNetblockIPRanges.
*/
export interface GetNetblockIPRangesResult {
/**
* Retrieve list of all CIDR blocks.
*/
readonly cidrBlocks: string[];
/**
* Retrieve list of the IPv4 CIDR blocks
*/
readonly cidrBlocksIpv4s: string[];
/**
* Retrieve list of the IPv6 CIDR blocks, if available.
*/
readonly cidrBlocksIpv6s: string[];
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly rangeType?: string;
}
/**
* Use this data source to get the IP addresses from different special IP ranges on Google Cloud Platform.
*
* ## Example Usage
*
* ### Cloud Ranges
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const netblock = gcp.compute.getNetblockIPRanges({});
* export const cidrBlocks = netblock.then(netblock => netblock.cidrBlocks);
* export const cidrBlocksIpv4 = netblock.then(netblock => netblock.cidrBlocksIpv4s);
* export const cidrBlocksIpv6 = netblock.then(netblock => netblock.cidrBlocksIpv6s);
* ```
*
* ### Allow Health Checks
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const legacy_hcs = gcp.compute.getNetblockIPRanges({
* rangeType: "legacy-health-checkers",
* });
* const _default = new gcp.compute.Network("default", {name: "test-network"});
* const allow_hcs = new gcp.compute.Firewall("allow-hcs", {
* name: "allow-hcs",
* network: _default.name,
* allows: [{
* protocol: "tcp",
* ports: ["80"],
* }],
* sourceRanges: legacy_hcs.then(legacy_hcs => legacy_hcs.cidrBlocksIpv4s),
* });
* ```
*/
export declare function getNetblockIPRangesOutput(args?: GetNetblockIPRangesOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetNetblockIPRangesResult>;
/**
* A collection of arguments for invoking getNetblockIPRanges.
*/
export interface GetNetblockIPRangesOutputArgs {
/**
* The type of range for which to provide results.
*
* Defaults to `cloud-netblocks`. The following `rangeType`s are supported:
*
* * `cloud-netblocks` - Corresponds to the IP addresses used for resources on Google Cloud Platform. [More details.](https://cloud.google.com/compute/docs/faq#where_can_i_find_product_name_short_ip_ranges)
*
* * `google-netblocks` - Corresponds to IP addresses used for Google services. [More details.](https://cloud.google.com/compute/docs/faq#where_can_i_find_product_name_short_ip_ranges)
*
* * `restricted-googleapis` - Corresponds to the IP addresses used for Private Google Access only for services that support VPC Service Controls API access. [More details.](https://cloud.google.com/vpc/docs/private-access-options#domain-vips)
*
* * `private-googleapis` - Corresponds to the IP addresses used for Private Google Access for services that do not support VPC Service Controls. [More details.](https://cloud.google.com/vpc/docs/private-access-options#domain-vips)
*
* * `dns-forwarders` - Corresponds to the IP addresses used to originate Cloud DNS outbound forwarding. [More details.](https://cloud.google.com/dns/zones/#creating-forwarding-zones)
*
* * `iap-forwarders` - Corresponds to the IP addresses used for Cloud IAP for TCP forwarding. [More details.](https://cloud.google.com/iap/docs/using-tcp-forwarding)
*
* * `health-checkers` - Corresponds to the IP addresses used for health checking in Cloud Load Balancing. [More details.](https://cloud.google.com/load-balancing/docs/health-checks)
*
* * `legacy-health-checkers` - Corresponds to the IP addresses used for legacy style health checkers (used by Network Load Balancing). [ More details.](https://cloud.google.com/load-balancing/docs/health-checks)
*/
rangeType?: pulumi.Input<string>;
}