@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
132 lines • 4.42 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPrefixListOutput = exports.getPrefixList = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* `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"],
* }],
* });
* ```
*/
function getPrefixList(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:ec2/getPrefixList:getPrefixList", {
"filters": args.filters,
"name": args.name,
"prefixListId": args.prefixListId,
"region": args.region,
}, opts);
}
exports.getPrefixList = getPrefixList;
/**
* `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"],
* }],
* });
* ```
*/
function getPrefixListOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("aws:ec2/getPrefixList:getPrefixList", {
"filters": args.filters,
"name": args.name,
"prefixListId": args.prefixListId,
"region": args.region,
}, opts);
}
exports.getPrefixListOutput = getPrefixListOutput;
//# sourceMappingURL=getPrefixList.js.map