github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getPublicIpv4Pool.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 // Provides details about a specific AWS EC2 Public IPv4 Pool. 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 // _, err := ec2.GetPublicIpv4Pool(ctx, &ec2.GetPublicIpv4PoolArgs{ 34 // PoolId: "ipv4pool-ec2-000df99cff0c1ec10", 35 // }, nil) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 func GetPublicIpv4Pool(ctx *pulumi.Context, args *GetPublicIpv4PoolArgs, opts ...pulumi.InvokeOption) (*GetPublicIpv4PoolResult, error) { 46 opts = internal.PkgInvokeDefaultOpts(opts) 47 var rv GetPublicIpv4PoolResult 48 err := ctx.Invoke("aws:ec2/getPublicIpv4Pool:getPublicIpv4Pool", args, &rv, opts...) 49 if err != nil { 50 return nil, err 51 } 52 return &rv, nil 53 } 54 55 // A collection of arguments for invoking getPublicIpv4Pool. 56 type GetPublicIpv4PoolArgs struct { 57 // AWS resource IDs of a public IPv4 pool (as a string) for which this data source will fetch detailed information. 58 PoolId string `pulumi:"poolId"` 59 // Any tags for the address pool. 60 Tags map[string]string `pulumi:"tags"` 61 } 62 63 // A collection of values returned by getPublicIpv4Pool. 64 type GetPublicIpv4PoolResult struct { 65 // Description of the pool, if any. 66 Description string `pulumi:"description"` 67 // The provider-assigned unique ID for this managed resource. 68 Id string `pulumi:"id"` 69 // Name of the location from which the address pool is advertised. 70 // * poolAddressRanges` - List of Address Ranges in the Pool; each address range record contains: 71 NetworkBorderGroup string `pulumi:"networkBorderGroup"` 72 PoolAddressRanges []GetPublicIpv4PoolPoolAddressRange `pulumi:"poolAddressRanges"` 73 PoolId string `pulumi:"poolId"` 74 // Any tags for the address pool. 75 Tags map[string]string `pulumi:"tags"` 76 // Total number of addresses in the pool. 77 TotalAddressCount int `pulumi:"totalAddressCount"` 78 // Total number of available addresses in the pool. 79 TotalAvailableAddressCount int `pulumi:"totalAvailableAddressCount"` 80 } 81 82 func GetPublicIpv4PoolOutput(ctx *pulumi.Context, args GetPublicIpv4PoolOutputArgs, opts ...pulumi.InvokeOption) GetPublicIpv4PoolResultOutput { 83 return pulumi.ToOutputWithContext(context.Background(), args). 84 ApplyT(func(v interface{}) (GetPublicIpv4PoolResult, error) { 85 args := v.(GetPublicIpv4PoolArgs) 86 r, err := GetPublicIpv4Pool(ctx, &args, opts...) 87 var s GetPublicIpv4PoolResult 88 if r != nil { 89 s = *r 90 } 91 return s, err 92 }).(GetPublicIpv4PoolResultOutput) 93 } 94 95 // A collection of arguments for invoking getPublicIpv4Pool. 96 type GetPublicIpv4PoolOutputArgs struct { 97 // AWS resource IDs of a public IPv4 pool (as a string) for which this data source will fetch detailed information. 98 PoolId pulumi.StringInput `pulumi:"poolId"` 99 // Any tags for the address pool. 100 Tags pulumi.StringMapInput `pulumi:"tags"` 101 } 102 103 func (GetPublicIpv4PoolOutputArgs) ElementType() reflect.Type { 104 return reflect.TypeOf((*GetPublicIpv4PoolArgs)(nil)).Elem() 105 } 106 107 // A collection of values returned by getPublicIpv4Pool. 108 type GetPublicIpv4PoolResultOutput struct{ *pulumi.OutputState } 109 110 func (GetPublicIpv4PoolResultOutput) ElementType() reflect.Type { 111 return reflect.TypeOf((*GetPublicIpv4PoolResult)(nil)).Elem() 112 } 113 114 func (o GetPublicIpv4PoolResultOutput) ToGetPublicIpv4PoolResultOutput() GetPublicIpv4PoolResultOutput { 115 return o 116 } 117 118 func (o GetPublicIpv4PoolResultOutput) ToGetPublicIpv4PoolResultOutputWithContext(ctx context.Context) GetPublicIpv4PoolResultOutput { 119 return o 120 } 121 122 // Description of the pool, if any. 123 func (o GetPublicIpv4PoolResultOutput) Description() pulumi.StringOutput { 124 return o.ApplyT(func(v GetPublicIpv4PoolResult) string { return v.Description }).(pulumi.StringOutput) 125 } 126 127 // The provider-assigned unique ID for this managed resource. 128 func (o GetPublicIpv4PoolResultOutput) Id() pulumi.StringOutput { 129 return o.ApplyT(func(v GetPublicIpv4PoolResult) string { return v.Id }).(pulumi.StringOutput) 130 } 131 132 // Name of the location from which the address pool is advertised. 133 // * poolAddressRanges` - List of Address Ranges in the Pool; each address range record contains: 134 func (o GetPublicIpv4PoolResultOutput) NetworkBorderGroup() pulumi.StringOutput { 135 return o.ApplyT(func(v GetPublicIpv4PoolResult) string { return v.NetworkBorderGroup }).(pulumi.StringOutput) 136 } 137 138 func (o GetPublicIpv4PoolResultOutput) PoolAddressRanges() GetPublicIpv4PoolPoolAddressRangeArrayOutput { 139 return o.ApplyT(func(v GetPublicIpv4PoolResult) []GetPublicIpv4PoolPoolAddressRange { return v.PoolAddressRanges }).(GetPublicIpv4PoolPoolAddressRangeArrayOutput) 140 } 141 142 func (o GetPublicIpv4PoolResultOutput) PoolId() pulumi.StringOutput { 143 return o.ApplyT(func(v GetPublicIpv4PoolResult) string { return v.PoolId }).(pulumi.StringOutput) 144 } 145 146 // Any tags for the address pool. 147 func (o GetPublicIpv4PoolResultOutput) Tags() pulumi.StringMapOutput { 148 return o.ApplyT(func(v GetPublicIpv4PoolResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 149 } 150 151 // Total number of addresses in the pool. 152 func (o GetPublicIpv4PoolResultOutput) TotalAddressCount() pulumi.IntOutput { 153 return o.ApplyT(func(v GetPublicIpv4PoolResult) int { return v.TotalAddressCount }).(pulumi.IntOutput) 154 } 155 156 // Total number of available addresses in the pool. 157 func (o GetPublicIpv4PoolResultOutput) TotalAvailableAddressCount() pulumi.IntOutput { 158 return o.ApplyT(func(v GetPublicIpv4PoolResult) int { return v.TotalAvailableAddressCount }).(pulumi.IntOutput) 159 } 160 161 func init() { 162 pulumi.RegisterOutputType(GetPublicIpv4PoolResultOutput{}) 163 }