/
identityPoolRoleAttachment.go
262 lines (213 loc) · 11.6 KB
/
identityPoolRoleAttachment.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cognito
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an AWS Cognito Identity Pool Roles Attachment.
//
// ## Import
//
// Using `pulumi import`, import Cognito Identity Pool Roles Attachment using the Identity Pool ID. For example:
//
// ```sh
// $ pulumi import aws:cognito/identityPoolRoleAttachment:IdentityPoolRoleAttachment example us-west-2:b64805ad-cb56-40ba-9ffc-f5d8207e6d42
// ```
type IdentityPoolRoleAttachment struct {
pulumi.CustomResourceState
// An identity pool ID in the format `REGION_GUID`.
IdentityPoolId pulumi.StringOutput `pulumi:"identityPoolId"`
// A List of Role Mapping.
RoleMappings IdentityPoolRoleAttachmentRoleMappingArrayOutput `pulumi:"roleMappings"`
// The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
Roles pulumi.StringMapOutput `pulumi:"roles"`
}
// NewIdentityPoolRoleAttachment registers a new resource with the given unique name, arguments, and options.
func NewIdentityPoolRoleAttachment(ctx *pulumi.Context,
name string, args *IdentityPoolRoleAttachmentArgs, opts ...pulumi.ResourceOption) (*IdentityPoolRoleAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.IdentityPoolId == nil {
return nil, errors.New("invalid value for required argument 'IdentityPoolId'")
}
if args.Roles == nil {
return nil, errors.New("invalid value for required argument 'Roles'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource IdentityPoolRoleAttachment
err := ctx.RegisterResource("aws:cognito/identityPoolRoleAttachment:IdentityPoolRoleAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIdentityPoolRoleAttachment gets an existing IdentityPoolRoleAttachment 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 GetIdentityPoolRoleAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IdentityPoolRoleAttachmentState, opts ...pulumi.ResourceOption) (*IdentityPoolRoleAttachment, error) {
var resource IdentityPoolRoleAttachment
err := ctx.ReadResource("aws:cognito/identityPoolRoleAttachment:IdentityPoolRoleAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IdentityPoolRoleAttachment resources.
type identityPoolRoleAttachmentState struct {
// An identity pool ID in the format `REGION_GUID`.
IdentityPoolId *string `pulumi:"identityPoolId"`
// A List of Role Mapping.
RoleMappings []IdentityPoolRoleAttachmentRoleMapping `pulumi:"roleMappings"`
// The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
Roles map[string]string `pulumi:"roles"`
}
type IdentityPoolRoleAttachmentState struct {
// An identity pool ID in the format `REGION_GUID`.
IdentityPoolId pulumi.StringPtrInput
// A List of Role Mapping.
RoleMappings IdentityPoolRoleAttachmentRoleMappingArrayInput
// The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
Roles pulumi.StringMapInput
}
func (IdentityPoolRoleAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*identityPoolRoleAttachmentState)(nil)).Elem()
}
type identityPoolRoleAttachmentArgs struct {
// An identity pool ID in the format `REGION_GUID`.
IdentityPoolId string `pulumi:"identityPoolId"`
// A List of Role Mapping.
RoleMappings []IdentityPoolRoleAttachmentRoleMapping `pulumi:"roleMappings"`
// The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
Roles map[string]string `pulumi:"roles"`
}
// The set of arguments for constructing a IdentityPoolRoleAttachment resource.
type IdentityPoolRoleAttachmentArgs struct {
// An identity pool ID in the format `REGION_GUID`.
IdentityPoolId pulumi.StringInput
// A List of Role Mapping.
RoleMappings IdentityPoolRoleAttachmentRoleMappingArrayInput
// The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
Roles pulumi.StringMapInput
}
func (IdentityPoolRoleAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*identityPoolRoleAttachmentArgs)(nil)).Elem()
}
type IdentityPoolRoleAttachmentInput interface {
pulumi.Input
ToIdentityPoolRoleAttachmentOutput() IdentityPoolRoleAttachmentOutput
ToIdentityPoolRoleAttachmentOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentOutput
}
func (*IdentityPoolRoleAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**IdentityPoolRoleAttachment)(nil)).Elem()
}
func (i *IdentityPoolRoleAttachment) ToIdentityPoolRoleAttachmentOutput() IdentityPoolRoleAttachmentOutput {
return i.ToIdentityPoolRoleAttachmentOutputWithContext(context.Background())
}
func (i *IdentityPoolRoleAttachment) ToIdentityPoolRoleAttachmentOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(IdentityPoolRoleAttachmentOutput)
}
// IdentityPoolRoleAttachmentArrayInput is an input type that accepts IdentityPoolRoleAttachmentArray and IdentityPoolRoleAttachmentArrayOutput values.
// You can construct a concrete instance of `IdentityPoolRoleAttachmentArrayInput` via:
//
// IdentityPoolRoleAttachmentArray{ IdentityPoolRoleAttachmentArgs{...} }
type IdentityPoolRoleAttachmentArrayInput interface {
pulumi.Input
ToIdentityPoolRoleAttachmentArrayOutput() IdentityPoolRoleAttachmentArrayOutput
ToIdentityPoolRoleAttachmentArrayOutputWithContext(context.Context) IdentityPoolRoleAttachmentArrayOutput
}
type IdentityPoolRoleAttachmentArray []IdentityPoolRoleAttachmentInput
func (IdentityPoolRoleAttachmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IdentityPoolRoleAttachment)(nil)).Elem()
}
func (i IdentityPoolRoleAttachmentArray) ToIdentityPoolRoleAttachmentArrayOutput() IdentityPoolRoleAttachmentArrayOutput {
return i.ToIdentityPoolRoleAttachmentArrayOutputWithContext(context.Background())
}
func (i IdentityPoolRoleAttachmentArray) ToIdentityPoolRoleAttachmentArrayOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IdentityPoolRoleAttachmentArrayOutput)
}
// IdentityPoolRoleAttachmentMapInput is an input type that accepts IdentityPoolRoleAttachmentMap and IdentityPoolRoleAttachmentMapOutput values.
// You can construct a concrete instance of `IdentityPoolRoleAttachmentMapInput` via:
//
// IdentityPoolRoleAttachmentMap{ "key": IdentityPoolRoleAttachmentArgs{...} }
type IdentityPoolRoleAttachmentMapInput interface {
pulumi.Input
ToIdentityPoolRoleAttachmentMapOutput() IdentityPoolRoleAttachmentMapOutput
ToIdentityPoolRoleAttachmentMapOutputWithContext(context.Context) IdentityPoolRoleAttachmentMapOutput
}
type IdentityPoolRoleAttachmentMap map[string]IdentityPoolRoleAttachmentInput
func (IdentityPoolRoleAttachmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IdentityPoolRoleAttachment)(nil)).Elem()
}
func (i IdentityPoolRoleAttachmentMap) ToIdentityPoolRoleAttachmentMapOutput() IdentityPoolRoleAttachmentMapOutput {
return i.ToIdentityPoolRoleAttachmentMapOutputWithContext(context.Background())
}
func (i IdentityPoolRoleAttachmentMap) ToIdentityPoolRoleAttachmentMapOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IdentityPoolRoleAttachmentMapOutput)
}
type IdentityPoolRoleAttachmentOutput struct{ *pulumi.OutputState }
func (IdentityPoolRoleAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**IdentityPoolRoleAttachment)(nil)).Elem()
}
func (o IdentityPoolRoleAttachmentOutput) ToIdentityPoolRoleAttachmentOutput() IdentityPoolRoleAttachmentOutput {
return o
}
func (o IdentityPoolRoleAttachmentOutput) ToIdentityPoolRoleAttachmentOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentOutput {
return o
}
// An identity pool ID in the format `REGION_GUID`.
func (o IdentityPoolRoleAttachmentOutput) IdentityPoolId() pulumi.StringOutput {
return o.ApplyT(func(v *IdentityPoolRoleAttachment) pulumi.StringOutput { return v.IdentityPoolId }).(pulumi.StringOutput)
}
// A List of Role Mapping.
func (o IdentityPoolRoleAttachmentOutput) RoleMappings() IdentityPoolRoleAttachmentRoleMappingArrayOutput {
return o.ApplyT(func(v *IdentityPoolRoleAttachment) IdentityPoolRoleAttachmentRoleMappingArrayOutput {
return v.RoleMappings
}).(IdentityPoolRoleAttachmentRoleMappingArrayOutput)
}
// The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN.
func (o IdentityPoolRoleAttachmentOutput) Roles() pulumi.StringMapOutput {
return o.ApplyT(func(v *IdentityPoolRoleAttachment) pulumi.StringMapOutput { return v.Roles }).(pulumi.StringMapOutput)
}
type IdentityPoolRoleAttachmentArrayOutput struct{ *pulumi.OutputState }
func (IdentityPoolRoleAttachmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IdentityPoolRoleAttachment)(nil)).Elem()
}
func (o IdentityPoolRoleAttachmentArrayOutput) ToIdentityPoolRoleAttachmentArrayOutput() IdentityPoolRoleAttachmentArrayOutput {
return o
}
func (o IdentityPoolRoleAttachmentArrayOutput) ToIdentityPoolRoleAttachmentArrayOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentArrayOutput {
return o
}
func (o IdentityPoolRoleAttachmentArrayOutput) Index(i pulumi.IntInput) IdentityPoolRoleAttachmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IdentityPoolRoleAttachment {
return vs[0].([]*IdentityPoolRoleAttachment)[vs[1].(int)]
}).(IdentityPoolRoleAttachmentOutput)
}
type IdentityPoolRoleAttachmentMapOutput struct{ *pulumi.OutputState }
func (IdentityPoolRoleAttachmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IdentityPoolRoleAttachment)(nil)).Elem()
}
func (o IdentityPoolRoleAttachmentMapOutput) ToIdentityPoolRoleAttachmentMapOutput() IdentityPoolRoleAttachmentMapOutput {
return o
}
func (o IdentityPoolRoleAttachmentMapOutput) ToIdentityPoolRoleAttachmentMapOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentMapOutput {
return o
}
func (o IdentityPoolRoleAttachmentMapOutput) MapIndex(k pulumi.StringInput) IdentityPoolRoleAttachmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IdentityPoolRoleAttachment {
return vs[0].(map[string]*IdentityPoolRoleAttachment)[vs[1].(string)]
}).(IdentityPoolRoleAttachmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*IdentityPoolRoleAttachmentInput)(nil)).Elem(), &IdentityPoolRoleAttachment{})
pulumi.RegisterInputType(reflect.TypeOf((*IdentityPoolRoleAttachmentArrayInput)(nil)).Elem(), IdentityPoolRoleAttachmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*IdentityPoolRoleAttachmentMapInput)(nil)).Elem(), IdentityPoolRoleAttachmentMap{})
pulumi.RegisterOutputType(IdentityPoolRoleAttachmentOutput{})
pulumi.RegisterOutputType(IdentityPoolRoleAttachmentArrayOutput{})
pulumi.RegisterOutputType(IdentityPoolRoleAttachmentMapOutput{})
}