github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/wafv2/getIpSet.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 wafv2
     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  // Retrieves the summary of a WAFv2 IP Set.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/wafv2"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := wafv2.LookupIpSet(ctx, &wafv2.LookupIpSetArgs{
    32  //				Name:  "some-ip-set",
    33  //				Scope: "REGIONAL",
    34  //			}, nil)
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  func LookupIpSet(ctx *pulumi.Context, args *LookupIpSetArgs, opts ...pulumi.InvokeOption) (*LookupIpSetResult, error) {
    45  	opts = internal.PkgInvokeDefaultOpts(opts)
    46  	var rv LookupIpSetResult
    47  	err := ctx.Invoke("aws:wafv2/getIpSet:getIpSet", args, &rv, opts...)
    48  	if err != nil {
    49  		return nil, err
    50  	}
    51  	return &rv, nil
    52  }
    53  
    54  // A collection of arguments for invoking getIpSet.
    55  type LookupIpSetArgs struct {
    56  	// Name of the WAFv2 IP Set.
    57  	Name string `pulumi:"name"`
    58  	// Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider.
    59  	Scope string `pulumi:"scope"`
    60  }
    61  
    62  // A collection of values returned by getIpSet.
    63  type LookupIpSetResult struct {
    64  	// An array of strings that specifies zero or more IP addresses or blocks of IP addresses in Classless Inter-Domain Routing (CIDR) notation.
    65  	Addresses []string `pulumi:"addresses"`
    66  	// ARN of the entity.
    67  	Arn string `pulumi:"arn"`
    68  	// Description of the set that helps with identification.
    69  	Description string `pulumi:"description"`
    70  	// The provider-assigned unique ID for this managed resource.
    71  	Id string `pulumi:"id"`
    72  	// IP address version of the set.
    73  	IpAddressVersion string `pulumi:"ipAddressVersion"`
    74  	Name             string `pulumi:"name"`
    75  	Scope            string `pulumi:"scope"`
    76  }
    77  
    78  func LookupIpSetOutput(ctx *pulumi.Context, args LookupIpSetOutputArgs, opts ...pulumi.InvokeOption) LookupIpSetResultOutput {
    79  	return pulumi.ToOutputWithContext(context.Background(), args).
    80  		ApplyT(func(v interface{}) (LookupIpSetResult, error) {
    81  			args := v.(LookupIpSetArgs)
    82  			r, err := LookupIpSet(ctx, &args, opts...)
    83  			var s LookupIpSetResult
    84  			if r != nil {
    85  				s = *r
    86  			}
    87  			return s, err
    88  		}).(LookupIpSetResultOutput)
    89  }
    90  
    91  // A collection of arguments for invoking getIpSet.
    92  type LookupIpSetOutputArgs struct {
    93  	// Name of the WAFv2 IP Set.
    94  	Name pulumi.StringInput `pulumi:"name"`
    95  	// Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider.
    96  	Scope pulumi.StringInput `pulumi:"scope"`
    97  }
    98  
    99  func (LookupIpSetOutputArgs) ElementType() reflect.Type {
   100  	return reflect.TypeOf((*LookupIpSetArgs)(nil)).Elem()
   101  }
   102  
   103  // A collection of values returned by getIpSet.
   104  type LookupIpSetResultOutput struct{ *pulumi.OutputState }
   105  
   106  func (LookupIpSetResultOutput) ElementType() reflect.Type {
   107  	return reflect.TypeOf((*LookupIpSetResult)(nil)).Elem()
   108  }
   109  
   110  func (o LookupIpSetResultOutput) ToLookupIpSetResultOutput() LookupIpSetResultOutput {
   111  	return o
   112  }
   113  
   114  func (o LookupIpSetResultOutput) ToLookupIpSetResultOutputWithContext(ctx context.Context) LookupIpSetResultOutput {
   115  	return o
   116  }
   117  
   118  // An array of strings that specifies zero or more IP addresses or blocks of IP addresses in Classless Inter-Domain Routing (CIDR) notation.
   119  func (o LookupIpSetResultOutput) Addresses() pulumi.StringArrayOutput {
   120  	return o.ApplyT(func(v LookupIpSetResult) []string { return v.Addresses }).(pulumi.StringArrayOutput)
   121  }
   122  
   123  // ARN of the entity.
   124  func (o LookupIpSetResultOutput) Arn() pulumi.StringOutput {
   125  	return o.ApplyT(func(v LookupIpSetResult) string { return v.Arn }).(pulumi.StringOutput)
   126  }
   127  
   128  // Description of the set that helps with identification.
   129  func (o LookupIpSetResultOutput) Description() pulumi.StringOutput {
   130  	return o.ApplyT(func(v LookupIpSetResult) string { return v.Description }).(pulumi.StringOutput)
   131  }
   132  
   133  // The provider-assigned unique ID for this managed resource.
   134  func (o LookupIpSetResultOutput) Id() pulumi.StringOutput {
   135  	return o.ApplyT(func(v LookupIpSetResult) string { return v.Id }).(pulumi.StringOutput)
   136  }
   137  
   138  // IP address version of the set.
   139  func (o LookupIpSetResultOutput) IpAddressVersion() pulumi.StringOutput {
   140  	return o.ApplyT(func(v LookupIpSetResult) string { return v.IpAddressVersion }).(pulumi.StringOutput)
   141  }
   142  
   143  func (o LookupIpSetResultOutput) Name() pulumi.StringOutput {
   144  	return o.ApplyT(func(v LookupIpSetResult) string { return v.Name }).(pulumi.StringOutput)
   145  }
   146  
   147  func (o LookupIpSetResultOutput) Scope() pulumi.StringOutput {
   148  	return o.ApplyT(func(v LookupIpSetResult) string { return v.Scope }).(pulumi.StringOutput)
   149  }
   150  
   151  func init() {
   152  	pulumi.RegisterOutputType(LookupIpSetResultOutput{})
   153  }