github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getVpcIamPools.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  //
    61  // Deprecated: aws.ec2/getvpciampools.getVpcIamPools has been deprecated in favor of aws.ec2/getvpcipampools.getVpcIpamPools
    62  func GetVpcIamPools(ctx *pulumi.Context, args *GetVpcIamPoolsArgs, opts ...pulumi.InvokeOption) (*GetVpcIamPoolsResult, error) {
    63  	opts = internal.PkgInvokeDefaultOpts(opts)
    64  	var rv GetVpcIamPoolsResult
    65  	err := ctx.Invoke("aws:ec2/getVpcIamPools:getVpcIamPools", args, &rv, opts...)
    66  	if err != nil {
    67  		return nil, err
    68  	}
    69  	return &rv, nil
    70  }
    71  
    72  // A collection of arguments for invoking getVpcIamPools.
    73  type GetVpcIamPoolsArgs struct {
    74  	// Custom filter block as described below.
    75  	Filters []GetVpcIamPoolsFilter `pulumi:"filters"`
    76  }
    77  
    78  // A collection of values returned by getVpcIamPools.
    79  type GetVpcIamPoolsResult struct {
    80  	Filters []GetVpcIamPoolsFilter `pulumi:"filters"`
    81  	// The provider-assigned unique ID for this managed resource.
    82  	Id string `pulumi:"id"`
    83  	// List of IPAM pools and their attributes. See below for details
    84  	IpamPools []GetVpcIamPoolsIpamPool `pulumi:"ipamPools"`
    85  }
    86  
    87  func GetVpcIamPoolsOutput(ctx *pulumi.Context, args GetVpcIamPoolsOutputArgs, opts ...pulumi.InvokeOption) GetVpcIamPoolsResultOutput {
    88  	return pulumi.ToOutputWithContext(context.Background(), args).
    89  		ApplyT(func(v interface{}) (GetVpcIamPoolsResult, error) {
    90  			args := v.(GetVpcIamPoolsArgs)
    91  			r, err := GetVpcIamPools(ctx, &args, opts...)
    92  			var s GetVpcIamPoolsResult
    93  			if r != nil {
    94  				s = *r
    95  			}
    96  			return s, err
    97  		}).(GetVpcIamPoolsResultOutput)
    98  }
    99  
   100  // A collection of arguments for invoking getVpcIamPools.
   101  type GetVpcIamPoolsOutputArgs struct {
   102  	// Custom filter block as described below.
   103  	Filters GetVpcIamPoolsFilterArrayInput `pulumi:"filters"`
   104  }
   105  
   106  func (GetVpcIamPoolsOutputArgs) ElementType() reflect.Type {
   107  	return reflect.TypeOf((*GetVpcIamPoolsArgs)(nil)).Elem()
   108  }
   109  
   110  // A collection of values returned by getVpcIamPools.
   111  type GetVpcIamPoolsResultOutput struct{ *pulumi.OutputState }
   112  
   113  func (GetVpcIamPoolsResultOutput) ElementType() reflect.Type {
   114  	return reflect.TypeOf((*GetVpcIamPoolsResult)(nil)).Elem()
   115  }
   116  
   117  func (o GetVpcIamPoolsResultOutput) ToGetVpcIamPoolsResultOutput() GetVpcIamPoolsResultOutput {
   118  	return o
   119  }
   120  
   121  func (o GetVpcIamPoolsResultOutput) ToGetVpcIamPoolsResultOutputWithContext(ctx context.Context) GetVpcIamPoolsResultOutput {
   122  	return o
   123  }
   124  
   125  func (o GetVpcIamPoolsResultOutput) Filters() GetVpcIamPoolsFilterArrayOutput {
   126  	return o.ApplyT(func(v GetVpcIamPoolsResult) []GetVpcIamPoolsFilter { return v.Filters }).(GetVpcIamPoolsFilterArrayOutput)
   127  }
   128  
   129  // The provider-assigned unique ID for this managed resource.
   130  func (o GetVpcIamPoolsResultOutput) Id() pulumi.StringOutput {
   131  	return o.ApplyT(func(v GetVpcIamPoolsResult) string { return v.Id }).(pulumi.StringOutput)
   132  }
   133  
   134  // List of IPAM pools and their attributes. See below for details
   135  func (o GetVpcIamPoolsResultOutput) IpamPools() GetVpcIamPoolsIpamPoolArrayOutput {
   136  	return o.ApplyT(func(v GetVpcIamPoolsResult) []GetVpcIamPoolsIpamPool { return v.IpamPools }).(GetVpcIamPoolsIpamPoolArrayOutput)
   137  }
   138  
   139  func init() {
   140  	pulumi.RegisterOutputType(GetVpcIamPoolsResultOutput{})
   141  }