Try AWS Native preview for resources not in the classic version.
aws.ec2.getManagedPrefixList
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
aws.ec2.ManagedPrefixList
provides details about a specific AWS prefix list or
customer-managed prefix list in the current region.
Example Usage
Find the regional DynamoDB prefix list
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.getRegion({});
const example = current.then(current => aws.ec2.getManagedPrefixList({
name: `com.amazonaws.${current.name}.dynamodb`,
}));
import pulumi
import pulumi_aws as aws
current = aws.get_region()
example = aws.ec2.get_managed_prefix_list(name=f"com.amazonaws.{current.name}.dynamodb")
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := aws.GetRegion(ctx, nil, nil)
if err != nil {
return err
}
_, err = ec2.LookupManagedPrefixList(ctx, &ec2.LookupManagedPrefixListArgs{
Name: pulumi.StringRef(fmt.Sprintf("com.amazonaws.%v.dynamodb", current.Name)),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var current = Aws.GetRegion.Invoke();
var example = Aws.Ec2.GetManagedPrefixList.Invoke(new()
{
Name = $"com.amazonaws.{current.Apply(getRegionResult => getRegionResult.Name)}.dynamodb",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetRegionArgs;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetManagedPrefixListArgs;
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 current = AwsFunctions.getRegion();
final var example = Ec2Functions.getManagedPrefixList(GetManagedPrefixListArgs.builder()
.name(String.format("com.amazonaws.%s.dynamodb", current.applyValue(getRegionResult -> getRegionResult.name())))
.build());
}
}
variables:
current:
fn::invoke:
Function: aws:getRegion
Arguments: {}
example:
fn::invoke:
Function: aws:ec2:getManagedPrefixList
Arguments:
name: com.amazonaws.${current.name}.dynamodb
Find a managed prefix list using filters
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ec2.getManagedPrefixList({
filters: [{
name: "prefix-list-name",
values: ["my-prefix-list"],
}],
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.get_managed_prefix_list(filters=[{
"name": "prefix-list-name",
"values": ["my-prefix-list"],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.LookupManagedPrefixList(ctx, &ec2.LookupManagedPrefixListArgs{
Filters: []ec2.GetManagedPrefixListFilter{
{
Name: "prefix-list-name",
Values: []string{
"my-prefix-list",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.Ec2.GetManagedPrefixList.Invoke(new()
{
Filters = new[]
{
new Aws.Ec2.Inputs.GetManagedPrefixListFilterInputArgs
{
Name = "prefix-list-name",
Values = new[]
{
"my-prefix-list",
},
},
},
});
});
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.GetManagedPrefixListArgs;
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 example = Ec2Functions.getManagedPrefixList(GetManagedPrefixListArgs.builder()
.filters(GetManagedPrefixListFilterArgs.builder()
.name("prefix-list-name")
.values("my-prefix-list")
.build())
.build());
}
}
variables:
example:
fn::invoke:
Function: aws:ec2:getManagedPrefixList
Arguments:
filters:
- name: prefix-list-name
values:
- my-prefix-list
Using getManagedPrefixList
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getManagedPrefixList(args: GetManagedPrefixListArgs, opts?: InvokeOptions): Promise<GetManagedPrefixListResult>
function getManagedPrefixListOutput(args: GetManagedPrefixListOutputArgs, opts?: InvokeOptions): Output<GetManagedPrefixListResult>
def get_managed_prefix_list(filters: Optional[Sequence[GetManagedPrefixListFilter]] = None,
id: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetManagedPrefixListResult
def get_managed_prefix_list_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetManagedPrefixListFilterArgs]]]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetManagedPrefixListResult]
func LookupManagedPrefixList(ctx *Context, args *LookupManagedPrefixListArgs, opts ...InvokeOption) (*LookupManagedPrefixListResult, error)
func LookupManagedPrefixListOutput(ctx *Context, args *LookupManagedPrefixListOutputArgs, opts ...InvokeOption) LookupManagedPrefixListResultOutput
> Note: This function is named LookupManagedPrefixList
in the Go SDK.
public static class GetManagedPrefixList
{
public static Task<GetManagedPrefixListResult> InvokeAsync(GetManagedPrefixListArgs args, InvokeOptions? opts = null)
public static Output<GetManagedPrefixListResult> Invoke(GetManagedPrefixListInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetManagedPrefixListResult> getManagedPrefixList(GetManagedPrefixListArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ec2/getManagedPrefixList:getManagedPrefixList
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Get
Managed Prefix List Filter> - Configuration block(s) for filtering. Detailed below.
- Id string
- ID of the prefix list to select.
- Name string
- Name of the prefix list to select.
- Dictionary<string, string>
- Map of tags assigned to the resource.
- Filters
[]Get
Managed Prefix List Filter - Configuration block(s) for filtering. Detailed below.
- Id string
- ID of the prefix list to select.
- Name string
- Name of the prefix list to select.
- map[string]string
- Map of tags assigned to the resource.
- filters
List<Get
Managed Prefix List Filter> - Configuration block(s) for filtering. Detailed below.
- id String
- ID of the prefix list to select.
- name String
- Name of the prefix list to select.
- Map<String,String>
- Map of tags assigned to the resource.
- filters
Get
Managed Prefix List Filter[] - Configuration block(s) for filtering. Detailed below.
- id string
- ID of the prefix list to select.
- name string
- Name of the prefix list to select.
- {[key: string]: string}
- Map of tags assigned to the resource.
- filters
Sequence[Get
Managed Prefix List Filter] - Configuration block(s) for filtering. Detailed below.
- id str
- ID of the prefix list to select.
- name str
- Name of the prefix list to select.
- Mapping[str, str]
- Map of tags assigned to the resource.
- filters List<Property Map>
- Configuration block(s) for filtering. Detailed below.
- id String
- ID of the prefix list to select.
- name String
- Name of the prefix list to select.
- Map<String>
- Map of tags assigned to the resource.
getManagedPrefixList Result
The following output properties are available:
- Address
Family string - Address family of the prefix list. Valid values are
IPv4
andIPv6
. - Arn string
- ARN of the selected prefix list.
- Entries
List<Get
Managed Prefix List Entry> - Set of entries in this prefix list. Each entry is an object with
cidr
anddescription
. - Id string
- ID of the selected prefix list.
- Max
Entries int - When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
- Name string
- Name of the selected prefix list.
- Owner
Id string - Account ID of the owner of a customer-managed prefix list, or
AWS
otherwise. - Dictionary<string, string>
- Map of tags assigned to the resource.
- Version int
- Filters
List<Get
Managed Prefix List Filter>
- Address
Family string - Address family of the prefix list. Valid values are
IPv4
andIPv6
. - Arn string
- ARN of the selected prefix list.
- Entries
[]Get
Managed Prefix List Entry Type - Set of entries in this prefix list. Each entry is an object with
cidr
anddescription
. - Id string
- ID of the selected prefix list.
- Max
Entries int - When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
- Name string
- Name of the selected prefix list.
- Owner
Id string - Account ID of the owner of a customer-managed prefix list, or
AWS
otherwise. - map[string]string
- Map of tags assigned to the resource.
- Version int
- Filters
[]Get
Managed Prefix List Filter
- address
Family String - Address family of the prefix list. Valid values are
IPv4
andIPv6
. - arn String
- ARN of the selected prefix list.
- entries
List<Get
Managed Prefix List Entry> - Set of entries in this prefix list. Each entry is an object with
cidr
anddescription
. - id String
- ID of the selected prefix list.
- max
Entries Integer - When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
- name String
- Name of the selected prefix list.
- owner
Id String - Account ID of the owner of a customer-managed prefix list, or
AWS
otherwise. - Map<String,String>
- Map of tags assigned to the resource.
- version Integer
- filters
List<Get
Managed Prefix List Filter>
- address
Family string - Address family of the prefix list. Valid values are
IPv4
andIPv6
. - arn string
- ARN of the selected prefix list.
- entries
Get
Managed Prefix List Entry[] - Set of entries in this prefix list. Each entry is an object with
cidr
anddescription
. - id string
- ID of the selected prefix list.
- max
Entries number - When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
- name string
- Name of the selected prefix list.
- owner
Id string - Account ID of the owner of a customer-managed prefix list, or
AWS
otherwise. - {[key: string]: string}
- Map of tags assigned to the resource.
- version number
- filters
Get
Managed Prefix List Filter[]
- address_
family str - Address family of the prefix list. Valid values are
IPv4
andIPv6
. - arn str
- ARN of the selected prefix list.
- entries
Sequence[Get
Managed Prefix List Entry] - Set of entries in this prefix list. Each entry is an object with
cidr
anddescription
. - id str
- ID of the selected prefix list.
- max_
entries int - When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
- name str
- Name of the selected prefix list.
- owner_
id str - Account ID of the owner of a customer-managed prefix list, or
AWS
otherwise. - Mapping[str, str]
- Map of tags assigned to the resource.
- version int
- filters
Sequence[Get
Managed Prefix List Filter]
- address
Family String - Address family of the prefix list. Valid values are
IPv4
andIPv6
. - arn String
- ARN of the selected prefix list.
- entries List<Property Map>
- Set of entries in this prefix list. Each entry is an object with
cidr
anddescription
. - id String
- ID of the selected prefix list.
- max
Entries Number - When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
- name String
- Name of the selected prefix list.
- owner
Id String - Account ID of the owner of a customer-managed prefix list, or
AWS
otherwise. - Map<String>
- Map of tags assigned to the resource.
- version Number
- filters List<Property Map>
Supporting Types
GetManagedPrefixListEntry
- Cidr string
- Description string
- Cidr string
- Description string
- cidr String
- description String
- cidr string
- description string
- cidr str
- description str
- cidr String
- description String
GetManagedPrefixListFilter
- Name string
- Name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
- Values List<string>
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- Name string
- Name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
- Values []string
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name String
- Name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
- values List<String>
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name string
- Name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
- values string[]
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name str
- Name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
- values Sequence[str]
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name String
- Name of the filter field. Valid values can be found in the EC2 DescribeManagedPrefixLists API Reference.
- values List<String>
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.