github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getVpcIpamPools.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  // `ec2.getVpcIpamPools` provides details about IPAM pools.
    15  //
    16  // This resource can prove useful when IPAM pools are created in another root
    17  // module and you need the pool ids as input variables. For example, pools
    18  // can be shared via RAM and used to create vpcs with CIDRs from that pool.
    19  //
    20  // ## Example Usage
    21  //
    22  // <!--Start PulumiCodeChooser -->
    23  // ```go
    24  // package main
    25  //
    26  // import (
    27  //
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			_, err := ec2.GetVpcIpamPools(ctx, &ec2.GetVpcIpamPoolsArgs{
    36  //				Filters: []ec2.GetVpcIpamPoolsFilter{
    37  //					{
    38  //						Name: "description",
    39  //						Values: []string{
    40  //							"*test*",
    41  //						},
    42  //					},
    43  //					{
    44  //						Name: "address-family",
    45  //						Values: []string{
    46  //							"ipv4",
    47  //						},
    48  //					},
    49  //				},
    50  //			}, nil)
    51  //			if err != nil {
    52  //				return err
    53  //			}
    54  //			return nil
    55  //		})
    56  //	}
    57  //
    58  // ```
    59  // <!--End PulumiCodeChooser -->
    60  func GetVpcIpamPools(ctx *pulumi.Context, args *GetVpcIpamPoolsArgs, opts ...pulumi.InvokeOption) (*GetVpcIpamPoolsResult, error) {
    61  	opts = internal.PkgInvokeDefaultOpts(opts)
    62  	var rv GetVpcIpamPoolsResult
    63  	err := ctx.Invoke("aws:ec2/getVpcIpamPools:getVpcIpamPools", args, &rv, opts...)
    64  	if err != nil {
    65  		return nil, err
    66  	}
    67  	return &rv, nil
    68  }
    69  
    70  // A collection of arguments for invoking getVpcIpamPools.
    71  type GetVpcIpamPoolsArgs struct {
    72  	// Custom filter block as described below.
    73  	Filters []GetVpcIpamPoolsFilter `pulumi:"filters"`
    74  }
    75  
    76  // A collection of values returned by getVpcIpamPools.
    77  type GetVpcIpamPoolsResult struct {
    78  	Filters []GetVpcIpamPoolsFilter `pulumi:"filters"`
    79  	// The provider-assigned unique ID for this managed resource.
    80  	Id string `pulumi:"id"`
    81  	// List of IPAM pools and their attributes. See below for details
    82  	IpamPools []GetVpcIpamPoolsIpamPool `pulumi:"ipamPools"`
    83  }
    84  
    85  func GetVpcIpamPoolsOutput(ctx *pulumi.Context, args GetVpcIpamPoolsOutputArgs, opts ...pulumi.InvokeOption) GetVpcIpamPoolsResultOutput {
    86  	return pulumi.ToOutputWithContext(context.Background(), args).
    87  		ApplyT(func(v interface{}) (GetVpcIpamPoolsResult, error) {
    88  			args := v.(GetVpcIpamPoolsArgs)
    89  			r, err := GetVpcIpamPools(ctx, &args, opts...)
    90  			var s GetVpcIpamPoolsResult
    91  			if r != nil {
    92  				s = *r
    93  			}
    94  			return s, err
    95  		}).(GetVpcIpamPoolsResultOutput)
    96  }
    97  
    98  // A collection of arguments for invoking getVpcIpamPools.
    99  type GetVpcIpamPoolsOutputArgs struct {
   100  	// Custom filter block as described below.
   101  	Filters GetVpcIpamPoolsFilterArrayInput `pulumi:"filters"`
   102  }
   103  
   104  func (GetVpcIpamPoolsOutputArgs) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*GetVpcIpamPoolsArgs)(nil)).Elem()
   106  }
   107  
   108  // A collection of values returned by getVpcIpamPools.
   109  type GetVpcIpamPoolsResultOutput struct{ *pulumi.OutputState }
   110  
   111  func (GetVpcIpamPoolsResultOutput) ElementType() reflect.Type {
   112  	return reflect.TypeOf((*GetVpcIpamPoolsResult)(nil)).Elem()
   113  }
   114  
   115  func (o GetVpcIpamPoolsResultOutput) ToGetVpcIpamPoolsResultOutput() GetVpcIpamPoolsResultOutput {
   116  	return o
   117  }
   118  
   119  func (o GetVpcIpamPoolsResultOutput) ToGetVpcIpamPoolsResultOutputWithContext(ctx context.Context) GetVpcIpamPoolsResultOutput {
   120  	return o
   121  }
   122  
   123  func (o GetVpcIpamPoolsResultOutput) Filters() GetVpcIpamPoolsFilterArrayOutput {
   124  	return o.ApplyT(func(v GetVpcIpamPoolsResult) []GetVpcIpamPoolsFilter { return v.Filters }).(GetVpcIpamPoolsFilterArrayOutput)
   125  }
   126  
   127  // The provider-assigned unique ID for this managed resource.
   128  func (o GetVpcIpamPoolsResultOutput) Id() pulumi.StringOutput {
   129  	return o.ApplyT(func(v GetVpcIpamPoolsResult) string { return v.Id }).(pulumi.StringOutput)
   130  }
   131  
   132  // List of IPAM pools and their attributes. See below for details
   133  func (o GetVpcIpamPoolsResultOutput) IpamPools() GetVpcIpamPoolsIpamPoolArrayOutput {
   134  	return o.ApplyT(func(v GetVpcIpamPoolsResult) []GetVpcIpamPoolsIpamPool { return v.IpamPools }).(GetVpcIpamPoolsIpamPoolArrayOutput)
   135  }
   136  
   137  func init() {
   138  	pulumi.RegisterOutputType(GetVpcIpamPoolsResultOutput{})
   139  }