github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/rds/getEventCategories.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 rds
     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  // ## Example Usage
    15  //
    16  // List the event categories of all the RDS resources.
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			example, err := rds.GetEventCategories(ctx, nil, nil)
    32  //			if err != nil {
    33  //				return err
    34  //			}
    35  //			ctx.Export("example", example.EventCategories)
    36  //			return nil
    37  //		})
    38  //	}
    39  //
    40  // ```
    41  // <!--End PulumiCodeChooser -->
    42  //
    43  // List the event categories specific to the RDS resource `db-snapshot`.
    44  //
    45  // <!--Start PulumiCodeChooser -->
    46  // ```go
    47  // package main
    48  //
    49  // import (
    50  //
    51  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds"
    52  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    53  //
    54  // )
    55  //
    56  //	func main() {
    57  //		pulumi.Run(func(ctx *pulumi.Context) error {
    58  //			example, err := rds.GetEventCategories(ctx, &rds.GetEventCategoriesArgs{
    59  //				SourceType: pulumi.StringRef("db-snapshot"),
    60  //			}, nil)
    61  //			if err != nil {
    62  //				return err
    63  //			}
    64  //			ctx.Export("example", example.EventCategories)
    65  //			return nil
    66  //		})
    67  //	}
    68  //
    69  // ```
    70  // <!--End PulumiCodeChooser -->
    71  func GetEventCategories(ctx *pulumi.Context, args *GetEventCategoriesArgs, opts ...pulumi.InvokeOption) (*GetEventCategoriesResult, error) {
    72  	opts = internal.PkgInvokeDefaultOpts(opts)
    73  	var rv GetEventCategoriesResult
    74  	err := ctx.Invoke("aws:rds/getEventCategories:getEventCategories", args, &rv, opts...)
    75  	if err != nil {
    76  		return nil, err
    77  	}
    78  	return &rv, nil
    79  }
    80  
    81  // A collection of arguments for invoking getEventCategories.
    82  type GetEventCategoriesArgs struct {
    83  	// Type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot.
    84  	SourceType *string `pulumi:"sourceType"`
    85  }
    86  
    87  // A collection of values returned by getEventCategories.
    88  type GetEventCategoriesResult struct {
    89  	// List of the event categories.
    90  	EventCategories []string `pulumi:"eventCategories"`
    91  	// The provider-assigned unique ID for this managed resource.
    92  	Id         string  `pulumi:"id"`
    93  	SourceType *string `pulumi:"sourceType"`
    94  }
    95  
    96  func GetEventCategoriesOutput(ctx *pulumi.Context, args GetEventCategoriesOutputArgs, opts ...pulumi.InvokeOption) GetEventCategoriesResultOutput {
    97  	return pulumi.ToOutputWithContext(context.Background(), args).
    98  		ApplyT(func(v interface{}) (GetEventCategoriesResult, error) {
    99  			args := v.(GetEventCategoriesArgs)
   100  			r, err := GetEventCategories(ctx, &args, opts...)
   101  			var s GetEventCategoriesResult
   102  			if r != nil {
   103  				s = *r
   104  			}
   105  			return s, err
   106  		}).(GetEventCategoriesResultOutput)
   107  }
   108  
   109  // A collection of arguments for invoking getEventCategories.
   110  type GetEventCategoriesOutputArgs struct {
   111  	// Type of source that will be generating the events. Valid options are db-instance, db-security-group, db-parameter-group, db-snapshot, db-cluster or db-cluster-snapshot.
   112  	SourceType pulumi.StringPtrInput `pulumi:"sourceType"`
   113  }
   114  
   115  func (GetEventCategoriesOutputArgs) ElementType() reflect.Type {
   116  	return reflect.TypeOf((*GetEventCategoriesArgs)(nil)).Elem()
   117  }
   118  
   119  // A collection of values returned by getEventCategories.
   120  type GetEventCategoriesResultOutput struct{ *pulumi.OutputState }
   121  
   122  func (GetEventCategoriesResultOutput) ElementType() reflect.Type {
   123  	return reflect.TypeOf((*GetEventCategoriesResult)(nil)).Elem()
   124  }
   125  
   126  func (o GetEventCategoriesResultOutput) ToGetEventCategoriesResultOutput() GetEventCategoriesResultOutput {
   127  	return o
   128  }
   129  
   130  func (o GetEventCategoriesResultOutput) ToGetEventCategoriesResultOutputWithContext(ctx context.Context) GetEventCategoriesResultOutput {
   131  	return o
   132  }
   133  
   134  // List of the event categories.
   135  func (o GetEventCategoriesResultOutput) EventCategories() pulumi.StringArrayOutput {
   136  	return o.ApplyT(func(v GetEventCategoriesResult) []string { return v.EventCategories }).(pulumi.StringArrayOutput)
   137  }
   138  
   139  // The provider-assigned unique ID for this managed resource.
   140  func (o GetEventCategoriesResultOutput) Id() pulumi.StringOutput {
   141  	return o.ApplyT(func(v GetEventCategoriesResult) string { return v.Id }).(pulumi.StringOutput)
   142  }
   143  
   144  func (o GetEventCategoriesResultOutput) SourceType() pulumi.StringPtrOutput {
   145  	return o.ApplyT(func(v GetEventCategoriesResult) *string { return v.SourceType }).(pulumi.StringPtrOutput)
   146  }
   147  
   148  func init() {
   149  	pulumi.RegisterOutputType(GetEventCategoriesResultOutput{})
   150  }