/
identityProvider.go
137 lines (124 loc) · 6.92 KB
/
identityProvider.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
134
135
136
137
// *** 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 (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Provides a Cognito User Identity Provider resource.
type IdentityProvider struct {
pulumi.CustomResourceState
// The map of attribute mapping of user pool attributes. [AttributeMapping in AWS API documentation](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-AttributeMapping)
AttributeMapping pulumi.MapOutput `pulumi:"attributeMapping"`
// The list of identity providers.
IdpIdentifiers pulumi.StringArrayOutput `pulumi:"idpIdentifiers"`
// The map of identity details, such as access token
ProviderDetails pulumi.MapOutput `pulumi:"providerDetails"`
// The provider name
ProviderName pulumi.StringOutput `pulumi:"providerName"`
// The provider type. [See AWS API for valid values](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-ProviderType)
ProviderType pulumi.StringOutput `pulumi:"providerType"`
// The user pool id
UserPoolId pulumi.StringOutput `pulumi:"userPoolId"`
}
// NewIdentityProvider registers a new resource with the given unique name, arguments, and options.
func NewIdentityProvider(ctx *pulumi.Context,
name string, args *IdentityProviderArgs, opts ...pulumi.ResourceOption) (*IdentityProvider, error) {
if args == nil || args.ProviderDetails == nil {
return nil, errors.New("missing required argument 'ProviderDetails'")
}
if args == nil || args.ProviderName == nil {
return nil, errors.New("missing required argument 'ProviderName'")
}
if args == nil || args.ProviderType == nil {
return nil, errors.New("missing required argument 'ProviderType'")
}
if args == nil || args.UserPoolId == nil {
return nil, errors.New("missing required argument 'UserPoolId'")
}
if args == nil {
args = &IdentityProviderArgs{}
}
var resource IdentityProvider
err := ctx.RegisterResource("aws:cognito/identityProvider:IdentityProvider", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIdentityProvider gets an existing IdentityProvider resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetIdentityProvider(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IdentityProviderState, opts ...pulumi.ResourceOption) (*IdentityProvider, error) {
var resource IdentityProvider
err := ctx.ReadResource("aws:cognito/identityProvider:IdentityProvider", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IdentityProvider resources.
type identityProviderState struct {
// The map of attribute mapping of user pool attributes. [AttributeMapping in AWS API documentation](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-AttributeMapping)
AttributeMapping map[string]interface{} `pulumi:"attributeMapping"`
// The list of identity providers.
IdpIdentifiers []string `pulumi:"idpIdentifiers"`
// The map of identity details, such as access token
ProviderDetails map[string]interface{} `pulumi:"providerDetails"`
// The provider name
ProviderName *string `pulumi:"providerName"`
// The provider type. [See AWS API for valid values](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-ProviderType)
ProviderType *string `pulumi:"providerType"`
// The user pool id
UserPoolId *string `pulumi:"userPoolId"`
}
type IdentityProviderState struct {
// The map of attribute mapping of user pool attributes. [AttributeMapping in AWS API documentation](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-AttributeMapping)
AttributeMapping pulumi.MapInput
// The list of identity providers.
IdpIdentifiers pulumi.StringArrayInput
// The map of identity details, such as access token
ProviderDetails pulumi.MapInput
// The provider name
ProviderName pulumi.StringPtrInput
// The provider type. [See AWS API for valid values](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-ProviderType)
ProviderType pulumi.StringPtrInput
// The user pool id
UserPoolId pulumi.StringPtrInput
}
func (IdentityProviderState) ElementType() reflect.Type {
return reflect.TypeOf((*identityProviderState)(nil)).Elem()
}
type identityProviderArgs struct {
// The map of attribute mapping of user pool attributes. [AttributeMapping in AWS API documentation](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-AttributeMapping)
AttributeMapping map[string]interface{} `pulumi:"attributeMapping"`
// The list of identity providers.
IdpIdentifiers []string `pulumi:"idpIdentifiers"`
// The map of identity details, such as access token
ProviderDetails map[string]interface{} `pulumi:"providerDetails"`
// The provider name
ProviderName string `pulumi:"providerName"`
// The provider type. [See AWS API for valid values](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-ProviderType)
ProviderType string `pulumi:"providerType"`
// The user pool id
UserPoolId string `pulumi:"userPoolId"`
}
// The set of arguments for constructing a IdentityProvider resource.
type IdentityProviderArgs struct {
// The map of attribute mapping of user pool attributes. [AttributeMapping in AWS API documentation](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-AttributeMapping)
AttributeMapping pulumi.MapInput
// The list of identity providers.
IdpIdentifiers pulumi.StringArrayInput
// The map of identity details, such as access token
ProviderDetails pulumi.MapInput
// The provider name
ProviderName pulumi.StringInput
// The provider type. [See AWS API for valid values](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateIdentityProvider.html#CognitoUserPools-CreateIdentityProvider-request-ProviderType)
ProviderType pulumi.StringInput
// The user pool id
UserPoolId pulumi.StringInput
}
func (IdentityProviderArgs) ElementType() reflect.Type {
return reflect.TypeOf((*identityProviderArgs)(nil)).Elem()
}