-
Notifications
You must be signed in to change notification settings - Fork 151
/
getManagedPrefixList.go
114 lines (109 loc) · 3.65 KB
/
getManagedPrefixList.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// `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
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
// "github.com/pulumi/pulumi-aws/sdk/v4/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
// }
// opt0 := fmt.Sprintf("%v%v%v", "com.amazonaws.", current.Name, ".dynamodb")
// _, err = ec2.LookupManagedPrefixList(ctx, &ec2.LookupManagedPrefixListArgs{
// Name: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Find a managed prefix list using filters
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/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{
// ec2.GetManagedPrefixListFilter{
// Name: "prefix-list-name",
// Values: []string{
// "my-prefix-list",
// },
// },
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupManagedPrefixList(ctx *pulumi.Context, args *LookupManagedPrefixListArgs, opts ...pulumi.InvokeOption) (*LookupManagedPrefixListResult, error) {
var rv LookupManagedPrefixListResult
err := ctx.Invoke("aws:ec2/getManagedPrefixList:getManagedPrefixList", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getManagedPrefixList.
type LookupManagedPrefixListArgs struct {
// Configuration block(s) for filtering. Detailed below.
Filters []GetManagedPrefixListFilter `pulumi:"filters"`
// The ID of the prefix list to select.
Id *string `pulumi:"id"`
// The name of the filter field. Valid values can be found in the EC2 [DescribeManagedPrefixLists](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeManagedPrefixLists.html) API Reference.
Name *string `pulumi:"name"`
// A map of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getManagedPrefixList.
type LookupManagedPrefixListResult struct {
// The address family of the prefix list. Valid values are `IPv4` and `IPv6`.
AddressFamily string `pulumi:"addressFamily"`
// The ARN of the selected prefix list.
Arn string `pulumi:"arn"`
// The set of entries in this prefix list. Each entry is an object with `cidr` and `description`.
Entries []GetManagedPrefixListEntry `pulumi:"entries"`
Filters []GetManagedPrefixListFilter `pulumi:"filters"`
// The ID of the selected prefix list.
Id string `pulumi:"id"`
// When then prefix list is managed, the maximum number of entries it supports, or null otherwise.
MaxEntries int `pulumi:"maxEntries"`
// The name of the selected prefix list.
Name string `pulumi:"name"`
// The Account ID of the owner of a customer-managed prefix list, or `AWS` otherwise.
OwnerId string `pulumi:"ownerId"`
// A map of tags assigned to the resource.
Tags map[string]string `pulumi:"tags"`
Version int `pulumi:"version"`
}