github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cognito/identityPool.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 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides an AWS Cognito Identity Pool. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cognito" 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" 27 // "github.com/pulumi/pulumi-std/sdk/go/std" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // invokeFile, err := std.File(ctx, &std.FileArgs{ 35 // Input: "saml-metadata.xml", 36 // }, nil) 37 // if err != nil { 38 // return err 39 // } 40 // _, err = iam.NewSamlProvider(ctx, "default", &iam.SamlProviderArgs{ 41 // Name: pulumi.String("my-saml-provider"), 42 // SamlMetadataDocument: invokeFile.Result, 43 // }) 44 // if err != nil { 45 // return err 46 // } 47 // _, err = cognito.NewIdentityPool(ctx, "main", &cognito.IdentityPoolArgs{ 48 // IdentityPoolName: pulumi.String("identity pool"), 49 // AllowUnauthenticatedIdentities: pulumi.Bool(false), 50 // AllowClassicFlow: pulumi.Bool(false), 51 // CognitoIdentityProviders: cognito.IdentityPoolCognitoIdentityProviderArray{ 52 // &cognito.IdentityPoolCognitoIdentityProviderArgs{ 53 // ClientId: pulumi.String("6lhlkkfbfb4q5kpp90urffae"), 54 // ProviderName: pulumi.String("cognito-idp.us-east-1.amazonaws.com/us-east-1_Tv0493apJ"), 55 // ServerSideTokenCheck: pulumi.Bool(false), 56 // }, 57 // &cognito.IdentityPoolCognitoIdentityProviderArgs{ 58 // ClientId: pulumi.String("7kodkvfqfb4qfkp39eurffae"), 59 // ProviderName: pulumi.String("cognito-idp.us-east-1.amazonaws.com/eu-west-1_Zr231apJu"), 60 // ServerSideTokenCheck: pulumi.Bool(false), 61 // }, 62 // }, 63 // SupportedLoginProviders: pulumi.StringMap{ 64 // "graph.facebook.com": pulumi.String("7346241598935552"), 65 // "accounts.google.com": pulumi.String("123456789012.apps.googleusercontent.com"), 66 // }, 67 // SamlProviderArns: pulumi.StringArray{ 68 // _default.Arn, 69 // }, 70 // OpenidConnectProviderArns: pulumi.StringArray{ 71 // pulumi.String("arn:aws:iam::123456789012:oidc-provider/id.example.com"), 72 // }, 73 // }) 74 // if err != nil { 75 // return err 76 // } 77 // return nil 78 // }) 79 // } 80 // 81 // ``` 82 // <!--End PulumiCodeChooser --> 83 // 84 // ## Import 85 // 86 // Using `pulumi import`, import Cognito Identity Pool using its ID. For example: 87 // 88 // ```sh 89 // $ pulumi import aws:cognito/identityPool:IdentityPool mypool us-west-2:1a234567-8901-234b-5cde-f6789g01h2i3 90 // ``` 91 type IdentityPool struct { 92 pulumi.CustomResourceState 93 94 // Enables or disables the classic / basic authentication flow. Default is `false`. 95 AllowClassicFlow pulumi.BoolPtrOutput `pulumi:"allowClassicFlow"` 96 // Whether the identity pool supports unauthenticated logins or not. 97 AllowUnauthenticatedIdentities pulumi.BoolPtrOutput `pulumi:"allowUnauthenticatedIdentities"` 98 // The ARN of the identity pool. 99 Arn pulumi.StringOutput `pulumi:"arn"` 100 // An array of Amazon Cognito Identity user pools and their client IDs. 101 CognitoIdentityProviders IdentityPoolCognitoIdentityProviderArrayOutput `pulumi:"cognitoIdentityProviders"` 102 // The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your 103 // backend and the Cognito service to communicate about the developer provider. 104 DeveloperProviderName pulumi.StringPtrOutput `pulumi:"developerProviderName"` 105 // The Cognito Identity Pool name. 106 IdentityPoolName pulumi.StringOutput `pulumi:"identityPoolName"` 107 // Set of OpendID Connect provider ARNs. 108 OpenidConnectProviderArns pulumi.StringArrayOutput `pulumi:"openidConnectProviderArns"` 109 // An array of Amazon Resource Names (ARNs) of the SAML provider for your identity. 110 SamlProviderArns pulumi.StringArrayOutput `pulumi:"samlProviderArns"` 111 // Key-Value pairs mapping provider names to provider app IDs. 112 SupportedLoginProviders pulumi.StringMapOutput `pulumi:"supportedLoginProviders"` 113 // A map of tags to assign to the Identity Pool. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 114 Tags pulumi.StringMapOutput `pulumi:"tags"` 115 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 116 // 117 // Deprecated: Please use `tags` instead. 118 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 119 } 120 121 // NewIdentityPool registers a new resource with the given unique name, arguments, and options. 122 func NewIdentityPool(ctx *pulumi.Context, 123 name string, args *IdentityPoolArgs, opts ...pulumi.ResourceOption) (*IdentityPool, error) { 124 if args == nil { 125 return nil, errors.New("missing one or more required arguments") 126 } 127 128 if args.IdentityPoolName == nil { 129 return nil, errors.New("invalid value for required argument 'IdentityPoolName'") 130 } 131 opts = internal.PkgResourceDefaultOpts(opts) 132 var resource IdentityPool 133 err := ctx.RegisterResource("aws:cognito/identityPool:IdentityPool", name, args, &resource, opts...) 134 if err != nil { 135 return nil, err 136 } 137 return &resource, nil 138 } 139 140 // GetIdentityPool gets an existing IdentityPool resource's state with the given name, ID, and optional 141 // state properties that are used to uniquely qualify the lookup (nil if not required). 142 func GetIdentityPool(ctx *pulumi.Context, 143 name string, id pulumi.IDInput, state *IdentityPoolState, opts ...pulumi.ResourceOption) (*IdentityPool, error) { 144 var resource IdentityPool 145 err := ctx.ReadResource("aws:cognito/identityPool:IdentityPool", name, id, state, &resource, opts...) 146 if err != nil { 147 return nil, err 148 } 149 return &resource, nil 150 } 151 152 // Input properties used for looking up and filtering IdentityPool resources. 153 type identityPoolState struct { 154 // Enables or disables the classic / basic authentication flow. Default is `false`. 155 AllowClassicFlow *bool `pulumi:"allowClassicFlow"` 156 // Whether the identity pool supports unauthenticated logins or not. 157 AllowUnauthenticatedIdentities *bool `pulumi:"allowUnauthenticatedIdentities"` 158 // The ARN of the identity pool. 159 Arn *string `pulumi:"arn"` 160 // An array of Amazon Cognito Identity user pools and their client IDs. 161 CognitoIdentityProviders []IdentityPoolCognitoIdentityProvider `pulumi:"cognitoIdentityProviders"` 162 // The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your 163 // backend and the Cognito service to communicate about the developer provider. 164 DeveloperProviderName *string `pulumi:"developerProviderName"` 165 // The Cognito Identity Pool name. 166 IdentityPoolName *string `pulumi:"identityPoolName"` 167 // Set of OpendID Connect provider ARNs. 168 OpenidConnectProviderArns []string `pulumi:"openidConnectProviderArns"` 169 // An array of Amazon Resource Names (ARNs) of the SAML provider for your identity. 170 SamlProviderArns []string `pulumi:"samlProviderArns"` 171 // Key-Value pairs mapping provider names to provider app IDs. 172 SupportedLoginProviders map[string]string `pulumi:"supportedLoginProviders"` 173 // A map of tags to assign to the Identity Pool. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 174 Tags map[string]string `pulumi:"tags"` 175 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 176 // 177 // Deprecated: Please use `tags` instead. 178 TagsAll map[string]string `pulumi:"tagsAll"` 179 } 180 181 type IdentityPoolState struct { 182 // Enables or disables the classic / basic authentication flow. Default is `false`. 183 AllowClassicFlow pulumi.BoolPtrInput 184 // Whether the identity pool supports unauthenticated logins or not. 185 AllowUnauthenticatedIdentities pulumi.BoolPtrInput 186 // The ARN of the identity pool. 187 Arn pulumi.StringPtrInput 188 // An array of Amazon Cognito Identity user pools and their client IDs. 189 CognitoIdentityProviders IdentityPoolCognitoIdentityProviderArrayInput 190 // The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your 191 // backend and the Cognito service to communicate about the developer provider. 192 DeveloperProviderName pulumi.StringPtrInput 193 // The Cognito Identity Pool name. 194 IdentityPoolName pulumi.StringPtrInput 195 // Set of OpendID Connect provider ARNs. 196 OpenidConnectProviderArns pulumi.StringArrayInput 197 // An array of Amazon Resource Names (ARNs) of the SAML provider for your identity. 198 SamlProviderArns pulumi.StringArrayInput 199 // Key-Value pairs mapping provider names to provider app IDs. 200 SupportedLoginProviders pulumi.StringMapInput 201 // A map of tags to assign to the Identity Pool. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 202 Tags pulumi.StringMapInput 203 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 204 // 205 // Deprecated: Please use `tags` instead. 206 TagsAll pulumi.StringMapInput 207 } 208 209 func (IdentityPoolState) ElementType() reflect.Type { 210 return reflect.TypeOf((*identityPoolState)(nil)).Elem() 211 } 212 213 type identityPoolArgs struct { 214 // Enables or disables the classic / basic authentication flow. Default is `false`. 215 AllowClassicFlow *bool `pulumi:"allowClassicFlow"` 216 // Whether the identity pool supports unauthenticated logins or not. 217 AllowUnauthenticatedIdentities *bool `pulumi:"allowUnauthenticatedIdentities"` 218 // An array of Amazon Cognito Identity user pools and their client IDs. 219 CognitoIdentityProviders []IdentityPoolCognitoIdentityProvider `pulumi:"cognitoIdentityProviders"` 220 // The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your 221 // backend and the Cognito service to communicate about the developer provider. 222 DeveloperProviderName *string `pulumi:"developerProviderName"` 223 // The Cognito Identity Pool name. 224 IdentityPoolName string `pulumi:"identityPoolName"` 225 // Set of OpendID Connect provider ARNs. 226 OpenidConnectProviderArns []string `pulumi:"openidConnectProviderArns"` 227 // An array of Amazon Resource Names (ARNs) of the SAML provider for your identity. 228 SamlProviderArns []string `pulumi:"samlProviderArns"` 229 // Key-Value pairs mapping provider names to provider app IDs. 230 SupportedLoginProviders map[string]string `pulumi:"supportedLoginProviders"` 231 // A map of tags to assign to the Identity Pool. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 232 Tags map[string]string `pulumi:"tags"` 233 } 234 235 // The set of arguments for constructing a IdentityPool resource. 236 type IdentityPoolArgs struct { 237 // Enables or disables the classic / basic authentication flow. Default is `false`. 238 AllowClassicFlow pulumi.BoolPtrInput 239 // Whether the identity pool supports unauthenticated logins or not. 240 AllowUnauthenticatedIdentities pulumi.BoolPtrInput 241 // An array of Amazon Cognito Identity user pools and their client IDs. 242 CognitoIdentityProviders IdentityPoolCognitoIdentityProviderArrayInput 243 // The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your 244 // backend and the Cognito service to communicate about the developer provider. 245 DeveloperProviderName pulumi.StringPtrInput 246 // The Cognito Identity Pool name. 247 IdentityPoolName pulumi.StringInput 248 // Set of OpendID Connect provider ARNs. 249 OpenidConnectProviderArns pulumi.StringArrayInput 250 // An array of Amazon Resource Names (ARNs) of the SAML provider for your identity. 251 SamlProviderArns pulumi.StringArrayInput 252 // Key-Value pairs mapping provider names to provider app IDs. 253 SupportedLoginProviders pulumi.StringMapInput 254 // A map of tags to assign to the Identity Pool. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 255 Tags pulumi.StringMapInput 256 } 257 258 func (IdentityPoolArgs) ElementType() reflect.Type { 259 return reflect.TypeOf((*identityPoolArgs)(nil)).Elem() 260 } 261 262 type IdentityPoolInput interface { 263 pulumi.Input 264 265 ToIdentityPoolOutput() IdentityPoolOutput 266 ToIdentityPoolOutputWithContext(ctx context.Context) IdentityPoolOutput 267 } 268 269 func (*IdentityPool) ElementType() reflect.Type { 270 return reflect.TypeOf((**IdentityPool)(nil)).Elem() 271 } 272 273 func (i *IdentityPool) ToIdentityPoolOutput() IdentityPoolOutput { 274 return i.ToIdentityPoolOutputWithContext(context.Background()) 275 } 276 277 func (i *IdentityPool) ToIdentityPoolOutputWithContext(ctx context.Context) IdentityPoolOutput { 278 return pulumi.ToOutputWithContext(ctx, i).(IdentityPoolOutput) 279 } 280 281 // IdentityPoolArrayInput is an input type that accepts IdentityPoolArray and IdentityPoolArrayOutput values. 282 // You can construct a concrete instance of `IdentityPoolArrayInput` via: 283 // 284 // IdentityPoolArray{ IdentityPoolArgs{...} } 285 type IdentityPoolArrayInput interface { 286 pulumi.Input 287 288 ToIdentityPoolArrayOutput() IdentityPoolArrayOutput 289 ToIdentityPoolArrayOutputWithContext(context.Context) IdentityPoolArrayOutput 290 } 291 292 type IdentityPoolArray []IdentityPoolInput 293 294 func (IdentityPoolArray) ElementType() reflect.Type { 295 return reflect.TypeOf((*[]*IdentityPool)(nil)).Elem() 296 } 297 298 func (i IdentityPoolArray) ToIdentityPoolArrayOutput() IdentityPoolArrayOutput { 299 return i.ToIdentityPoolArrayOutputWithContext(context.Background()) 300 } 301 302 func (i IdentityPoolArray) ToIdentityPoolArrayOutputWithContext(ctx context.Context) IdentityPoolArrayOutput { 303 return pulumi.ToOutputWithContext(ctx, i).(IdentityPoolArrayOutput) 304 } 305 306 // IdentityPoolMapInput is an input type that accepts IdentityPoolMap and IdentityPoolMapOutput values. 307 // You can construct a concrete instance of `IdentityPoolMapInput` via: 308 // 309 // IdentityPoolMap{ "key": IdentityPoolArgs{...} } 310 type IdentityPoolMapInput interface { 311 pulumi.Input 312 313 ToIdentityPoolMapOutput() IdentityPoolMapOutput 314 ToIdentityPoolMapOutputWithContext(context.Context) IdentityPoolMapOutput 315 } 316 317 type IdentityPoolMap map[string]IdentityPoolInput 318 319 func (IdentityPoolMap) ElementType() reflect.Type { 320 return reflect.TypeOf((*map[string]*IdentityPool)(nil)).Elem() 321 } 322 323 func (i IdentityPoolMap) ToIdentityPoolMapOutput() IdentityPoolMapOutput { 324 return i.ToIdentityPoolMapOutputWithContext(context.Background()) 325 } 326 327 func (i IdentityPoolMap) ToIdentityPoolMapOutputWithContext(ctx context.Context) IdentityPoolMapOutput { 328 return pulumi.ToOutputWithContext(ctx, i).(IdentityPoolMapOutput) 329 } 330 331 type IdentityPoolOutput struct{ *pulumi.OutputState } 332 333 func (IdentityPoolOutput) ElementType() reflect.Type { 334 return reflect.TypeOf((**IdentityPool)(nil)).Elem() 335 } 336 337 func (o IdentityPoolOutput) ToIdentityPoolOutput() IdentityPoolOutput { 338 return o 339 } 340 341 func (o IdentityPoolOutput) ToIdentityPoolOutputWithContext(ctx context.Context) IdentityPoolOutput { 342 return o 343 } 344 345 // Enables or disables the classic / basic authentication flow. Default is `false`. 346 func (o IdentityPoolOutput) AllowClassicFlow() pulumi.BoolPtrOutput { 347 return o.ApplyT(func(v *IdentityPool) pulumi.BoolPtrOutput { return v.AllowClassicFlow }).(pulumi.BoolPtrOutput) 348 } 349 350 // Whether the identity pool supports unauthenticated logins or not. 351 func (o IdentityPoolOutput) AllowUnauthenticatedIdentities() pulumi.BoolPtrOutput { 352 return o.ApplyT(func(v *IdentityPool) pulumi.BoolPtrOutput { return v.AllowUnauthenticatedIdentities }).(pulumi.BoolPtrOutput) 353 } 354 355 // The ARN of the identity pool. 356 func (o IdentityPoolOutput) Arn() pulumi.StringOutput { 357 return o.ApplyT(func(v *IdentityPool) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 358 } 359 360 // An array of Amazon Cognito Identity user pools and their client IDs. 361 func (o IdentityPoolOutput) CognitoIdentityProviders() IdentityPoolCognitoIdentityProviderArrayOutput { 362 return o.ApplyT(func(v *IdentityPool) IdentityPoolCognitoIdentityProviderArrayOutput { 363 return v.CognitoIdentityProviders 364 }).(IdentityPoolCognitoIdentityProviderArrayOutput) 365 } 366 367 // The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your 368 // backend and the Cognito service to communicate about the developer provider. 369 func (o IdentityPoolOutput) DeveloperProviderName() pulumi.StringPtrOutput { 370 return o.ApplyT(func(v *IdentityPool) pulumi.StringPtrOutput { return v.DeveloperProviderName }).(pulumi.StringPtrOutput) 371 } 372 373 // The Cognito Identity Pool name. 374 func (o IdentityPoolOutput) IdentityPoolName() pulumi.StringOutput { 375 return o.ApplyT(func(v *IdentityPool) pulumi.StringOutput { return v.IdentityPoolName }).(pulumi.StringOutput) 376 } 377 378 // Set of OpendID Connect provider ARNs. 379 func (o IdentityPoolOutput) OpenidConnectProviderArns() pulumi.StringArrayOutput { 380 return o.ApplyT(func(v *IdentityPool) pulumi.StringArrayOutput { return v.OpenidConnectProviderArns }).(pulumi.StringArrayOutput) 381 } 382 383 // An array of Amazon Resource Names (ARNs) of the SAML provider for your identity. 384 func (o IdentityPoolOutput) SamlProviderArns() pulumi.StringArrayOutput { 385 return o.ApplyT(func(v *IdentityPool) pulumi.StringArrayOutput { return v.SamlProviderArns }).(pulumi.StringArrayOutput) 386 } 387 388 // Key-Value pairs mapping provider names to provider app IDs. 389 func (o IdentityPoolOutput) SupportedLoginProviders() pulumi.StringMapOutput { 390 return o.ApplyT(func(v *IdentityPool) pulumi.StringMapOutput { return v.SupportedLoginProviders }).(pulumi.StringMapOutput) 391 } 392 393 // A map of tags to assign to the Identity Pool. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 394 func (o IdentityPoolOutput) Tags() pulumi.StringMapOutput { 395 return o.ApplyT(func(v *IdentityPool) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 396 } 397 398 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 399 // 400 // Deprecated: Please use `tags` instead. 401 func (o IdentityPoolOutput) TagsAll() pulumi.StringMapOutput { 402 return o.ApplyT(func(v *IdentityPool) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 403 } 404 405 type IdentityPoolArrayOutput struct{ *pulumi.OutputState } 406 407 func (IdentityPoolArrayOutput) ElementType() reflect.Type { 408 return reflect.TypeOf((*[]*IdentityPool)(nil)).Elem() 409 } 410 411 func (o IdentityPoolArrayOutput) ToIdentityPoolArrayOutput() IdentityPoolArrayOutput { 412 return o 413 } 414 415 func (o IdentityPoolArrayOutput) ToIdentityPoolArrayOutputWithContext(ctx context.Context) IdentityPoolArrayOutput { 416 return o 417 } 418 419 func (o IdentityPoolArrayOutput) Index(i pulumi.IntInput) IdentityPoolOutput { 420 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IdentityPool { 421 return vs[0].([]*IdentityPool)[vs[1].(int)] 422 }).(IdentityPoolOutput) 423 } 424 425 type IdentityPoolMapOutput struct{ *pulumi.OutputState } 426 427 func (IdentityPoolMapOutput) ElementType() reflect.Type { 428 return reflect.TypeOf((*map[string]*IdentityPool)(nil)).Elem() 429 } 430 431 func (o IdentityPoolMapOutput) ToIdentityPoolMapOutput() IdentityPoolMapOutput { 432 return o 433 } 434 435 func (o IdentityPoolMapOutput) ToIdentityPoolMapOutputWithContext(ctx context.Context) IdentityPoolMapOutput { 436 return o 437 } 438 439 func (o IdentityPoolMapOutput) MapIndex(k pulumi.StringInput) IdentityPoolOutput { 440 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IdentityPool { 441 return vs[0].(map[string]*IdentityPool)[vs[1].(string)] 442 }).(IdentityPoolOutput) 443 } 444 445 func init() { 446 pulumi.RegisterInputType(reflect.TypeOf((*IdentityPoolInput)(nil)).Elem(), &IdentityPool{}) 447 pulumi.RegisterInputType(reflect.TypeOf((*IdentityPoolArrayInput)(nil)).Elem(), IdentityPoolArray{}) 448 pulumi.RegisterInputType(reflect.TypeOf((*IdentityPoolMapInput)(nil)).Elem(), IdentityPoolMap{}) 449 pulumi.RegisterOutputType(IdentityPoolOutput{}) 450 pulumi.RegisterOutputType(IdentityPoolArrayOutput{}) 451 pulumi.RegisterOutputType(IdentityPoolMapOutput{}) 452 }