github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getPublicIpv4Pools.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package ec2 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Data source for getting information about AWS EC2 Public IPv4 Pools. 15 // 16 // ## Example Usage 17 // 18 // ### Basic Usage 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // // Returns all public IPv4 pools. 34 // _, err := ec2.GetPublicIpv4Pools(ctx, nil, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 // 45 // ### Usage with Filter 46 // 47 // <!--Start PulumiCodeChooser --> 48 // ```go 49 // package main 50 // 51 // import ( 52 // 53 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 54 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 55 // 56 // ) 57 // 58 // func main() { 59 // pulumi.Run(func(ctx *pulumi.Context) error { 60 // _, err := ec2.GetPublicIpv4Pools(ctx, &ec2.GetPublicIpv4PoolsArgs{ 61 // Filters: []ec2.GetPublicIpv4PoolsFilter{ 62 // { 63 // Name: "tag-key", 64 // Values: []string{ 65 // "ExampleTagKey", 66 // }, 67 // }, 68 // }, 69 // }, nil) 70 // if err != nil { 71 // return err 72 // } 73 // return nil 74 // }) 75 // } 76 // 77 // ``` 78 // <!--End PulumiCodeChooser --> 79 func GetPublicIpv4Pools(ctx *pulumi.Context, args *GetPublicIpv4PoolsArgs, opts ...pulumi.InvokeOption) (*GetPublicIpv4PoolsResult, error) { 80 opts = internal.PkgInvokeDefaultOpts(opts) 81 var rv GetPublicIpv4PoolsResult 82 err := ctx.Invoke("aws:ec2/getPublicIpv4Pools:getPublicIpv4Pools", args, &rv, opts...) 83 if err != nil { 84 return nil, err 85 } 86 return &rv, nil 87 } 88 89 // A collection of arguments for invoking getPublicIpv4Pools. 90 type GetPublicIpv4PoolsArgs struct { 91 // Custom filter block as described below. 92 Filters []GetPublicIpv4PoolsFilter `pulumi:"filters"` 93 // Map of tags, each pair of which must exactly match a pair on the desired pools. 94 // 95 // More complex filters can be expressed using one or more `filter` sub-blocks, 96 // which take the following arguments: 97 Tags map[string]string `pulumi:"tags"` 98 } 99 100 // A collection of values returned by getPublicIpv4Pools. 101 type GetPublicIpv4PoolsResult struct { 102 Filters []GetPublicIpv4PoolsFilter `pulumi:"filters"` 103 // The provider-assigned unique ID for this managed resource. 104 Id string `pulumi:"id"` 105 // List of all the pool IDs found. 106 PoolIds []string `pulumi:"poolIds"` 107 Tags map[string]string `pulumi:"tags"` 108 } 109 110 func GetPublicIpv4PoolsOutput(ctx *pulumi.Context, args GetPublicIpv4PoolsOutputArgs, opts ...pulumi.InvokeOption) GetPublicIpv4PoolsResultOutput { 111 return pulumi.ToOutputWithContext(context.Background(), args). 112 ApplyT(func(v interface{}) (GetPublicIpv4PoolsResult, error) { 113 args := v.(GetPublicIpv4PoolsArgs) 114 r, err := GetPublicIpv4Pools(ctx, &args, opts...) 115 var s GetPublicIpv4PoolsResult 116 if r != nil { 117 s = *r 118 } 119 return s, err 120 }).(GetPublicIpv4PoolsResultOutput) 121 } 122 123 // A collection of arguments for invoking getPublicIpv4Pools. 124 type GetPublicIpv4PoolsOutputArgs struct { 125 // Custom filter block as described below. 126 Filters GetPublicIpv4PoolsFilterArrayInput `pulumi:"filters"` 127 // Map of tags, each pair of which must exactly match a pair on the desired pools. 128 // 129 // More complex filters can be expressed using one or more `filter` sub-blocks, 130 // which take the following arguments: 131 Tags pulumi.StringMapInput `pulumi:"tags"` 132 } 133 134 func (GetPublicIpv4PoolsOutputArgs) ElementType() reflect.Type { 135 return reflect.TypeOf((*GetPublicIpv4PoolsArgs)(nil)).Elem() 136 } 137 138 // A collection of values returned by getPublicIpv4Pools. 139 type GetPublicIpv4PoolsResultOutput struct{ *pulumi.OutputState } 140 141 func (GetPublicIpv4PoolsResultOutput) ElementType() reflect.Type { 142 return reflect.TypeOf((*GetPublicIpv4PoolsResult)(nil)).Elem() 143 } 144 145 func (o GetPublicIpv4PoolsResultOutput) ToGetPublicIpv4PoolsResultOutput() GetPublicIpv4PoolsResultOutput { 146 return o 147 } 148 149 func (o GetPublicIpv4PoolsResultOutput) ToGetPublicIpv4PoolsResultOutputWithContext(ctx context.Context) GetPublicIpv4PoolsResultOutput { 150 return o 151 } 152 153 func (o GetPublicIpv4PoolsResultOutput) Filters() GetPublicIpv4PoolsFilterArrayOutput { 154 return o.ApplyT(func(v GetPublicIpv4PoolsResult) []GetPublicIpv4PoolsFilter { return v.Filters }).(GetPublicIpv4PoolsFilterArrayOutput) 155 } 156 157 // The provider-assigned unique ID for this managed resource. 158 func (o GetPublicIpv4PoolsResultOutput) Id() pulumi.StringOutput { 159 return o.ApplyT(func(v GetPublicIpv4PoolsResult) string { return v.Id }).(pulumi.StringOutput) 160 } 161 162 // List of all the pool IDs found. 163 func (o GetPublicIpv4PoolsResultOutput) PoolIds() pulumi.StringArrayOutput { 164 return o.ApplyT(func(v GetPublicIpv4PoolsResult) []string { return v.PoolIds }).(pulumi.StringArrayOutput) 165 } 166 167 func (o GetPublicIpv4PoolsResultOutput) Tags() pulumi.StringMapOutput { 168 return o.ApplyT(func(v GetPublicIpv4PoolsResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 169 } 170 171 func init() { 172 pulumi.RegisterOutputType(GetPublicIpv4PoolsResultOutput{}) 173 }