User class

Manages an AWS WorkMail User.

This resource registers the user with WorkMail on create so the mailbox is enabled and ready for use. This results in the accumulation of costs, for more details, see pricing. On destroy, it deregisters the user before deletion.

Example Usage

Basic Usage

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

const example = new aws.workmail.Organization("example", {
    organizationAlias: "example-org",
    deleteDirectory: true,
});
const exampleUser = new aws.workmail.User("example", {
    organizationId: example.organizationId,
    name: "example-user",
    displayName: "Example User",
    email: "example-user@example.com",
});
import pulumi
import pulumi_aws as aws

example = aws.workmail.Organization("example",
    organization_alias="example-org",
    delete_directory=True)
example_user = aws.workmail.User("example",
    organization_id=example.organization_id,
    name="example-user",
    display_name="Example User",
    email="example-user@example.com")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.WorkMail.Organization("example", new()
    {
        OrganizationAlias = "example-org",
        DeleteDirectory = true,
    });

    var exampleUser = new Aws.WorkMail.User("example", new()
    {
        OrganizationId = example.OrganizationId,
        Name = "example-user",
        DisplayName = "Example User",
        Email = "example-user@example.com",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := workmail.NewOrganization(ctx, "example", &workmail.OrganizationArgs{
			OrganizationAlias: pulumi.String("example-org"),
			DeleteDirectory:   pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = workmail.NewUser(ctx, "example", &workmail.UserArgs{
			OrganizationId: example.OrganizationId,
			Name:           pulumi.String("example-user"),
			DisplayName:    pulumi.String("Example User"),
			Email:          pulumi.String("example-user@example.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_workmail_organization" "example" {
  organization_alias = "example-org"
  delete_directory   = true
}
resource "aws_workmail_user" "example" {
  organization_id = aws_workmail_organization.example.organization_id
  name            = "example-user"
  display_name    = "Example User"
  email           = "example-user@example.com"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.workmail.Organization;
import com.pulumi.aws.workmail.OrganizationArgs;
import com.pulumi.aws.workmail.User;
import com.pulumi.aws.workmail.UserArgs;
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 Organization("example", OrganizationArgs.builder()
            .organizationAlias("example-org")
            .deleteDirectory(true)
            .build());

        var exampleUser = new User("exampleUser", UserArgs.builder()
            .organizationId(example.organizationId())
            .name("example-user")
            .displayName("Example User")
            .email("example-user@example.com")
            .build());

    }
}
resources:
  example:
    type: aws:workmail:Organization
    properties:
      organizationAlias: example-org
      deleteDirectory: true
  exampleUser:
    type: aws:workmail:User
    name: example
    properties:
      organizationId: ${example.organizationId}
      name: example-user
      displayName: Example User
      email: example-user@example.com

Import

Identity Schema

Required

  • organizationId - Identifier of the WorkMail organization.
  • userId - Identifier of the user.

Optional

  • accountId (String) AWS Account where this resource is managed.
  • region (String) Region where this resource is managed.

Using pulumi import, import WorkMail User using organization_id,user_id. For example:

$ pulumi import aws:workmail/user:User example m-1234567890abcdef1234567890abcdef,12345678-1234-1234-1234-123456789012

Constructors

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

Properties

childResources Set<Resource>
finalinherited
city ↔ Output<String?>
City where the user is located.
latefinal
company ↔ Output<String?>
Company associated with the user.
latefinal
completionSources Map<String, IOutputCompletionSource>
latefinalinherited
country ↔ Output<String?>
Country where the user is located.
latefinal
department ↔ Output<String?>
Department associated with the user.
latefinal
disabledDate ↔ Output<String>
Timestamp when the user was disabled from WorkMail use.
latefinal
displayName ↔ Output<String>
Display name of the user.
latefinal
email ↔ Output<String>
Primary email address used to register the user with WorkMail. Changing this value forces replacement.
latefinal
enabledDate ↔ Output<String>
Timestamp when the user was enabled for WorkMail use.
latefinal
firstName ↔ Output<String?>
First name of the user.
latefinal
hashCode int
The hash code for this object.
no setterinherited
hiddenFromGlobalAddressList ↔ Output<bool>
Whether to hide the user from the global address list. Defaults to false.
latefinal
id ↔ Output<String>
getter/setter pairinherited
identityProviderIdentityStoreId ↔ Output<String>
Identity store ID from IAM Identity Center associated with the user.
latefinal
identityProviderUserId ↔ Output<String?>
User ID from IAM Identity Center associated with the user.
latefinal
initials ↔ Output<String?>
Initials of the user.
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
jobTitle ↔ Output<String?>
Job title of the user.
latefinal
lastName ↔ Output<String?>
Last name of the user.
latefinal
mailboxDeprovisionedDate ↔ Output<String>
Timestamp when the mailbox was removed for the user.
latefinal
mailboxProvisionedDate ↔ Output<String>
Timestamp when the mailbox was created for the user.
latefinal
name ↔ Output<String>
Username of the user.
latefinal
office ↔ Output<String?>
Office where the user is located.
latefinal
organizationId ↔ Output<String>
Identifier of the WorkMail organization where the user is managed.
latefinal
password ↔ Output<String?>
Password to set for the user.
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
state ↔ Output<String>
Current WorkMail state of the user.
latefinal
street ↔ Output<String?>
Street address of the user.
latefinal
telephone ↔ Output<String?>
Telephone number of the user.
latefinal
transformations List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
userId ↔ Output<String>
Identifier of the user.
latefinal
userRole ↔ Output<String>
Role assigned to the user. Valid values are USER, REMOTE_USER, RESOURCE, and SYSTEM_USER.
latefinal
zipCode ↔ Output<String?>
ZIP or postal code of the user.
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, {UserState? state, CustomResourceOptions? options}) User
Gets an existing User resource's state with the given name and id.