All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.cognito.UserArgs Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

There is a newer version: 6.60.0-alpha.1731982519
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.cognito;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class UserArgs extends com.pulumi.resources.ResourceArgs {

    public static final UserArgs Empty = new UserArgs();

    /**
     * A map that contains user attributes and attribute values to be set for the user.
     * 
     */
    @Import(name="attributes")
    private @Nullable Output> attributes;

    /**
     * @return A map that contains user attributes and attribute values to be set for the user.
     * 
     */
    public Optional>> attributes() {
        return Optional.ofNullable(this.attributes);
    }

    /**
     * A map of custom key-value pairs that you can provide as input for any custom workflows that user creation triggers. Amazon Cognito does not store the `client_metadata` value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration does not include triggers, the ClientMetadata parameter serves no purpose. For more information, see [Customizing User Pool Workflows with Lambda Triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html).
     * 
     */
    @Import(name="clientMetadata")
    private @Nullable Output> clientMetadata;

    /**
     * @return A map of custom key-value pairs that you can provide as input for any custom workflows that user creation triggers. Amazon Cognito does not store the `client_metadata` value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration does not include triggers, the ClientMetadata parameter serves no purpose. For more information, see [Customizing User Pool Workflows with Lambda Triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html).
     * 
     */
    public Optional>> clientMetadata() {
        return Optional.ofNullable(this.clientMetadata);
    }

    /**
     * A list of mediums to the welcome message will be sent through. Allowed values are `EMAIL` and `SMS`. If it's provided, make sure you have also specified `email` attribute for the `EMAIL` medium and `phone_number` for the `SMS`. More than one value can be specified. Amazon Cognito does not store the `desired_delivery_mediums` value. Defaults to `["SMS"]`.
     * 
     */
    @Import(name="desiredDeliveryMediums")
    private @Nullable Output> desiredDeliveryMediums;

    /**
     * @return A list of mediums to the welcome message will be sent through. Allowed values are `EMAIL` and `SMS`. If it's provided, make sure you have also specified `email` attribute for the `EMAIL` medium and `phone_number` for the `SMS`. More than one value can be specified. Amazon Cognito does not store the `desired_delivery_mediums` value. Defaults to `["SMS"]`.
     * 
     */
    public Optional>> desiredDeliveryMediums() {
        return Optional.ofNullable(this.desiredDeliveryMediums);
    }

    /**
     * Specifies whether the user should be enabled after creation. The welcome message will be sent regardless of the `enabled` value. The behavior can be changed with `message_action` argument. Defaults to `true`.
     * 
     */
    @Import(name="enabled")
    private @Nullable Output enabled;

    /**
     * @return Specifies whether the user should be enabled after creation. The welcome message will be sent regardless of the `enabled` value. The behavior can be changed with `message_action` argument. Defaults to `true`.
     * 
     */
    public Optional> enabled() {
        return Optional.ofNullable(this.enabled);
    }

    /**
     * If this parameter is set to True and the `phone_number` or `email` address specified in the `attributes` parameter already exists as an alias with a different user, Amazon Cognito will migrate the alias from the previous user to the newly created user. The previous user will no longer be able to log in using that alias. Amazon Cognito does not store the `force_alias_creation` value. Defaults to `false`.
     * 
     */
    @Import(name="forceAliasCreation")
    private @Nullable Output forceAliasCreation;

    /**
     * @return If this parameter is set to True and the `phone_number` or `email` address specified in the `attributes` parameter already exists as an alias with a different user, Amazon Cognito will migrate the alias from the previous user to the newly created user. The previous user will no longer be able to log in using that alias. Amazon Cognito does not store the `force_alias_creation` value. Defaults to `false`.
     * 
     */
    public Optional> forceAliasCreation() {
        return Optional.ofNullable(this.forceAliasCreation);
    }

    /**
     * Set to `RESEND` to resend the invitation message to a user that already exists and reset the expiration limit on the user's account. Set to `SUPPRESS` to suppress sending the message. Only one value can be specified. Amazon Cognito does not store the `message_action` value.
     * 
     */
    @Import(name="messageAction")
    private @Nullable Output messageAction;

    /**
     * @return Set to `RESEND` to resend the invitation message to a user that already exists and reset the expiration limit on the user's account. Set to `SUPPRESS` to suppress sending the message. Only one value can be specified. Amazon Cognito does not store the `message_action` value.
     * 
     */
    public Optional> messageAction() {
        return Optional.ofNullable(this.messageAction);
    }

    /**
     * The user's permanent password. This password must conform to the password policy specified by user pool the user belongs to. The welcome message always contains only `temporary_password` value. You can suppress sending the welcome message with the `message_action` argument. Amazon Cognito does not store the `password` value. Conflicts with `temporary_password`.
     * 
     */
    @Import(name="password")
    private @Nullable Output password;

    /**
     * @return The user's permanent password. This password must conform to the password policy specified by user pool the user belongs to. The welcome message always contains only `temporary_password` value. You can suppress sending the welcome message with the `message_action` argument. Amazon Cognito does not store the `password` value. Conflicts with `temporary_password`.
     * 
     */
    public Optional> password() {
        return Optional.ofNullable(this.password);
    }

    /**
     * The user's temporary password. Conflicts with `password`.
     * 
     */
    @Import(name="temporaryPassword")
    private @Nullable Output temporaryPassword;

    /**
     * @return The user's temporary password. Conflicts with `password`.
     * 
     */
    public Optional> temporaryPassword() {
        return Optional.ofNullable(this.temporaryPassword);
    }

    /**
     * The user pool ID for the user pool where the user will be created.
     * 
     */
    @Import(name="userPoolId", required=true)
    private Output userPoolId;

    /**
     * @return The user pool ID for the user pool where the user will be created.
     * 
     */
    public Output userPoolId() {
        return this.userPoolId;
    }

    /**
     * The username for the user. Must be unique within the user pool. Must be a UTF-8 string between 1 and 128 characters. After the user is created, the username cannot be changed.
     * 
     * The following arguments are optional:
     * 
     */
    @Import(name="username", required=true)
    private Output username;

    /**
     * @return The username for the user. Must be unique within the user pool. Must be a UTF-8 string between 1 and 128 characters. After the user is created, the username cannot be changed.
     * 
     * The following arguments are optional:
     * 
     */
    public Output username() {
        return this.username;
    }

    /**
     * The user's validation data. This is an array of name-value pairs that contain user attributes and attribute values that you can use for custom validation, such as restricting the types of user accounts that can be registered. Amazon Cognito does not store the `validation_data` value. For more information, see [Customizing User Pool Workflows with Lambda Triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html).
     * 
     * > **NOTE:** Clearing `password` or `temporary_password` does not reset user's password in Cognito.
     * 
     */
    @Import(name="validationData")
    private @Nullable Output> validationData;

    /**
     * @return The user's validation data. This is an array of name-value pairs that contain user attributes and attribute values that you can use for custom validation, such as restricting the types of user accounts that can be registered. Amazon Cognito does not store the `validation_data` value. For more information, see [Customizing User Pool Workflows with Lambda Triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html).
     * 
     * > **NOTE:** Clearing `password` or `temporary_password` does not reset user's password in Cognito.
     * 
     */
    public Optional>> validationData() {
        return Optional.ofNullable(this.validationData);
    }

    private UserArgs() {}

    private UserArgs(UserArgs $) {
        this.attributes = $.attributes;
        this.clientMetadata = $.clientMetadata;
        this.desiredDeliveryMediums = $.desiredDeliveryMediums;
        this.enabled = $.enabled;
        this.forceAliasCreation = $.forceAliasCreation;
        this.messageAction = $.messageAction;
        this.password = $.password;
        this.temporaryPassword = $.temporaryPassword;
        this.userPoolId = $.userPoolId;
        this.username = $.username;
        this.validationData = $.validationData;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(UserArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private UserArgs $;

        public Builder() {
            $ = new UserArgs();
        }

        public Builder(UserArgs defaults) {
            $ = new UserArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param attributes A map that contains user attributes and attribute values to be set for the user.
         * 
         * @return builder
         * 
         */
        public Builder attributes(@Nullable Output> attributes) {
            $.attributes = attributes;
            return this;
        }

        /**
         * @param attributes A map that contains user attributes and attribute values to be set for the user.
         * 
         * @return builder
         * 
         */
        public Builder attributes(Map attributes) {
            return attributes(Output.of(attributes));
        }

        /**
         * @param clientMetadata A map of custom key-value pairs that you can provide as input for any custom workflows that user creation triggers. Amazon Cognito does not store the `client_metadata` value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration does not include triggers, the ClientMetadata parameter serves no purpose. For more information, see [Customizing User Pool Workflows with Lambda Triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html).
         * 
         * @return builder
         * 
         */
        public Builder clientMetadata(@Nullable Output> clientMetadata) {
            $.clientMetadata = clientMetadata;
            return this;
        }

        /**
         * @param clientMetadata A map of custom key-value pairs that you can provide as input for any custom workflows that user creation triggers. Amazon Cognito does not store the `client_metadata` value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration does not include triggers, the ClientMetadata parameter serves no purpose. For more information, see [Customizing User Pool Workflows with Lambda Triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html).
         * 
         * @return builder
         * 
         */
        public Builder clientMetadata(Map clientMetadata) {
            return clientMetadata(Output.of(clientMetadata));
        }

        /**
         * @param desiredDeliveryMediums A list of mediums to the welcome message will be sent through. Allowed values are `EMAIL` and `SMS`. If it's provided, make sure you have also specified `email` attribute for the `EMAIL` medium and `phone_number` for the `SMS`. More than one value can be specified. Amazon Cognito does not store the `desired_delivery_mediums` value. Defaults to `["SMS"]`.
         * 
         * @return builder
         * 
         */
        public Builder desiredDeliveryMediums(@Nullable Output> desiredDeliveryMediums) {
            $.desiredDeliveryMediums = desiredDeliveryMediums;
            return this;
        }

        /**
         * @param desiredDeliveryMediums A list of mediums to the welcome message will be sent through. Allowed values are `EMAIL` and `SMS`. If it's provided, make sure you have also specified `email` attribute for the `EMAIL` medium and `phone_number` for the `SMS`. More than one value can be specified. Amazon Cognito does not store the `desired_delivery_mediums` value. Defaults to `["SMS"]`.
         * 
         * @return builder
         * 
         */
        public Builder desiredDeliveryMediums(List desiredDeliveryMediums) {
            return desiredDeliveryMediums(Output.of(desiredDeliveryMediums));
        }

        /**
         * @param desiredDeliveryMediums A list of mediums to the welcome message will be sent through. Allowed values are `EMAIL` and `SMS`. If it's provided, make sure you have also specified `email` attribute for the `EMAIL` medium and `phone_number` for the `SMS`. More than one value can be specified. Amazon Cognito does not store the `desired_delivery_mediums` value. Defaults to `["SMS"]`.
         * 
         * @return builder
         * 
         */
        public Builder desiredDeliveryMediums(String... desiredDeliveryMediums) {
            return desiredDeliveryMediums(List.of(desiredDeliveryMediums));
        }

        /**
         * @param enabled Specifies whether the user should be enabled after creation. The welcome message will be sent regardless of the `enabled` value. The behavior can be changed with `message_action` argument. Defaults to `true`.
         * 
         * @return builder
         * 
         */
        public Builder enabled(@Nullable Output enabled) {
            $.enabled = enabled;
            return this;
        }

        /**
         * @param enabled Specifies whether the user should be enabled after creation. The welcome message will be sent regardless of the `enabled` value. The behavior can be changed with `message_action` argument. Defaults to `true`.
         * 
         * @return builder
         * 
         */
        public Builder enabled(Boolean enabled) {
            return enabled(Output.of(enabled));
        }

        /**
         * @param forceAliasCreation If this parameter is set to True and the `phone_number` or `email` address specified in the `attributes` parameter already exists as an alias with a different user, Amazon Cognito will migrate the alias from the previous user to the newly created user. The previous user will no longer be able to log in using that alias. Amazon Cognito does not store the `force_alias_creation` value. Defaults to `false`.
         * 
         * @return builder
         * 
         */
        public Builder forceAliasCreation(@Nullable Output forceAliasCreation) {
            $.forceAliasCreation = forceAliasCreation;
            return this;
        }

        /**
         * @param forceAliasCreation If this parameter is set to True and the `phone_number` or `email` address specified in the `attributes` parameter already exists as an alias with a different user, Amazon Cognito will migrate the alias from the previous user to the newly created user. The previous user will no longer be able to log in using that alias. Amazon Cognito does not store the `force_alias_creation` value. Defaults to `false`.
         * 
         * @return builder
         * 
         */
        public Builder forceAliasCreation(Boolean forceAliasCreation) {
            return forceAliasCreation(Output.of(forceAliasCreation));
        }

        /**
         * @param messageAction Set to `RESEND` to resend the invitation message to a user that already exists and reset the expiration limit on the user's account. Set to `SUPPRESS` to suppress sending the message. Only one value can be specified. Amazon Cognito does not store the `message_action` value.
         * 
         * @return builder
         * 
         */
        public Builder messageAction(@Nullable Output messageAction) {
            $.messageAction = messageAction;
            return this;
        }

        /**
         * @param messageAction Set to `RESEND` to resend the invitation message to a user that already exists and reset the expiration limit on the user's account. Set to `SUPPRESS` to suppress sending the message. Only one value can be specified. Amazon Cognito does not store the `message_action` value.
         * 
         * @return builder
         * 
         */
        public Builder messageAction(String messageAction) {
            return messageAction(Output.of(messageAction));
        }

        /**
         * @param password The user's permanent password. This password must conform to the password policy specified by user pool the user belongs to. The welcome message always contains only `temporary_password` value. You can suppress sending the welcome message with the `message_action` argument. Amazon Cognito does not store the `password` value. Conflicts with `temporary_password`.
         * 
         * @return builder
         * 
         */
        public Builder password(@Nullable Output password) {
            $.password = password;
            return this;
        }

        /**
         * @param password The user's permanent password. This password must conform to the password policy specified by user pool the user belongs to. The welcome message always contains only `temporary_password` value. You can suppress sending the welcome message with the `message_action` argument. Amazon Cognito does not store the `password` value. Conflicts with `temporary_password`.
         * 
         * @return builder
         * 
         */
        public Builder password(String password) {
            return password(Output.of(password));
        }

        /**
         * @param temporaryPassword The user's temporary password. Conflicts with `password`.
         * 
         * @return builder
         * 
         */
        public Builder temporaryPassword(@Nullable Output temporaryPassword) {
            $.temporaryPassword = temporaryPassword;
            return this;
        }

        /**
         * @param temporaryPassword The user's temporary password. Conflicts with `password`.
         * 
         * @return builder
         * 
         */
        public Builder temporaryPassword(String temporaryPassword) {
            return temporaryPassword(Output.of(temporaryPassword));
        }

        /**
         * @param userPoolId The user pool ID for the user pool where the user will be created.
         * 
         * @return builder
         * 
         */
        public Builder userPoolId(Output userPoolId) {
            $.userPoolId = userPoolId;
            return this;
        }

        /**
         * @param userPoolId The user pool ID for the user pool where the user will be created.
         * 
         * @return builder
         * 
         */
        public Builder userPoolId(String userPoolId) {
            return userPoolId(Output.of(userPoolId));
        }

        /**
         * @param username The username for the user. Must be unique within the user pool. Must be a UTF-8 string between 1 and 128 characters. After the user is created, the username cannot be changed.
         * 
         * The following arguments are optional:
         * 
         * @return builder
         * 
         */
        public Builder username(Output username) {
            $.username = username;
            return this;
        }

        /**
         * @param username The username for the user. Must be unique within the user pool. Must be a UTF-8 string between 1 and 128 characters. After the user is created, the username cannot be changed.
         * 
         * The following arguments are optional:
         * 
         * @return builder
         * 
         */
        public Builder username(String username) {
            return username(Output.of(username));
        }

        /**
         * @param validationData The user's validation data. This is an array of name-value pairs that contain user attributes and attribute values that you can use for custom validation, such as restricting the types of user accounts that can be registered. Amazon Cognito does not store the `validation_data` value. For more information, see [Customizing User Pool Workflows with Lambda Triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html).
         * 
         * > **NOTE:** Clearing `password` or `temporary_password` does not reset user's password in Cognito.
         * 
         * @return builder
         * 
         */
        public Builder validationData(@Nullable Output> validationData) {
            $.validationData = validationData;
            return this;
        }

        /**
         * @param validationData The user's validation data. This is an array of name-value pairs that contain user attributes and attribute values that you can use for custom validation, such as restricting the types of user accounts that can be registered. Amazon Cognito does not store the `validation_data` value. For more information, see [Customizing User Pool Workflows with Lambda Triggers](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html).
         * 
         * > **NOTE:** Clearing `password` or `temporary_password` does not reset user's password in Cognito.
         * 
         * @return builder
         * 
         */
        public Builder validationData(Map validationData) {
            return validationData(Output.of(validationData));
        }

        public UserArgs build() {
            if ($.userPoolId == null) {
                throw new MissingRequiredPropertyException("UserArgs", "userPoolId");
            }
            if ($.username == null) {
                throw new MissingRequiredPropertyException("UserArgs", "username");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy