-
Notifications
You must be signed in to change notification settings - Fork 151
/
getUserPools.go
133 lines (115 loc) · 4.29 KB
/
getUserPools.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package cognito
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get a list of cognito user pools.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/apigateway"
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/cognito"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// selectedRestApi, err := apigateway.LookupRestApi(ctx, &apigateway.LookupRestApiArgs{
// Name: _var.Api_gateway_name,
// }, nil)
// if err != nil {
// return err
// }
// selectedUserPools, err := cognito.GetUserPools(ctx, &cognito.GetUserPoolsArgs{
// Name: _var.Cognito_user_pool_name,
// }, nil)
// if err != nil {
// return err
// }
// _, err = apigateway.NewAuthorizer(ctx, "cognito", &apigateway.AuthorizerArgs{
// Type: pulumi.String("COGNITO_USER_POOLS"),
// RestApi: pulumi.String(selectedRestApi.Id),
// ProviderArns: interface{}(selectedUserPools.Arns),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetUserPools(ctx *pulumi.Context, args *GetUserPoolsArgs, opts ...pulumi.InvokeOption) (*GetUserPoolsResult, error) {
var rv GetUserPoolsResult
err := ctx.Invoke("aws:cognito/getUserPools:getUserPools", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getUserPools.
type GetUserPoolsArgs struct {
// Name of the cognito user pools. Name is not a unique attribute for cognito user pool, so multiple pools might be returned with given name.
Name string `pulumi:"name"`
}
// A collection of values returned by getUserPools.
type GetUserPoolsResult struct {
// The set of cognito user pool Amazon Resource Names (ARNs).
Arns []string `pulumi:"arns"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The set of cognito user pool ids.
Ids []string `pulumi:"ids"`
Name string `pulumi:"name"`
}
func GetUserPoolsOutput(ctx *pulumi.Context, args GetUserPoolsOutputArgs, opts ...pulumi.InvokeOption) GetUserPoolsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetUserPoolsResult, error) {
args := v.(GetUserPoolsArgs)
r, err := GetUserPools(ctx, &args, opts...)
return *r, err
}).(GetUserPoolsResultOutput)
}
// A collection of arguments for invoking getUserPools.
type GetUserPoolsOutputArgs struct {
// Name of the cognito user pools. Name is not a unique attribute for cognito user pool, so multiple pools might be returned with given name.
Name pulumi.StringInput `pulumi:"name"`
}
func (GetUserPoolsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetUserPoolsArgs)(nil)).Elem()
}
// A collection of values returned by getUserPools.
type GetUserPoolsResultOutput struct{ *pulumi.OutputState }
func (GetUserPoolsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetUserPoolsResult)(nil)).Elem()
}
func (o GetUserPoolsResultOutput) ToGetUserPoolsResultOutput() GetUserPoolsResultOutput {
return o
}
func (o GetUserPoolsResultOutput) ToGetUserPoolsResultOutputWithContext(ctx context.Context) GetUserPoolsResultOutput {
return o
}
// The set of cognito user pool Amazon Resource Names (ARNs).
func (o GetUserPoolsResultOutput) Arns() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetUserPoolsResult) []string { return v.Arns }).(pulumi.StringArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetUserPoolsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetUserPoolsResult) string { return v.Id }).(pulumi.StringOutput)
}
// The set of cognito user pool ids.
func (o GetUserPoolsResultOutput) Ids() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetUserPoolsResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
}
func (o GetUserPoolsResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetUserPoolsResult) string { return v.Name }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetUserPoolsResultOutput{})
}