github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/guardduty/getDetector.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  // Retrieve information about a GuardDuty detector.
    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/guardduty"
    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 := guardduty.LookupDetector(ctx, nil, nil)
    32  //			if err != nil {
    33  //				return err
    34  //			}
    35  //			return nil
    36  //		})
    37  //	}
    38  //
    39  // ```
    40  // <!--End PulumiCodeChooser -->
    41  func LookupDetector(ctx *pulumi.Context, args *LookupDetectorArgs, opts ...pulumi.InvokeOption) (*LookupDetectorResult, error) {
    42  	opts = internal.PkgInvokeDefaultOpts(opts)
    43  	var rv LookupDetectorResult
    44  	err := ctx.Invoke("aws:guardduty/getDetector:getDetector", args, &rv, opts...)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	return &rv, nil
    49  }
    50  
    51  // A collection of arguments for invoking getDetector.
    52  type LookupDetectorArgs struct {
    53  	// ID of the detector.
    54  	Id *string `pulumi:"id"`
    55  }
    56  
    57  // A collection of values returned by getDetector.
    58  type LookupDetectorResult struct {
    59  	// Current configuration of the detector features.
    60  	Features []GetDetectorFeatureType `pulumi:"features"`
    61  	// The frequency of notifications sent about subsequent finding occurrences.
    62  	FindingPublishingFrequency string `pulumi:"findingPublishingFrequency"`
    63  	Id                         string `pulumi:"id"`
    64  	// Service-linked role that grants GuardDuty access to the resources in the AWS account.
    65  	ServiceRoleArn string `pulumi:"serviceRoleArn"`
    66  	// Current status of the detector.
    67  	Status string `pulumi:"status"`
    68  }
    69  
    70  func LookupDetectorOutput(ctx *pulumi.Context, args LookupDetectorOutputArgs, opts ...pulumi.InvokeOption) LookupDetectorResultOutput {
    71  	return pulumi.ToOutputWithContext(context.Background(), args).
    72  		ApplyT(func(v interface{}) (LookupDetectorResult, error) {
    73  			args := v.(LookupDetectorArgs)
    74  			r, err := LookupDetector(ctx, &args, opts...)
    75  			var s LookupDetectorResult
    76  			if r != nil {
    77  				s = *r
    78  			}
    79  			return s, err
    80  		}).(LookupDetectorResultOutput)
    81  }
    82  
    83  // A collection of arguments for invoking getDetector.
    84  type LookupDetectorOutputArgs struct {
    85  	// ID of the detector.
    86  	Id pulumi.StringPtrInput `pulumi:"id"`
    87  }
    88  
    89  func (LookupDetectorOutputArgs) ElementType() reflect.Type {
    90  	return reflect.TypeOf((*LookupDetectorArgs)(nil)).Elem()
    91  }
    92  
    93  // A collection of values returned by getDetector.
    94  type LookupDetectorResultOutput struct{ *pulumi.OutputState }
    95  
    96  func (LookupDetectorResultOutput) ElementType() reflect.Type {
    97  	return reflect.TypeOf((*LookupDetectorResult)(nil)).Elem()
    98  }
    99  
   100  func (o LookupDetectorResultOutput) ToLookupDetectorResultOutput() LookupDetectorResultOutput {
   101  	return o
   102  }
   103  
   104  func (o LookupDetectorResultOutput) ToLookupDetectorResultOutputWithContext(ctx context.Context) LookupDetectorResultOutput {
   105  	return o
   106  }
   107  
   108  // Current configuration of the detector features.
   109  func (o LookupDetectorResultOutput) Features() GetDetectorFeatureTypeArrayOutput {
   110  	return o.ApplyT(func(v LookupDetectorResult) []GetDetectorFeatureType { return v.Features }).(GetDetectorFeatureTypeArrayOutput)
   111  }
   112  
   113  // The frequency of notifications sent about subsequent finding occurrences.
   114  func (o LookupDetectorResultOutput) FindingPublishingFrequency() pulumi.StringOutput {
   115  	return o.ApplyT(func(v LookupDetectorResult) string { return v.FindingPublishingFrequency }).(pulumi.StringOutput)
   116  }
   117  
   118  func (o LookupDetectorResultOutput) Id() pulumi.StringOutput {
   119  	return o.ApplyT(func(v LookupDetectorResult) string { return v.Id }).(pulumi.StringOutput)
   120  }
   121  
   122  // Service-linked role that grants GuardDuty access to the resources in the AWS account.
   123  func (o LookupDetectorResultOutput) ServiceRoleArn() pulumi.StringOutput {
   124  	return o.ApplyT(func(v LookupDetectorResult) string { return v.ServiceRoleArn }).(pulumi.StringOutput)
   125  }
   126  
   127  // Current status of the detector.
   128  func (o LookupDetectorResultOutput) Status() pulumi.StringOutput {
   129  	return o.ApplyT(func(v LookupDetectorResult) string { return v.Status }).(pulumi.StringOutput)
   130  }
   131  
   132  func init() {
   133  	pulumi.RegisterOutputType(LookupDetectorResultOutput{})
   134  }