UNPKG

@pulumi/aws

Version:

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

178 lines (177 loc) 5.86 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * `aws.ec2.getPrefixList` provides details about a specific AWS prefix list (PL) * in the current region. * * This can be used both to validate a prefix list given in a variable * and to obtain the CIDR blocks (IP address ranges) for the associated * AWS service. The latter may be useful e.g., for adding network ACL * rules. * * The aws.ec2.ManagedPrefixList data source is normally more appropriate to use given it can return customer-managed prefix list info, as well as additional attributes. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const privateS3VpcEndpoint = new aws.ec2.VpcEndpoint("private_s3", { * vpcId: foo.id, * serviceName: "com.amazonaws.us-west-2.s3", * }); * const privateS3 = aws.ec2.getPrefixListOutput({ * prefixListId: privateS3VpcEndpoint.prefixListId, * }); * const bar = new aws.ec2.NetworkAcl("bar", {vpcId: foo.id}); * const privateS3NetworkAclRule = new aws.ec2.NetworkAclRule("private_s3", { * networkAclId: bar.id, * ruleNumber: 200, * egress: false, * protocol: "tcp", * ruleAction: "allow", * cidrBlock: privateS3.apply(privateS3 => privateS3.cidrBlocks?.[0]), * fromPort: 443, * toPort: 443, * }); * ``` * * ### Filter * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = aws.ec2.getPrefixList({ * filters: [{ * name: "prefix-list-id", * values: ["pl-68a54001"], * }], * }); * ``` */ export declare function getPrefixList(args?: GetPrefixListArgs, opts?: pulumi.InvokeOptions): Promise<GetPrefixListResult>; /** * A collection of arguments for invoking getPrefixList. */ export interface GetPrefixListArgs { /** * Configuration block(s) for filtering. Detailed below. * * The arguments of this data source act as filters for querying the available * prefix lists. The given filters must match exactly one prefix list * whose data will be exported as attributes. */ filters?: inputs.ec2.GetPrefixListFilter[]; /** * Name of the prefix list to select. */ name?: string; /** * ID of the prefix list to select. */ prefixListId?: string; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: string; } /** * A collection of values returned by getPrefixList. */ export interface GetPrefixListResult { /** * List of CIDR blocks for the AWS service associated with the prefix list. */ readonly cidrBlocks: string[]; readonly filters?: outputs.ec2.GetPrefixListFilter[]; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * Name of the selected prefix list. */ readonly name: string; readonly prefixListId?: string; readonly region: string; } /** * `aws.ec2.getPrefixList` provides details about a specific AWS prefix list (PL) * in the current region. * * This can be used both to validate a prefix list given in a variable * and to obtain the CIDR blocks (IP address ranges) for the associated * AWS service. The latter may be useful e.g., for adding network ACL * rules. * * The aws.ec2.ManagedPrefixList data source is normally more appropriate to use given it can return customer-managed prefix list info, as well as additional attributes. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const privateS3VpcEndpoint = new aws.ec2.VpcEndpoint("private_s3", { * vpcId: foo.id, * serviceName: "com.amazonaws.us-west-2.s3", * }); * const privateS3 = aws.ec2.getPrefixListOutput({ * prefixListId: privateS3VpcEndpoint.prefixListId, * }); * const bar = new aws.ec2.NetworkAcl("bar", {vpcId: foo.id}); * const privateS3NetworkAclRule = new aws.ec2.NetworkAclRule("private_s3", { * networkAclId: bar.id, * ruleNumber: 200, * egress: false, * protocol: "tcp", * ruleAction: "allow", * cidrBlock: privateS3.apply(privateS3 => privateS3.cidrBlocks?.[0]), * fromPort: 443, * toPort: 443, * }); * ``` * * ### Filter * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test = aws.ec2.getPrefixList({ * filters: [{ * name: "prefix-list-id", * values: ["pl-68a54001"], * }], * }); * ``` */ export declare function getPrefixListOutput(args?: GetPrefixListOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetPrefixListResult>; /** * A collection of arguments for invoking getPrefixList. */ export interface GetPrefixListOutputArgs { /** * Configuration block(s) for filtering. Detailed below. * * The arguments of this data source act as filters for querying the available * prefix lists. The given filters must match exactly one prefix list * whose data will be exported as attributes. */ filters?: pulumi.Input<pulumi.Input<inputs.ec2.GetPrefixListFilterArgs>[]>; /** * Name of the prefix list to select. */ name?: pulumi.Input<string>; /** * ID of the prefix list to select. */ prefixListId?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; }