github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/guardduty/getFindingIds.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 guardduty
     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 managing an AWS GuardDuty Finding Ids.
    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/guardduty"
    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 := guardduty.GetFindingIds(ctx, &guardduty.GetFindingIdsArgs{
    34  //				DetectorId: exampleAwsGuarddutyDetector.Id,
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func GetFindingIds(ctx *pulumi.Context, args *GetFindingIdsArgs, opts ...pulumi.InvokeOption) (*GetFindingIdsResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv GetFindingIdsResult
    48  	err := ctx.Invoke("aws:guardduty/getFindingIds:getFindingIds", 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 getFindingIds.
    56  type GetFindingIdsArgs struct {
    57  	// ID of the GuardDuty detector.
    58  	DetectorId string `pulumi:"detectorId"`
    59  }
    60  
    61  // A collection of values returned by getFindingIds.
    62  type GetFindingIdsResult struct {
    63  	DetectorId string `pulumi:"detectorId"`
    64  	// A list of finding IDs for the specified detector.
    65  	FindingIds []string `pulumi:"findingIds"`
    66  	// Indicates whether findings are present for the specified detector.
    67  	HasFindings bool   `pulumi:"hasFindings"`
    68  	Id          string `pulumi:"id"`
    69  }
    70  
    71  func GetFindingIdsOutput(ctx *pulumi.Context, args GetFindingIdsOutputArgs, opts ...pulumi.InvokeOption) GetFindingIdsResultOutput {
    72  	return pulumi.ToOutputWithContext(context.Background(), args).
    73  		ApplyT(func(v interface{}) (GetFindingIdsResult, error) {
    74  			args := v.(GetFindingIdsArgs)
    75  			r, err := GetFindingIds(ctx, &args, opts...)
    76  			var s GetFindingIdsResult
    77  			if r != nil {
    78  				s = *r
    79  			}
    80  			return s, err
    81  		}).(GetFindingIdsResultOutput)
    82  }
    83  
    84  // A collection of arguments for invoking getFindingIds.
    85  type GetFindingIdsOutputArgs struct {
    86  	// ID of the GuardDuty detector.
    87  	DetectorId pulumi.StringInput `pulumi:"detectorId"`
    88  }
    89  
    90  func (GetFindingIdsOutputArgs) ElementType() reflect.Type {
    91  	return reflect.TypeOf((*GetFindingIdsArgs)(nil)).Elem()
    92  }
    93  
    94  // A collection of values returned by getFindingIds.
    95  type GetFindingIdsResultOutput struct{ *pulumi.OutputState }
    96  
    97  func (GetFindingIdsResultOutput) ElementType() reflect.Type {
    98  	return reflect.TypeOf((*GetFindingIdsResult)(nil)).Elem()
    99  }
   100  
   101  func (o GetFindingIdsResultOutput) ToGetFindingIdsResultOutput() GetFindingIdsResultOutput {
   102  	return o
   103  }
   104  
   105  func (o GetFindingIdsResultOutput) ToGetFindingIdsResultOutputWithContext(ctx context.Context) GetFindingIdsResultOutput {
   106  	return o
   107  }
   108  
   109  func (o GetFindingIdsResultOutput) DetectorId() pulumi.StringOutput {
   110  	return o.ApplyT(func(v GetFindingIdsResult) string { return v.DetectorId }).(pulumi.StringOutput)
   111  }
   112  
   113  // A list of finding IDs for the specified detector.
   114  func (o GetFindingIdsResultOutput) FindingIds() pulumi.StringArrayOutput {
   115  	return o.ApplyT(func(v GetFindingIdsResult) []string { return v.FindingIds }).(pulumi.StringArrayOutput)
   116  }
   117  
   118  // Indicates whether findings are present for the specified detector.
   119  func (o GetFindingIdsResultOutput) HasFindings() pulumi.BoolOutput {
   120  	return o.ApplyT(func(v GetFindingIdsResult) bool { return v.HasFindings }).(pulumi.BoolOutput)
   121  }
   122  
   123  func (o GetFindingIdsResultOutput) Id() pulumi.StringOutput {
   124  	return o.ApplyT(func(v GetFindingIdsResult) string { return v.Id }).(pulumi.StringOutput)
   125  }
   126  
   127  func init() {
   128  	pulumi.RegisterOutputType(GetFindingIdsResultOutput{})
   129  }