ManagedUserPoolClient class

Use the aws.cognito.UserPoolClient resource to manage a Cognito User Pool Client.

This resource is advanced and has special caveats to consider before use. Please read this document completely before using the resource.

Use the aws.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, the OpenSearch service creates the User Pool Client during setup and removes it when it is no longer required. As a result, the aws.cognito.ManagedUserPoolClient resource does not create or delete this resource, but instead assumes management of it.

Use the aws.cognito.UserPoolClient resource to manage Cognito User Pool Clients for normal use cases.

Example Usage

Using Name Pattern

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.cognito.ManagedUserPoolClient("example", {
    namePattern: "^AmazonOpenSearchService-example-(\\w+)$",
    userPoolId: exampleAwsCognitoUserPool.id,
});
import pulumi
import pulumi_aws as aws

example = aws.cognito.ManagedUserPoolClient("example",
    name_pattern="^AmazonOpenSearchService-example-(\\w+)$",
    user_pool_id=example_aws_cognito_user_pool["id"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Cognito.ManagedUserPoolClient("example", new()
    {
        NamePattern = "^AmazonOpenSearchService-example-(\\w+)$",
        UserPoolId = exampleAwsCognitoUserPool.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cognito"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cognito.NewManagedUserPoolClient(ctx, "example", &cognito.ManagedUserPoolClientArgs{
			NamePattern: pulumi.String("^AmazonOpenSearchService-example-(\\w+)$"),
			UserPoolId:  pulumi.Any(exampleAwsCognitoUserPool.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_cognito_manageduserpoolclient" "example" {
  name_pattern = "^AmazonOpenSearchService-example-(\\w+)$"
  user_pool_id = exampleAwsCognitoUserPool.id
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cognito.ManagedUserPoolClient;
import com.pulumi.aws.cognito.ManagedUserPoolClientArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new ManagedUserPoolClient("example", ManagedUserPoolClientArgs.builder()
            .namePattern("^AmazonOpenSearchService-example-(\\w+)$")
            .userPoolId(exampleAwsCognitoUserPool.id())
            .build());

    }
}
resources:
  example:
    type: aws:cognito:ManagedUserPoolClient
    properties:
      namePattern: ^AmazonOpenSearchService-example-(\w+)$
      userPoolId: ${exampleAwsCognitoUserPool.id}

Import

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:

$ pulumi import aws:cognito/managedUserPoolClient:ManagedUserPoolClient client us-west-2_abc123/3ho4ek12345678909nh3fmhpko

Constructors

ManagedUserPoolClient(String name, {ManagedUserPoolClientArgs? args, CustomResourceOptions? options})
Creates a new ManagedUserPoolClient. name The Pulumi resource name. args Arguments used to configure this ManagedUserPoolClient. The set of arguments for ManagedUserPoolClient. options Resource options controlling this resource's behavior.
ManagedUserPoolClient.reference(String urn)
Creates a typed reference to an existing ManagedUserPoolClient resource.

Properties

accessTokenValidity ↔ Output<int>
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.
latefinal
allowedOauthFlows ↔ Output<List<String>>
List of allowed OAuth flows, including code, implicit, and clientCredentials. allowedOauthFlowsUserPoolClient must be set to true before you can configure this option.
latefinal
allowedOauthFlowsUserPoolClient ↔ Output<bool>
Whether the client is allowed to use OAuth 2.0 features. allowedOauthFlowsUserPoolClient must be set to true before you can configure the following arguments: callbackUrls, logoutUrls, allowedOauthScopes and allowedOauthFlows.
latefinal
allowedOauthScopes ↔ Output<List<String>>
List of allowed OAuth scopes, including phone, email, openid, profile, and aws.cognito.signin.user.admin. allowedOauthFlowsUserPoolClient must be set to true before you can configure this option.
latefinal
analyticsConfiguration ↔ Output<ManagedUserPoolClientAnalyticsConfiguration?>
Configuration block for AWS End User Messaging analytics that collects metrics for this user pool. See details below.
latefinal
authSessionValidity ↔ Output<int>
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.
latefinal
callbackUrls ↔ Output<List<String>>
List of allowed callback URLs for the identity providers. allowedOauthFlowsUserPoolClient must be set to true before you can configure this option.
latefinal
childResources → Set<Resource>
finalinherited
clientSecret ↔ Output<String>
Client secret of the user pool client.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
defaultRedirectUri ↔ Output<String>
Default redirect URI and must be included in the list of callback URLs.
latefinal
enablePropagateAdditionalUserContextData ↔ Output<bool>
Enables the propagation of additional user context data.
latefinal
enableTokenRevocation ↔ Output<bool>
Enables or disables token revocation.
latefinal
explicitAuthFlows ↔ Output<List<String>>
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.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
idTokenValidity ↔ Output<int>
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.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
logoutUrls ↔ Output<List<String>>
List of allowed logout URLs for the identity providers. allowedOauthFlowsUserPoolClient must be set to true before you can configure this option.
latefinal
name ↔ Output<String>
Name of the user pool client.
latefinal
namePattern ↔ Output<String?>
Regular expression that matches the name of the existing User Pool Client to be managed. It must only match one User Pool Client.
latefinal
namePrefix ↔ Output<String?>
String that matches the beginning of the name of the existing User Pool Client to be managed. It must match only one User Pool Client.
latefinal
preventUserExistenceErrors ↔ Output<String>
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.
latefinal
readAttributes ↔ Output<List<String>>
List of user pool attributes that the application client can read from.
latefinal
refreshTokenRotation ↔ Output<ManagedUserPoolClientRefreshTokenRotation?>
A block that specifies the configuration of refresh token rotation. Detailed below.
latefinal
refreshTokenValidity ↔ Output<int>
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.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
supportedIdentityProviders ↔ Output<List<String>>
List of provider names for the identity providers that are supported on this client. It uses the providerName attribute of the aws.cognito.IdentityProvider resource(s), or the equivalent string(s).
latefinal
tokenValidityUnits ↔ Output<ManagedUserPoolClientTokenValidityUnits?>
Configuration block for representing the validity times in units. See details below. Detailed below.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
userPoolId ↔ Output<String>
User pool that the client belongs to.
latefinal
writeAttributes ↔ Output<List<String>>
List of user pool attributes that the application client can write to.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ManagedUserPoolClientState? state, CustomResourceOptions? options}) → ManagedUserPoolClient
Gets an existing ManagedUserPoolClient resource's state with the given name and id.