github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/devopsguru/getNotificationChannel.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 devopsguru
     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 DevOps Guru Notification Channel.
    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/devopsguru"
    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 := devopsguru.LookupNotificationChannel(ctx, &devopsguru.LookupNotificationChannelArgs{
    34  //				Id: "channel-1234",
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func LookupNotificationChannel(ctx *pulumi.Context, args *LookupNotificationChannelArgs, opts ...pulumi.InvokeOption) (*LookupNotificationChannelResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv LookupNotificationChannelResult
    48  	err := ctx.Invoke("aws:devopsguru/getNotificationChannel:getNotificationChannel", 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 getNotificationChannel.
    56  type LookupNotificationChannelArgs struct {
    57  	// Filter configurations for the Amazon SNS notification topic. See the `filters` attribute reference below.
    58  	Filters []GetNotificationChannelFilter `pulumi:"filters"`
    59  	// Unique identifier for the notification channel.
    60  	Id string `pulumi:"id"`
    61  	// SNS noficiation channel configurations. See the `sns` attribute reference below.
    62  	Sns []GetNotificationChannelSn `pulumi:"sns"`
    63  }
    64  
    65  // A collection of values returned by getNotificationChannel.
    66  type LookupNotificationChannelResult struct {
    67  	// Filter configurations for the Amazon SNS notification topic. See the `filters` attribute reference below.
    68  	Filters []GetNotificationChannelFilter `pulumi:"filters"`
    69  	Id      string                         `pulumi:"id"`
    70  	// SNS noficiation channel configurations. See the `sns` attribute reference below.
    71  	Sns []GetNotificationChannelSn `pulumi:"sns"`
    72  }
    73  
    74  func LookupNotificationChannelOutput(ctx *pulumi.Context, args LookupNotificationChannelOutputArgs, opts ...pulumi.InvokeOption) LookupNotificationChannelResultOutput {
    75  	return pulumi.ToOutputWithContext(context.Background(), args).
    76  		ApplyT(func(v interface{}) (LookupNotificationChannelResult, error) {
    77  			args := v.(LookupNotificationChannelArgs)
    78  			r, err := LookupNotificationChannel(ctx, &args, opts...)
    79  			var s LookupNotificationChannelResult
    80  			if r != nil {
    81  				s = *r
    82  			}
    83  			return s, err
    84  		}).(LookupNotificationChannelResultOutput)
    85  }
    86  
    87  // A collection of arguments for invoking getNotificationChannel.
    88  type LookupNotificationChannelOutputArgs struct {
    89  	// Filter configurations for the Amazon SNS notification topic. See the `filters` attribute reference below.
    90  	Filters GetNotificationChannelFilterArrayInput `pulumi:"filters"`
    91  	// Unique identifier for the notification channel.
    92  	Id pulumi.StringInput `pulumi:"id"`
    93  	// SNS noficiation channel configurations. See the `sns` attribute reference below.
    94  	Sns GetNotificationChannelSnArrayInput `pulumi:"sns"`
    95  }
    96  
    97  func (LookupNotificationChannelOutputArgs) ElementType() reflect.Type {
    98  	return reflect.TypeOf((*LookupNotificationChannelArgs)(nil)).Elem()
    99  }
   100  
   101  // A collection of values returned by getNotificationChannel.
   102  type LookupNotificationChannelResultOutput struct{ *pulumi.OutputState }
   103  
   104  func (LookupNotificationChannelResultOutput) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*LookupNotificationChannelResult)(nil)).Elem()
   106  }
   107  
   108  func (o LookupNotificationChannelResultOutput) ToLookupNotificationChannelResultOutput() LookupNotificationChannelResultOutput {
   109  	return o
   110  }
   111  
   112  func (o LookupNotificationChannelResultOutput) ToLookupNotificationChannelResultOutputWithContext(ctx context.Context) LookupNotificationChannelResultOutput {
   113  	return o
   114  }
   115  
   116  // Filter configurations for the Amazon SNS notification topic. See the `filters` attribute reference below.
   117  func (o LookupNotificationChannelResultOutput) Filters() GetNotificationChannelFilterArrayOutput {
   118  	return o.ApplyT(func(v LookupNotificationChannelResult) []GetNotificationChannelFilter { return v.Filters }).(GetNotificationChannelFilterArrayOutput)
   119  }
   120  
   121  func (o LookupNotificationChannelResultOutput) Id() pulumi.StringOutput {
   122  	return o.ApplyT(func(v LookupNotificationChannelResult) string { return v.Id }).(pulumi.StringOutput)
   123  }
   124  
   125  // SNS noficiation channel configurations. See the `sns` attribute reference below.
   126  func (o LookupNotificationChannelResultOutput) Sns() GetNotificationChannelSnArrayOutput {
   127  	return o.ApplyT(func(v LookupNotificationChannelResult) []GetNotificationChannelSn { return v.Sns }).(GetNotificationChannelSnArrayOutput)
   128  }
   129  
   130  func init() {
   131  	pulumi.RegisterOutputType(LookupNotificationChannelResultOutput{})
   132  }