github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cognito/managedUserPoolClient.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 // Use the `cognito.UserPoolClient` resource to manage a Cognito User Pool Client. 16 // 17 // **This resource is advanced** and has special caveats to consider before use. Please read this document completely before using the resource. 18 // 19 // Use the `cognito.ManagedUserPoolClient` resource to manage a Cognito User Pool Client that is automatically created by an AWS service. For instance, when [configuring an OpenSearch Domain to use Cognito authentication](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html), the OpenSearch service creates the User Pool Client during setup and removes it when it is no longer required. As a result, the `cognito.ManagedUserPoolClient` resource does not create or delete this resource, but instead assumes management of it. 20 // 21 // Use the `cognito.UserPoolClient` resource to manage Cognito User Pool Clients for normal use cases. 22 // 23 // ## Example Usage 24 // 25 // <!--Start PulumiCodeChooser --> 26 // ```go 27 // package main 28 // 29 // import ( 30 // 31 // "fmt" 32 // 33 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" 34 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cognito" 35 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" 36 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch" 37 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 38 // 39 // ) 40 // 41 // func main() { 42 // pulumi.Run(func(ctx *pulumi.Context) error { 43 // exampleUserPool, err := cognito.NewUserPool(ctx, "example", &cognito.UserPoolArgs{ 44 // Name: pulumi.String("example"), 45 // }) 46 // if err != nil { 47 // return err 48 // } 49 // exampleIdentityPool, err := cognito.NewIdentityPool(ctx, "example", &cognito.IdentityPoolArgs{ 50 // IdentityPoolName: pulumi.String("example"), 51 // }) 52 // if err != nil { 53 // return err 54 // } 55 // current, err := aws.GetPartition(ctx, nil, nil) 56 // if err != nil { 57 // return err 58 // } 59 // example, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{ 60 // Statements: []iam.GetPolicyDocumentStatement{ 61 // { 62 // Sid: pulumi.StringRef(""), 63 // Actions: []string{ 64 // "sts:AssumeRole", 65 // }, 66 // Effect: pulumi.StringRef("Allow"), 67 // Principals: []iam.GetPolicyDocumentStatementPrincipal{ 68 // { 69 // Type: "Service", 70 // Identifiers: []string{ 71 // fmt.Sprintf("es.%v", current.DnsSuffix), 72 // }, 73 // }, 74 // }, 75 // }, 76 // }, 77 // }, nil) 78 // if err != nil { 79 // return err 80 // } 81 // exampleRole, err := iam.NewRole(ctx, "example", &iam.RoleArgs{ 82 // Name: pulumi.String("example-role"), 83 // Path: pulumi.String("/service-role/"), 84 // AssumeRolePolicy: pulumi.String(example.Json), 85 // }) 86 // if err != nil { 87 // return err 88 // } 89 // exampleRolePolicyAttachment, err := iam.NewRolePolicyAttachment(ctx, "example", &iam.RolePolicyAttachmentArgs{ 90 // Role: exampleRole.Name, 91 // PolicyArn: pulumi.String(fmt.Sprintf("arn:%v:iam::aws:policy/AmazonESCognitoAccess", current.Partition)), 92 // }) 93 // if err != nil { 94 // return err 95 // } 96 // exampleDomain, err := opensearch.NewDomain(ctx, "example", &opensearch.DomainArgs{ 97 // DomainName: pulumi.String("example"), 98 // CognitoOptions: &opensearch.DomainCognitoOptionsArgs{ 99 // Enabled: pulumi.Bool(true), 100 // UserPoolId: exampleUserPool.ID(), 101 // IdentityPoolId: exampleIdentityPool.ID(), 102 // RoleArn: exampleRole.Arn, 103 // }, 104 // EbsOptions: &opensearch.DomainEbsOptionsArgs{ 105 // EbsEnabled: pulumi.Bool(true), 106 // VolumeSize: pulumi.Int(10), 107 // }, 108 // }, pulumi.DependsOn([]pulumi.Resource{ 109 // exampleAwsCognitoUserPoolDomain, 110 // exampleRolePolicyAttachment, 111 // })) 112 // if err != nil { 113 // return err 114 // } 115 // _, err = cognito.NewManagedUserPoolClient(ctx, "example", &cognito.ManagedUserPoolClientArgs{ 116 // NamePrefix: pulumi.String("AmazonOpenSearchService-example"), 117 // UserPoolId: exampleUserPool.ID(), 118 // }, pulumi.DependsOn([]pulumi.Resource{ 119 // exampleDomain, 120 // })) 121 // if err != nil { 122 // return err 123 // } 124 // return nil 125 // }) 126 // } 127 // 128 // ``` 129 // <!--End PulumiCodeChooser --> 130 // 131 // ## Import 132 // 133 // Using `pulumi import`, import Cognito User Pool Clients using the `id` of the Cognito User Pool and the `id` of the Cognito User Pool Client. For example: 134 // 135 // ```sh 136 // $ pulumi import aws:cognito/managedUserPoolClient:ManagedUserPoolClient client us-west-2_abc123/3ho4ek12345678909nh3fmhpko 137 // ``` 138 type ManagedUserPoolClient struct { 139 pulumi.CustomResourceState 140 141 // Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.access_token`. 142 AccessTokenValidity pulumi.IntOutput `pulumi:"accessTokenValidity"` 143 // List of allowed OAuth flows, including code, implicit, and client_credentials. 144 AllowedOauthFlows pulumi.StringArrayOutput `pulumi:"allowedOauthFlows"` 145 // Whether the client is allowed to use the OAuth protocol when interacting with Cognito user pools. 146 AllowedOauthFlowsUserPoolClient pulumi.BoolOutput `pulumi:"allowedOauthFlowsUserPoolClient"` 147 // List of allowed OAuth scopes, including phone, email, openid, profile, and aws.cognito.signin.user.admin. 148 AllowedOauthScopes pulumi.StringArrayOutput `pulumi:"allowedOauthScopes"` 149 // Configuration block for Amazon Pinpoint analytics that collects metrics for this user pool. See details below. 150 AnalyticsConfiguration ManagedUserPoolClientAnalyticsConfigurationPtrOutput `pulumi:"analyticsConfiguration"` 151 // Duration, in minutes, of the session token created by Amazon Cognito for each API request in an authentication flow. The session token must be responded to by the native user of the user pool before it expires. Valid values for `authSessionValidity` are between `3` and `15`, with a default value of `3`. 152 AuthSessionValidity pulumi.IntOutput `pulumi:"authSessionValidity"` 153 // List of allowed callback URLs for the identity providers. 154 CallbackUrls pulumi.StringArrayOutput `pulumi:"callbackUrls"` 155 // Client secret of the user pool client. 156 ClientSecret pulumi.StringOutput `pulumi:"clientSecret"` 157 // Default redirect URI and must be included in the list of callback URLs. 158 DefaultRedirectUri pulumi.StringOutput `pulumi:"defaultRedirectUri"` 159 // Enables the propagation of additional user context data. 160 EnablePropagateAdditionalUserContextData pulumi.BoolOutput `pulumi:"enablePropagateAdditionalUserContextData"` 161 // Enables or disables token revocation. 162 EnableTokenRevocation pulumi.BoolOutput `pulumi:"enableTokenRevocation"` 163 // List of authentication flows. The available options include ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH, ALLOW_ADMIN_USER_PASSWORD_AUTH, ALLOW_CUSTOM_AUTH, ALLOW_USER_PASSWORD_AUTH, ALLOW_USER_SRP_AUTH, and ALLOW_REFRESH_TOKEN_AUTH. 164 ExplicitAuthFlows pulumi.StringArrayOutput `pulumi:"explicitAuthFlows"` 165 // Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.id_token`. 166 IdTokenValidity pulumi.IntOutput `pulumi:"idTokenValidity"` 167 // List of allowed logout URLs for the identity providers. 168 LogoutUrls pulumi.StringArrayOutput `pulumi:"logoutUrls"` 169 // Name of the user pool client. 170 Name pulumi.StringOutput `pulumi:"name"` 171 // Regular expression that matches the name of the desired User Pool Client. It must only match one User Pool Client. 172 NamePattern pulumi.StringPtrOutput `pulumi:"namePattern"` 173 // String that matches the beginning of the name of the desired User Pool Client. It must match only one User Pool Client. 174 // 175 // The following arguments are optional: 176 NamePrefix pulumi.StringPtrOutput `pulumi:"namePrefix"` 177 // Setting determines the errors and responses returned by Cognito APIs when a user does not exist in the user pool during authentication, account confirmation, and password recovery. 178 PreventUserExistenceErrors pulumi.StringOutput `pulumi:"preventUserExistenceErrors"` 179 // List of user pool attributes that the application client can read from. 180 ReadAttributes pulumi.StringArrayOutput `pulumi:"readAttributes"` 181 // Time limit, between 60 minutes and 10 years, after which the refresh token is no longer valid and cannot be used. By default, the unit is days. The unit can be overridden by a value in `token_validity_units.refresh_token`. 182 RefreshTokenValidity pulumi.IntOutput `pulumi:"refreshTokenValidity"` 183 // List of provider names for the identity providers that are supported on this client. It uses the `providerName` attribute of the `cognito.IdentityProvider` resource(s), or the equivalent string(s). 184 SupportedIdentityProviders pulumi.StringArrayOutput `pulumi:"supportedIdentityProviders"` 185 // Configuration block for representing the validity times in units. See details below. Detailed below. 186 TokenValidityUnits ManagedUserPoolClientTokenValidityUnitsPtrOutput `pulumi:"tokenValidityUnits"` 187 // User pool that the client belongs to. 188 UserPoolId pulumi.StringOutput `pulumi:"userPoolId"` 189 // List of user pool attributes that the application client can write to. 190 WriteAttributes pulumi.StringArrayOutput `pulumi:"writeAttributes"` 191 } 192 193 // NewManagedUserPoolClient registers a new resource with the given unique name, arguments, and options. 194 func NewManagedUserPoolClient(ctx *pulumi.Context, 195 name string, args *ManagedUserPoolClientArgs, opts ...pulumi.ResourceOption) (*ManagedUserPoolClient, error) { 196 if args == nil { 197 return nil, errors.New("missing one or more required arguments") 198 } 199 200 if args.UserPoolId == nil { 201 return nil, errors.New("invalid value for required argument 'UserPoolId'") 202 } 203 secrets := pulumi.AdditionalSecretOutputs([]string{ 204 "clientSecret", 205 }) 206 opts = append(opts, secrets) 207 opts = internal.PkgResourceDefaultOpts(opts) 208 var resource ManagedUserPoolClient 209 err := ctx.RegisterResource("aws:cognito/managedUserPoolClient:ManagedUserPoolClient", name, args, &resource, opts...) 210 if err != nil { 211 return nil, err 212 } 213 return &resource, nil 214 } 215 216 // GetManagedUserPoolClient gets an existing ManagedUserPoolClient resource's state with the given name, ID, and optional 217 // state properties that are used to uniquely qualify the lookup (nil if not required). 218 func GetManagedUserPoolClient(ctx *pulumi.Context, 219 name string, id pulumi.IDInput, state *ManagedUserPoolClientState, opts ...pulumi.ResourceOption) (*ManagedUserPoolClient, error) { 220 var resource ManagedUserPoolClient 221 err := ctx.ReadResource("aws:cognito/managedUserPoolClient:ManagedUserPoolClient", name, id, state, &resource, opts...) 222 if err != nil { 223 return nil, err 224 } 225 return &resource, nil 226 } 227 228 // Input properties used for looking up and filtering ManagedUserPoolClient resources. 229 type managedUserPoolClientState struct { 230 // Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.access_token`. 231 AccessTokenValidity *int `pulumi:"accessTokenValidity"` 232 // List of allowed OAuth flows, including code, implicit, and client_credentials. 233 AllowedOauthFlows []string `pulumi:"allowedOauthFlows"` 234 // Whether the client is allowed to use the OAuth protocol when interacting with Cognito user pools. 235 AllowedOauthFlowsUserPoolClient *bool `pulumi:"allowedOauthFlowsUserPoolClient"` 236 // List of allowed OAuth scopes, including phone, email, openid, profile, and aws.cognito.signin.user.admin. 237 AllowedOauthScopes []string `pulumi:"allowedOauthScopes"` 238 // Configuration block for Amazon Pinpoint analytics that collects metrics for this user pool. See details below. 239 AnalyticsConfiguration *ManagedUserPoolClientAnalyticsConfiguration `pulumi:"analyticsConfiguration"` 240 // Duration, in minutes, of the session token created by Amazon Cognito for each API request in an authentication flow. The session token must be responded to by the native user of the user pool before it expires. Valid values for `authSessionValidity` are between `3` and `15`, with a default value of `3`. 241 AuthSessionValidity *int `pulumi:"authSessionValidity"` 242 // List of allowed callback URLs for the identity providers. 243 CallbackUrls []string `pulumi:"callbackUrls"` 244 // Client secret of the user pool client. 245 ClientSecret *string `pulumi:"clientSecret"` 246 // Default redirect URI and must be included in the list of callback URLs. 247 DefaultRedirectUri *string `pulumi:"defaultRedirectUri"` 248 // Enables the propagation of additional user context data. 249 EnablePropagateAdditionalUserContextData *bool `pulumi:"enablePropagateAdditionalUserContextData"` 250 // Enables or disables token revocation. 251 EnableTokenRevocation *bool `pulumi:"enableTokenRevocation"` 252 // List of authentication flows. The available options include ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH, ALLOW_ADMIN_USER_PASSWORD_AUTH, ALLOW_CUSTOM_AUTH, ALLOW_USER_PASSWORD_AUTH, ALLOW_USER_SRP_AUTH, and ALLOW_REFRESH_TOKEN_AUTH. 253 ExplicitAuthFlows []string `pulumi:"explicitAuthFlows"` 254 // Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.id_token`. 255 IdTokenValidity *int `pulumi:"idTokenValidity"` 256 // List of allowed logout URLs for the identity providers. 257 LogoutUrls []string `pulumi:"logoutUrls"` 258 // Name of the user pool client. 259 Name *string `pulumi:"name"` 260 // Regular expression that matches the name of the desired User Pool Client. It must only match one User Pool Client. 261 NamePattern *string `pulumi:"namePattern"` 262 // String that matches the beginning of the name of the desired User Pool Client. It must match only one User Pool Client. 263 // 264 // The following arguments are optional: 265 NamePrefix *string `pulumi:"namePrefix"` 266 // Setting determines the errors and responses returned by Cognito APIs when a user does not exist in the user pool during authentication, account confirmation, and password recovery. 267 PreventUserExistenceErrors *string `pulumi:"preventUserExistenceErrors"` 268 // List of user pool attributes that the application client can read from. 269 ReadAttributes []string `pulumi:"readAttributes"` 270 // Time limit, between 60 minutes and 10 years, after which the refresh token is no longer valid and cannot be used. By default, the unit is days. The unit can be overridden by a value in `token_validity_units.refresh_token`. 271 RefreshTokenValidity *int `pulumi:"refreshTokenValidity"` 272 // List of provider names for the identity providers that are supported on this client. It uses the `providerName` attribute of the `cognito.IdentityProvider` resource(s), or the equivalent string(s). 273 SupportedIdentityProviders []string `pulumi:"supportedIdentityProviders"` 274 // Configuration block for representing the validity times in units. See details below. Detailed below. 275 TokenValidityUnits *ManagedUserPoolClientTokenValidityUnits `pulumi:"tokenValidityUnits"` 276 // User pool that the client belongs to. 277 UserPoolId *string `pulumi:"userPoolId"` 278 // List of user pool attributes that the application client can write to. 279 WriteAttributes []string `pulumi:"writeAttributes"` 280 } 281 282 type ManagedUserPoolClientState struct { 283 // Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.access_token`. 284 AccessTokenValidity pulumi.IntPtrInput 285 // List of allowed OAuth flows, including code, implicit, and client_credentials. 286 AllowedOauthFlows pulumi.StringArrayInput 287 // Whether the client is allowed to use the OAuth protocol when interacting with Cognito user pools. 288 AllowedOauthFlowsUserPoolClient pulumi.BoolPtrInput 289 // List of allowed OAuth scopes, including phone, email, openid, profile, and aws.cognito.signin.user.admin. 290 AllowedOauthScopes pulumi.StringArrayInput 291 // Configuration block for Amazon Pinpoint analytics that collects metrics for this user pool. See details below. 292 AnalyticsConfiguration ManagedUserPoolClientAnalyticsConfigurationPtrInput 293 // Duration, in minutes, of the session token created by Amazon Cognito for each API request in an authentication flow. The session token must be responded to by the native user of the user pool before it expires. Valid values for `authSessionValidity` are between `3` and `15`, with a default value of `3`. 294 AuthSessionValidity pulumi.IntPtrInput 295 // List of allowed callback URLs for the identity providers. 296 CallbackUrls pulumi.StringArrayInput 297 // Client secret of the user pool client. 298 ClientSecret pulumi.StringPtrInput 299 // Default redirect URI and must be included in the list of callback URLs. 300 DefaultRedirectUri pulumi.StringPtrInput 301 // Enables the propagation of additional user context data. 302 EnablePropagateAdditionalUserContextData pulumi.BoolPtrInput 303 // Enables or disables token revocation. 304 EnableTokenRevocation pulumi.BoolPtrInput 305 // List of authentication flows. The available options include ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH, ALLOW_ADMIN_USER_PASSWORD_AUTH, ALLOW_CUSTOM_AUTH, ALLOW_USER_PASSWORD_AUTH, ALLOW_USER_SRP_AUTH, and ALLOW_REFRESH_TOKEN_AUTH. 306 ExplicitAuthFlows pulumi.StringArrayInput 307 // Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.id_token`. 308 IdTokenValidity pulumi.IntPtrInput 309 // List of allowed logout URLs for the identity providers. 310 LogoutUrls pulumi.StringArrayInput 311 // Name of the user pool client. 312 Name pulumi.StringPtrInput 313 // Regular expression that matches the name of the desired User Pool Client. It must only match one User Pool Client. 314 NamePattern pulumi.StringPtrInput 315 // String that matches the beginning of the name of the desired User Pool Client. It must match only one User Pool Client. 316 // 317 // The following arguments are optional: 318 NamePrefix pulumi.StringPtrInput 319 // Setting determines the errors and responses returned by Cognito APIs when a user does not exist in the user pool during authentication, account confirmation, and password recovery. 320 PreventUserExistenceErrors pulumi.StringPtrInput 321 // List of user pool attributes that the application client can read from. 322 ReadAttributes pulumi.StringArrayInput 323 // Time limit, between 60 minutes and 10 years, after which the refresh token is no longer valid and cannot be used. By default, the unit is days. The unit can be overridden by a value in `token_validity_units.refresh_token`. 324 RefreshTokenValidity pulumi.IntPtrInput 325 // List of provider names for the identity providers that are supported on this client. It uses the `providerName` attribute of the `cognito.IdentityProvider` resource(s), or the equivalent string(s). 326 SupportedIdentityProviders pulumi.StringArrayInput 327 // Configuration block for representing the validity times in units. See details below. Detailed below. 328 TokenValidityUnits ManagedUserPoolClientTokenValidityUnitsPtrInput 329 // User pool that the client belongs to. 330 UserPoolId pulumi.StringPtrInput 331 // List of user pool attributes that the application client can write to. 332 WriteAttributes pulumi.StringArrayInput 333 } 334 335 func (ManagedUserPoolClientState) ElementType() reflect.Type { 336 return reflect.TypeOf((*managedUserPoolClientState)(nil)).Elem() 337 } 338 339 type managedUserPoolClientArgs struct { 340 // Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.access_token`. 341 AccessTokenValidity *int `pulumi:"accessTokenValidity"` 342 // List of allowed OAuth flows, including code, implicit, and client_credentials. 343 AllowedOauthFlows []string `pulumi:"allowedOauthFlows"` 344 // Whether the client is allowed to use the OAuth protocol when interacting with Cognito user pools. 345 AllowedOauthFlowsUserPoolClient *bool `pulumi:"allowedOauthFlowsUserPoolClient"` 346 // List of allowed OAuth scopes, including phone, email, openid, profile, and aws.cognito.signin.user.admin. 347 AllowedOauthScopes []string `pulumi:"allowedOauthScopes"` 348 // Configuration block for Amazon Pinpoint analytics that collects metrics for this user pool. See details below. 349 AnalyticsConfiguration *ManagedUserPoolClientAnalyticsConfiguration `pulumi:"analyticsConfiguration"` 350 // Duration, in minutes, of the session token created by Amazon Cognito for each API request in an authentication flow. The session token must be responded to by the native user of the user pool before it expires. Valid values for `authSessionValidity` are between `3` and `15`, with a default value of `3`. 351 AuthSessionValidity *int `pulumi:"authSessionValidity"` 352 // List of allowed callback URLs for the identity providers. 353 CallbackUrls []string `pulumi:"callbackUrls"` 354 // Default redirect URI and must be included in the list of callback URLs. 355 DefaultRedirectUri *string `pulumi:"defaultRedirectUri"` 356 // Enables the propagation of additional user context data. 357 EnablePropagateAdditionalUserContextData *bool `pulumi:"enablePropagateAdditionalUserContextData"` 358 // Enables or disables token revocation. 359 EnableTokenRevocation *bool `pulumi:"enableTokenRevocation"` 360 // List of authentication flows. The available options include ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH, ALLOW_ADMIN_USER_PASSWORD_AUTH, ALLOW_CUSTOM_AUTH, ALLOW_USER_PASSWORD_AUTH, ALLOW_USER_SRP_AUTH, and ALLOW_REFRESH_TOKEN_AUTH. 361 ExplicitAuthFlows []string `pulumi:"explicitAuthFlows"` 362 // Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.id_token`. 363 IdTokenValidity *int `pulumi:"idTokenValidity"` 364 // List of allowed logout URLs for the identity providers. 365 LogoutUrls []string `pulumi:"logoutUrls"` 366 // Regular expression that matches the name of the desired User Pool Client. It must only match one User Pool Client. 367 NamePattern *string `pulumi:"namePattern"` 368 // String that matches the beginning of the name of the desired User Pool Client. It must match only one User Pool Client. 369 // 370 // The following arguments are optional: 371 NamePrefix *string `pulumi:"namePrefix"` 372 // Setting determines the errors and responses returned by Cognito APIs when a user does not exist in the user pool during authentication, account confirmation, and password recovery. 373 PreventUserExistenceErrors *string `pulumi:"preventUserExistenceErrors"` 374 // List of user pool attributes that the application client can read from. 375 ReadAttributes []string `pulumi:"readAttributes"` 376 // Time limit, between 60 minutes and 10 years, after which the refresh token is no longer valid and cannot be used. By default, the unit is days. The unit can be overridden by a value in `token_validity_units.refresh_token`. 377 RefreshTokenValidity *int `pulumi:"refreshTokenValidity"` 378 // List of provider names for the identity providers that are supported on this client. It uses the `providerName` attribute of the `cognito.IdentityProvider` resource(s), or the equivalent string(s). 379 SupportedIdentityProviders []string `pulumi:"supportedIdentityProviders"` 380 // Configuration block for representing the validity times in units. See details below. Detailed below. 381 TokenValidityUnits *ManagedUserPoolClientTokenValidityUnits `pulumi:"tokenValidityUnits"` 382 // User pool that the client belongs to. 383 UserPoolId string `pulumi:"userPoolId"` 384 // List of user pool attributes that the application client can write to. 385 WriteAttributes []string `pulumi:"writeAttributes"` 386 } 387 388 // The set of arguments for constructing a ManagedUserPoolClient resource. 389 type ManagedUserPoolClientArgs struct { 390 // Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.access_token`. 391 AccessTokenValidity pulumi.IntPtrInput 392 // List of allowed OAuth flows, including code, implicit, and client_credentials. 393 AllowedOauthFlows pulumi.StringArrayInput 394 // Whether the client is allowed to use the OAuth protocol when interacting with Cognito user pools. 395 AllowedOauthFlowsUserPoolClient pulumi.BoolPtrInput 396 // List of allowed OAuth scopes, including phone, email, openid, profile, and aws.cognito.signin.user.admin. 397 AllowedOauthScopes pulumi.StringArrayInput 398 // Configuration block for Amazon Pinpoint analytics that collects metrics for this user pool. See details below. 399 AnalyticsConfiguration ManagedUserPoolClientAnalyticsConfigurationPtrInput 400 // Duration, in minutes, of the session token created by Amazon Cognito for each API request in an authentication flow. The session token must be responded to by the native user of the user pool before it expires. Valid values for `authSessionValidity` are between `3` and `15`, with a default value of `3`. 401 AuthSessionValidity pulumi.IntPtrInput 402 // List of allowed callback URLs for the identity providers. 403 CallbackUrls pulumi.StringArrayInput 404 // Default redirect URI and must be included in the list of callback URLs. 405 DefaultRedirectUri pulumi.StringPtrInput 406 // Enables the propagation of additional user context data. 407 EnablePropagateAdditionalUserContextData pulumi.BoolPtrInput 408 // Enables or disables token revocation. 409 EnableTokenRevocation pulumi.BoolPtrInput 410 // List of authentication flows. The available options include ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH, ALLOW_ADMIN_USER_PASSWORD_AUTH, ALLOW_CUSTOM_AUTH, ALLOW_USER_PASSWORD_AUTH, ALLOW_USER_SRP_AUTH, and ALLOW_REFRESH_TOKEN_AUTH. 411 ExplicitAuthFlows pulumi.StringArrayInput 412 // Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.id_token`. 413 IdTokenValidity pulumi.IntPtrInput 414 // List of allowed logout URLs for the identity providers. 415 LogoutUrls pulumi.StringArrayInput 416 // Regular expression that matches the name of the desired User Pool Client. It must only match one User Pool Client. 417 NamePattern pulumi.StringPtrInput 418 // String that matches the beginning of the name of the desired User Pool Client. It must match only one User Pool Client. 419 // 420 // The following arguments are optional: 421 NamePrefix pulumi.StringPtrInput 422 // Setting determines the errors and responses returned by Cognito APIs when a user does not exist in the user pool during authentication, account confirmation, and password recovery. 423 PreventUserExistenceErrors pulumi.StringPtrInput 424 // List of user pool attributes that the application client can read from. 425 ReadAttributes pulumi.StringArrayInput 426 // Time limit, between 60 minutes and 10 years, after which the refresh token is no longer valid and cannot be used. By default, the unit is days. The unit can be overridden by a value in `token_validity_units.refresh_token`. 427 RefreshTokenValidity pulumi.IntPtrInput 428 // List of provider names for the identity providers that are supported on this client. It uses the `providerName` attribute of the `cognito.IdentityProvider` resource(s), or the equivalent string(s). 429 SupportedIdentityProviders pulumi.StringArrayInput 430 // Configuration block for representing the validity times in units. See details below. Detailed below. 431 TokenValidityUnits ManagedUserPoolClientTokenValidityUnitsPtrInput 432 // User pool that the client belongs to. 433 UserPoolId pulumi.StringInput 434 // List of user pool attributes that the application client can write to. 435 WriteAttributes pulumi.StringArrayInput 436 } 437 438 func (ManagedUserPoolClientArgs) ElementType() reflect.Type { 439 return reflect.TypeOf((*managedUserPoolClientArgs)(nil)).Elem() 440 } 441 442 type ManagedUserPoolClientInput interface { 443 pulumi.Input 444 445 ToManagedUserPoolClientOutput() ManagedUserPoolClientOutput 446 ToManagedUserPoolClientOutputWithContext(ctx context.Context) ManagedUserPoolClientOutput 447 } 448 449 func (*ManagedUserPoolClient) ElementType() reflect.Type { 450 return reflect.TypeOf((**ManagedUserPoolClient)(nil)).Elem() 451 } 452 453 func (i *ManagedUserPoolClient) ToManagedUserPoolClientOutput() ManagedUserPoolClientOutput { 454 return i.ToManagedUserPoolClientOutputWithContext(context.Background()) 455 } 456 457 func (i *ManagedUserPoolClient) ToManagedUserPoolClientOutputWithContext(ctx context.Context) ManagedUserPoolClientOutput { 458 return pulumi.ToOutputWithContext(ctx, i).(ManagedUserPoolClientOutput) 459 } 460 461 // ManagedUserPoolClientArrayInput is an input type that accepts ManagedUserPoolClientArray and ManagedUserPoolClientArrayOutput values. 462 // You can construct a concrete instance of `ManagedUserPoolClientArrayInput` via: 463 // 464 // ManagedUserPoolClientArray{ ManagedUserPoolClientArgs{...} } 465 type ManagedUserPoolClientArrayInput interface { 466 pulumi.Input 467 468 ToManagedUserPoolClientArrayOutput() ManagedUserPoolClientArrayOutput 469 ToManagedUserPoolClientArrayOutputWithContext(context.Context) ManagedUserPoolClientArrayOutput 470 } 471 472 type ManagedUserPoolClientArray []ManagedUserPoolClientInput 473 474 func (ManagedUserPoolClientArray) ElementType() reflect.Type { 475 return reflect.TypeOf((*[]*ManagedUserPoolClient)(nil)).Elem() 476 } 477 478 func (i ManagedUserPoolClientArray) ToManagedUserPoolClientArrayOutput() ManagedUserPoolClientArrayOutput { 479 return i.ToManagedUserPoolClientArrayOutputWithContext(context.Background()) 480 } 481 482 func (i ManagedUserPoolClientArray) ToManagedUserPoolClientArrayOutputWithContext(ctx context.Context) ManagedUserPoolClientArrayOutput { 483 return pulumi.ToOutputWithContext(ctx, i).(ManagedUserPoolClientArrayOutput) 484 } 485 486 // ManagedUserPoolClientMapInput is an input type that accepts ManagedUserPoolClientMap and ManagedUserPoolClientMapOutput values. 487 // You can construct a concrete instance of `ManagedUserPoolClientMapInput` via: 488 // 489 // ManagedUserPoolClientMap{ "key": ManagedUserPoolClientArgs{...} } 490 type ManagedUserPoolClientMapInput interface { 491 pulumi.Input 492 493 ToManagedUserPoolClientMapOutput() ManagedUserPoolClientMapOutput 494 ToManagedUserPoolClientMapOutputWithContext(context.Context) ManagedUserPoolClientMapOutput 495 } 496 497 type ManagedUserPoolClientMap map[string]ManagedUserPoolClientInput 498 499 func (ManagedUserPoolClientMap) ElementType() reflect.Type { 500 return reflect.TypeOf((*map[string]*ManagedUserPoolClient)(nil)).Elem() 501 } 502 503 func (i ManagedUserPoolClientMap) ToManagedUserPoolClientMapOutput() ManagedUserPoolClientMapOutput { 504 return i.ToManagedUserPoolClientMapOutputWithContext(context.Background()) 505 } 506 507 func (i ManagedUserPoolClientMap) ToManagedUserPoolClientMapOutputWithContext(ctx context.Context) ManagedUserPoolClientMapOutput { 508 return pulumi.ToOutputWithContext(ctx, i).(ManagedUserPoolClientMapOutput) 509 } 510 511 type ManagedUserPoolClientOutput struct{ *pulumi.OutputState } 512 513 func (ManagedUserPoolClientOutput) ElementType() reflect.Type { 514 return reflect.TypeOf((**ManagedUserPoolClient)(nil)).Elem() 515 } 516 517 func (o ManagedUserPoolClientOutput) ToManagedUserPoolClientOutput() ManagedUserPoolClientOutput { 518 return o 519 } 520 521 func (o ManagedUserPoolClientOutput) ToManagedUserPoolClientOutputWithContext(ctx context.Context) ManagedUserPoolClientOutput { 522 return o 523 } 524 525 // Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.access_token`. 526 func (o ManagedUserPoolClientOutput) AccessTokenValidity() pulumi.IntOutput { 527 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.IntOutput { return v.AccessTokenValidity }).(pulumi.IntOutput) 528 } 529 530 // List of allowed OAuth flows, including code, implicit, and client_credentials. 531 func (o ManagedUserPoolClientOutput) AllowedOauthFlows() pulumi.StringArrayOutput { 532 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringArrayOutput { return v.AllowedOauthFlows }).(pulumi.StringArrayOutput) 533 } 534 535 // Whether the client is allowed to use the OAuth protocol when interacting with Cognito user pools. 536 func (o ManagedUserPoolClientOutput) AllowedOauthFlowsUserPoolClient() pulumi.BoolOutput { 537 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.BoolOutput { return v.AllowedOauthFlowsUserPoolClient }).(pulumi.BoolOutput) 538 } 539 540 // List of allowed OAuth scopes, including phone, email, openid, profile, and aws.cognito.signin.user.admin. 541 func (o ManagedUserPoolClientOutput) AllowedOauthScopes() pulumi.StringArrayOutput { 542 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringArrayOutput { return v.AllowedOauthScopes }).(pulumi.StringArrayOutput) 543 } 544 545 // Configuration block for Amazon Pinpoint analytics that collects metrics for this user pool. See details below. 546 func (o ManagedUserPoolClientOutput) AnalyticsConfiguration() ManagedUserPoolClientAnalyticsConfigurationPtrOutput { 547 return o.ApplyT(func(v *ManagedUserPoolClient) ManagedUserPoolClientAnalyticsConfigurationPtrOutput { 548 return v.AnalyticsConfiguration 549 }).(ManagedUserPoolClientAnalyticsConfigurationPtrOutput) 550 } 551 552 // Duration, in minutes, of the session token created by Amazon Cognito for each API request in an authentication flow. The session token must be responded to by the native user of the user pool before it expires. Valid values for `authSessionValidity` are between `3` and `15`, with a default value of `3`. 553 func (o ManagedUserPoolClientOutput) AuthSessionValidity() pulumi.IntOutput { 554 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.IntOutput { return v.AuthSessionValidity }).(pulumi.IntOutput) 555 } 556 557 // List of allowed callback URLs for the identity providers. 558 func (o ManagedUserPoolClientOutput) CallbackUrls() pulumi.StringArrayOutput { 559 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringArrayOutput { return v.CallbackUrls }).(pulumi.StringArrayOutput) 560 } 561 562 // Client secret of the user pool client. 563 func (o ManagedUserPoolClientOutput) ClientSecret() pulumi.StringOutput { 564 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringOutput { return v.ClientSecret }).(pulumi.StringOutput) 565 } 566 567 // Default redirect URI and must be included in the list of callback URLs. 568 func (o ManagedUserPoolClientOutput) DefaultRedirectUri() pulumi.StringOutput { 569 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringOutput { return v.DefaultRedirectUri }).(pulumi.StringOutput) 570 } 571 572 // Enables the propagation of additional user context data. 573 func (o ManagedUserPoolClientOutput) EnablePropagateAdditionalUserContextData() pulumi.BoolOutput { 574 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.BoolOutput { return v.EnablePropagateAdditionalUserContextData }).(pulumi.BoolOutput) 575 } 576 577 // Enables or disables token revocation. 578 func (o ManagedUserPoolClientOutput) EnableTokenRevocation() pulumi.BoolOutput { 579 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.BoolOutput { return v.EnableTokenRevocation }).(pulumi.BoolOutput) 580 } 581 582 // List of authentication flows. The available options include ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH, ALLOW_ADMIN_USER_PASSWORD_AUTH, ALLOW_CUSTOM_AUTH, ALLOW_USER_PASSWORD_AUTH, ALLOW_USER_SRP_AUTH, and ALLOW_REFRESH_TOKEN_AUTH. 583 func (o ManagedUserPoolClientOutput) ExplicitAuthFlows() pulumi.StringArrayOutput { 584 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringArrayOutput { return v.ExplicitAuthFlows }).(pulumi.StringArrayOutput) 585 } 586 587 // Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. By default, the unit is hours. The unit can be overridden by a value in `token_validity_units.id_token`. 588 func (o ManagedUserPoolClientOutput) IdTokenValidity() pulumi.IntOutput { 589 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.IntOutput { return v.IdTokenValidity }).(pulumi.IntOutput) 590 } 591 592 // List of allowed logout URLs for the identity providers. 593 func (o ManagedUserPoolClientOutput) LogoutUrls() pulumi.StringArrayOutput { 594 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringArrayOutput { return v.LogoutUrls }).(pulumi.StringArrayOutput) 595 } 596 597 // Name of the user pool client. 598 func (o ManagedUserPoolClientOutput) Name() pulumi.StringOutput { 599 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 600 } 601 602 // Regular expression that matches the name of the desired User Pool Client. It must only match one User Pool Client. 603 func (o ManagedUserPoolClientOutput) NamePattern() pulumi.StringPtrOutput { 604 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringPtrOutput { return v.NamePattern }).(pulumi.StringPtrOutput) 605 } 606 607 // String that matches the beginning of the name of the desired User Pool Client. It must match only one User Pool Client. 608 // 609 // The following arguments are optional: 610 func (o ManagedUserPoolClientOutput) NamePrefix() pulumi.StringPtrOutput { 611 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringPtrOutput { return v.NamePrefix }).(pulumi.StringPtrOutput) 612 } 613 614 // Setting determines the errors and responses returned by Cognito APIs when a user does not exist in the user pool during authentication, account confirmation, and password recovery. 615 func (o ManagedUserPoolClientOutput) PreventUserExistenceErrors() pulumi.StringOutput { 616 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringOutput { return v.PreventUserExistenceErrors }).(pulumi.StringOutput) 617 } 618 619 // List of user pool attributes that the application client can read from. 620 func (o ManagedUserPoolClientOutput) ReadAttributes() pulumi.StringArrayOutput { 621 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringArrayOutput { return v.ReadAttributes }).(pulumi.StringArrayOutput) 622 } 623 624 // Time limit, between 60 minutes and 10 years, after which the refresh token is no longer valid and cannot be used. By default, the unit is days. The unit can be overridden by a value in `token_validity_units.refresh_token`. 625 func (o ManagedUserPoolClientOutput) RefreshTokenValidity() pulumi.IntOutput { 626 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.IntOutput { return v.RefreshTokenValidity }).(pulumi.IntOutput) 627 } 628 629 // List of provider names for the identity providers that are supported on this client. It uses the `providerName` attribute of the `cognito.IdentityProvider` resource(s), or the equivalent string(s). 630 func (o ManagedUserPoolClientOutput) SupportedIdentityProviders() pulumi.StringArrayOutput { 631 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringArrayOutput { return v.SupportedIdentityProviders }).(pulumi.StringArrayOutput) 632 } 633 634 // Configuration block for representing the validity times in units. See details below. Detailed below. 635 func (o ManagedUserPoolClientOutput) TokenValidityUnits() ManagedUserPoolClientTokenValidityUnitsPtrOutput { 636 return o.ApplyT(func(v *ManagedUserPoolClient) ManagedUserPoolClientTokenValidityUnitsPtrOutput { 637 return v.TokenValidityUnits 638 }).(ManagedUserPoolClientTokenValidityUnitsPtrOutput) 639 } 640 641 // User pool that the client belongs to. 642 func (o ManagedUserPoolClientOutput) UserPoolId() pulumi.StringOutput { 643 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringOutput { return v.UserPoolId }).(pulumi.StringOutput) 644 } 645 646 // List of user pool attributes that the application client can write to. 647 func (o ManagedUserPoolClientOutput) WriteAttributes() pulumi.StringArrayOutput { 648 return o.ApplyT(func(v *ManagedUserPoolClient) pulumi.StringArrayOutput { return v.WriteAttributes }).(pulumi.StringArrayOutput) 649 } 650 651 type ManagedUserPoolClientArrayOutput struct{ *pulumi.OutputState } 652 653 func (ManagedUserPoolClientArrayOutput) ElementType() reflect.Type { 654 return reflect.TypeOf((*[]*ManagedUserPoolClient)(nil)).Elem() 655 } 656 657 func (o ManagedUserPoolClientArrayOutput) ToManagedUserPoolClientArrayOutput() ManagedUserPoolClientArrayOutput { 658 return o 659 } 660 661 func (o ManagedUserPoolClientArrayOutput) ToManagedUserPoolClientArrayOutputWithContext(ctx context.Context) ManagedUserPoolClientArrayOutput { 662 return o 663 } 664 665 func (o ManagedUserPoolClientArrayOutput) Index(i pulumi.IntInput) ManagedUserPoolClientOutput { 666 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ManagedUserPoolClient { 667 return vs[0].([]*ManagedUserPoolClient)[vs[1].(int)] 668 }).(ManagedUserPoolClientOutput) 669 } 670 671 type ManagedUserPoolClientMapOutput struct{ *pulumi.OutputState } 672 673 func (ManagedUserPoolClientMapOutput) ElementType() reflect.Type { 674 return reflect.TypeOf((*map[string]*ManagedUserPoolClient)(nil)).Elem() 675 } 676 677 func (o ManagedUserPoolClientMapOutput) ToManagedUserPoolClientMapOutput() ManagedUserPoolClientMapOutput { 678 return o 679 } 680 681 func (o ManagedUserPoolClientMapOutput) ToManagedUserPoolClientMapOutputWithContext(ctx context.Context) ManagedUserPoolClientMapOutput { 682 return o 683 } 684 685 func (o ManagedUserPoolClientMapOutput) MapIndex(k pulumi.StringInput) ManagedUserPoolClientOutput { 686 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ManagedUserPoolClient { 687 return vs[0].(map[string]*ManagedUserPoolClient)[vs[1].(string)] 688 }).(ManagedUserPoolClientOutput) 689 } 690 691 func init() { 692 pulumi.RegisterInputType(reflect.TypeOf((*ManagedUserPoolClientInput)(nil)).Elem(), &ManagedUserPoolClient{}) 693 pulumi.RegisterInputType(reflect.TypeOf((*ManagedUserPoolClientArrayInput)(nil)).Elem(), ManagedUserPoolClientArray{}) 694 pulumi.RegisterInputType(reflect.TypeOf((*ManagedUserPoolClientMapInput)(nil)).Elem(), ManagedUserPoolClientMap{}) 695 pulumi.RegisterOutputType(ManagedUserPoolClientOutput{}) 696 pulumi.RegisterOutputType(ManagedUserPoolClientArrayOutput{}) 697 pulumi.RegisterOutputType(ManagedUserPoolClientMapOutput{}) 698 }