UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

148 lines (147 loc) 5.71 kB
import * as pulumi from "@pulumi/pulumi"; /** * Use this data source to get the IP ranges of various AWS products and services. For more information about the contents of this data source and required JSON syntax if referencing a custom URL, see the [AWS IP Address Ranges documentation](https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const europeanEc2 = aws.getIpRanges({ * regions: [ * "eu-west-1", * "eu-central-1", * ], * services: ["ec2"], * }); * const fromEurope = new aws.ec2.SecurityGroup("from_europe", { * name: "from_europe", * ingress: [{ * fromPort: 443, * toPort: 443, * protocol: "tcp", * cidrBlocks: europeanEc2.then(europeanEc2 => europeanEc2.cidrBlocks), * ipv6CidrBlocks: europeanEc2.then(europeanEc2 => europeanEc2.ipv6CidrBlocks), * }], * tags: { * CreateDate: europeanEc2.then(europeanEc2 => europeanEc2.createDate), * SyncToken: europeanEc2.then(europeanEc2 => europeanEc2.syncToken), * }, * }); * ``` */ export declare function getIpRanges(args: GetIpRangesArgs, opts?: pulumi.InvokeOptions): Promise<GetIpRangesResult>; /** * A collection of arguments for invoking getIpRanges. */ export interface GetIpRangesArgs { id?: string; /** * Filter IP ranges by regions (or include all regions, if * omitted). Valid items are `global` (for `cloudfront`) as well as all AWS regions * (e.g., `eu-central-1`) */ regions?: string[]; /** * Filter IP ranges by services. Valid items are `amazon` * (for amazon.com), `amazonConnect`, `apiGateway`, `cloud9`, `cloudfront`, * `codebuild`, `dynamodb`, `ec2`, `ec2InstanceConnect`, `globalaccelerator`, * `route53`, `route53Healthchecks`, `s3` and `workspacesGateways`. See the * [`service` attribute][2] documentation for other possible values. * * > **NOTE:** If the specified combination of regions and services does not yield any * CIDR blocks, this call will fail. */ services: string[]; /** * Custom URL for source JSON file. Syntax must match [AWS IP Address Ranges documentation](https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html). Defaults to `https://ip-ranges.amazonaws.com/ip-ranges.json`. */ url?: string; } /** * A collection of values returned by getIpRanges. */ export interface GetIpRangesResult { /** * Lexically ordered list of CIDR blocks. */ readonly cidrBlocks: string[]; /** * Publication time of the IP ranges (e.g., `2016-08-03-23-46-05`). */ readonly createDate: string; readonly id: string; /** * Lexically ordered list of IPv6 CIDR blocks. */ readonly ipv6CidrBlocks: string[]; readonly regions?: string[]; readonly services: string[]; /** * Publication time of the IP ranges, in Unix epoch time format * (e.g., `1470267965`). */ readonly syncToken: number; readonly url?: string; } /** * Use this data source to get the IP ranges of various AWS products and services. For more information about the contents of this data source and required JSON syntax if referencing a custom URL, see the [AWS IP Address Ranges documentation](https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const europeanEc2 = aws.getIpRanges({ * regions: [ * "eu-west-1", * "eu-central-1", * ], * services: ["ec2"], * }); * const fromEurope = new aws.ec2.SecurityGroup("from_europe", { * name: "from_europe", * ingress: [{ * fromPort: 443, * toPort: 443, * protocol: "tcp", * cidrBlocks: europeanEc2.then(europeanEc2 => europeanEc2.cidrBlocks), * ipv6CidrBlocks: europeanEc2.then(europeanEc2 => europeanEc2.ipv6CidrBlocks), * }], * tags: { * CreateDate: europeanEc2.then(europeanEc2 => europeanEc2.createDate), * SyncToken: europeanEc2.then(europeanEc2 => europeanEc2.syncToken), * }, * }); * ``` */ export declare function getIpRangesOutput(args: GetIpRangesOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetIpRangesResult>; /** * A collection of arguments for invoking getIpRanges. */ export interface GetIpRangesOutputArgs { id?: pulumi.Input<string>; /** * Filter IP ranges by regions (or include all regions, if * omitted). Valid items are `global` (for `cloudfront`) as well as all AWS regions * (e.g., `eu-central-1`) */ regions?: pulumi.Input<pulumi.Input<string>[]>; /** * Filter IP ranges by services. Valid items are `amazon` * (for amazon.com), `amazonConnect`, `apiGateway`, `cloud9`, `cloudfront`, * `codebuild`, `dynamodb`, `ec2`, `ec2InstanceConnect`, `globalaccelerator`, * `route53`, `route53Healthchecks`, `s3` and `workspacesGateways`. See the * [`service` attribute][2] documentation for other possible values. * * > **NOTE:** If the specified combination of regions and services does not yield any * CIDR blocks, this call will fail. */ services: pulumi.Input<pulumi.Input<string>[]>; /** * Custom URL for source JSON file. Syntax must match [AWS IP Address Ranges documentation](https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html). Defaults to `https://ip-ranges.amazonaws.com/ip-ranges.json`. */ url?: pulumi.Input<string>; }