get Prefix List
Deprecated
aws.getPrefixList has been deprecated in favor of aws.ec2.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
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.VpcEndpoint;
import com.pulumi.aws.ec2.VpcEndpointArgs;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetPrefixListArgs;
import com.pulumi.aws.ec2.NetworkAcl;
import com.pulumi.aws.ec2.NetworkAclArgs;
import com.pulumi.aws.ec2.NetworkAclRule;
import com.pulumi.aws.ec2.NetworkAclRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var privateS3VpcEndpoint = new VpcEndpoint("privateS3VpcEndpoint", VpcEndpointArgs.builder()
.vpcId(aws_vpc.foo().id())
.serviceName("com.amazonaws.us-west-2.s3")
.build());
final var privateS3PrefixList = Ec2Functions.getPrefixList(GetPrefixListArgs.builder()
.prefixListId(privateS3VpcEndpoint.prefixListId())
.build());
var bar = new NetworkAcl("bar", NetworkAclArgs.builder()
.vpcId(aws_vpc.foo().id())
.build());
var privateS3NetworkAclRule = new NetworkAclRule("privateS3NetworkAclRule", NetworkAclRuleArgs.builder()
.networkAclId(bar.id())
.ruleNumber(200)
.egress(false)
.protocol("tcp")
.ruleAction("allow")
.cidrBlock(privateS3PrefixList.applyValue(getPrefixListResult -> getPrefixListResult).applyValue(privateS3PrefixList -> privateS3PrefixList.applyValue(getPrefixListResult -> getPrefixListResult.cidrBlocks()[0])))
.fromPort(443)
.toPort(443)
.build());
}
}
Filter
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetPrefixListArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var test = Ec2Functions.getPrefixList(GetPrefixListArgs.builder()
.filters(GetPrefixListFilterArgs.builder()
.name("prefix-list-id")
.values("pl-68a54001")
.build())
.build());
}
}
Return
A collection of values returned by getPrefixList.
Parameters
A collection of arguments for invoking getPrefixList.
Deprecated
aws.getPrefixList has been deprecated in favor of aws.ec2.getPrefixList
Return
A collection of values returned by getPrefixList.
Parameters
Configuration block(s) for filtering. Detailed below.
Name of the prefix list to select.
ID of the prefix list to select.
See also
Deprecated
aws.getPrefixList has been deprecated in favor of aws.ec2.getPrefixList
Return
A collection of values returned by getPrefixList.
Parameters
Builder for com.pulumi.aws.kotlin.inputs.GetPrefixListPlainArgs.