github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cognito/getUserGroups.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 cognito 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 AWS Cognito IDP (Identity Provider) User Groups. 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/cognito" 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 := cognito.GetUserGroups(ctx, &cognito.GetUserGroupsArgs{ 34 // UserPoolId: "us-west-2_aaaaaaaaa", 35 // }, nil) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 func GetUserGroups(ctx *pulumi.Context, args *GetUserGroupsArgs, opts ...pulumi.InvokeOption) (*GetUserGroupsResult, error) { 46 opts = internal.PkgInvokeDefaultOpts(opts) 47 var rv GetUserGroupsResult 48 err := ctx.Invoke("aws:cognito/getUserGroups:getUserGroups", 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 getUserGroups. 56 type GetUserGroupsArgs struct { 57 // List of groups. See `groups` below. 58 Groups []GetUserGroupsGroup `pulumi:"groups"` 59 // User pool the client belongs to. 60 UserPoolId string `pulumi:"userPoolId"` 61 } 62 63 // A collection of values returned by getUserGroups. 64 type GetUserGroupsResult struct { 65 // List of groups. See `groups` below. 66 Groups []GetUserGroupsGroup `pulumi:"groups"` 67 // User pool identifier. 68 Id string `pulumi:"id"` 69 UserPoolId string `pulumi:"userPoolId"` 70 } 71 72 func GetUserGroupsOutput(ctx *pulumi.Context, args GetUserGroupsOutputArgs, opts ...pulumi.InvokeOption) GetUserGroupsResultOutput { 73 return pulumi.ToOutputWithContext(context.Background(), args). 74 ApplyT(func(v interface{}) (GetUserGroupsResult, error) { 75 args := v.(GetUserGroupsArgs) 76 r, err := GetUserGroups(ctx, &args, opts...) 77 var s GetUserGroupsResult 78 if r != nil { 79 s = *r 80 } 81 return s, err 82 }).(GetUserGroupsResultOutput) 83 } 84 85 // A collection of arguments for invoking getUserGroups. 86 type GetUserGroupsOutputArgs struct { 87 // List of groups. See `groups` below. 88 Groups GetUserGroupsGroupArrayInput `pulumi:"groups"` 89 // User pool the client belongs to. 90 UserPoolId pulumi.StringInput `pulumi:"userPoolId"` 91 } 92 93 func (GetUserGroupsOutputArgs) ElementType() reflect.Type { 94 return reflect.TypeOf((*GetUserGroupsArgs)(nil)).Elem() 95 } 96 97 // A collection of values returned by getUserGroups. 98 type GetUserGroupsResultOutput struct{ *pulumi.OutputState } 99 100 func (GetUserGroupsResultOutput) ElementType() reflect.Type { 101 return reflect.TypeOf((*GetUserGroupsResult)(nil)).Elem() 102 } 103 104 func (o GetUserGroupsResultOutput) ToGetUserGroupsResultOutput() GetUserGroupsResultOutput { 105 return o 106 } 107 108 func (o GetUserGroupsResultOutput) ToGetUserGroupsResultOutputWithContext(ctx context.Context) GetUserGroupsResultOutput { 109 return o 110 } 111 112 // List of groups. See `groups` below. 113 func (o GetUserGroupsResultOutput) Groups() GetUserGroupsGroupArrayOutput { 114 return o.ApplyT(func(v GetUserGroupsResult) []GetUserGroupsGroup { return v.Groups }).(GetUserGroupsGroupArrayOutput) 115 } 116 117 // User pool identifier. 118 func (o GetUserGroupsResultOutput) Id() pulumi.StringOutput { 119 return o.ApplyT(func(v GetUserGroupsResult) string { return v.Id }).(pulumi.StringOutput) 120 } 121 122 func (o GetUserGroupsResultOutput) UserPoolId() pulumi.StringOutput { 123 return o.ApplyT(func(v GetUserGroupsResult) string { return v.UserPoolId }).(pulumi.StringOutput) 124 } 125 126 func init() { 127 pulumi.RegisterOutputType(GetUserGroupsResultOutput{}) 128 }