1. Packages
  2. AWS
  3. API Docs
  4. workmail
  5. DefaultDomain
Viewing docs for AWS v7.24.0
published on Tuesday, Mar 31, 2026 by Pulumi
aws logo
Viewing docs for AWS v7.24.0
published on Tuesday, Mar 31, 2026 by Pulumi

    Manages the default mail domain for an AWS WorkMail organization.

    NOTE: This does not register a domain for workmail. This resource requires a verified domain name to be used as default domain for workmail organization.

    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"});
    const exampleDefaultDomain = new aws.workmail.DefaultDomain("example", {
        organizationId: example.id,
        domainName: example.defaultMailDomain,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.workmail.Organization("example", organization_alias="example-org")
    example_default_domain = aws.workmail.DefaultDomain("example",
        organization_id=example.id,
        domain_name=example.default_mail_domain)
    
    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"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = workmail.NewDefaultDomain(ctx, "example", &workmail.DefaultDomainArgs{
    			OrganizationId: example.ID(),
    			DomainName:     example.DefaultMailDomain,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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",
        });
    
        var exampleDefaultDomain = new Aws.WorkMail.DefaultDomain("example", new()
        {
            OrganizationId = example.Id,
            DomainName = example.DefaultMailDomain,
        });
    
    });
    
    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.DefaultDomain;
    import com.pulumi.aws.workmail.DefaultDomainArgs;
    import java.util.List;
    import java.util.ArrayList;
    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")
                .build());
    
            var exampleDefaultDomain = new DefaultDomain("exampleDefaultDomain", DefaultDomainArgs.builder()
                .organizationId(example.id())
                .domainName(example.defaultMailDomain())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:workmail:Organization
        properties:
          organizationAlias: example-org
      exampleDefaultDomain:
        type: aws:workmail:DefaultDomain
        name: example
        properties:
          organizationId: ${example.id}
          domainName: ${example.defaultMailDomain}
    

    Create DefaultDomain Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DefaultDomain(name: string, args: DefaultDomainArgs, opts?: CustomResourceOptions);
    @overload
    def DefaultDomain(resource_name: str,
                      args: DefaultDomainArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def DefaultDomain(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      domain_name: Optional[str] = None,
                      organization_id: Optional[str] = None,
                      region: Optional[str] = None)
    func NewDefaultDomain(ctx *Context, name string, args DefaultDomainArgs, opts ...ResourceOption) (*DefaultDomain, error)
    public DefaultDomain(string name, DefaultDomainArgs args, CustomResourceOptions? opts = null)
    public DefaultDomain(String name, DefaultDomainArgs args)
    public DefaultDomain(String name, DefaultDomainArgs args, CustomResourceOptions options)
    
    type: aws:workmail:DefaultDomain
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args DefaultDomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args DefaultDomainArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args DefaultDomainArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DefaultDomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DefaultDomainArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var defaultDomainResource = new Aws.WorkMail.DefaultDomain("defaultDomainResource", new()
    {
        DomainName = "string",
        OrganizationId = "string",
        Region = "string",
    });
    
    example, err := workmail.NewDefaultDomain(ctx, "defaultDomainResource", &workmail.DefaultDomainArgs{
    	DomainName:     pulumi.String("string"),
    	OrganizationId: pulumi.String("string"),
    	Region:         pulumi.String("string"),
    })
    
    var defaultDomainResource = new DefaultDomain("defaultDomainResource", DefaultDomainArgs.builder()
        .domainName("string")
        .organizationId("string")
        .region("string")
        .build());
    
    default_domain_resource = aws.workmail.DefaultDomain("defaultDomainResource",
        domain_name="string",
        organization_id="string",
        region="string")
    
    const defaultDomainResource = new aws.workmail.DefaultDomain("defaultDomainResource", {
        domainName: "string",
        organizationId: "string",
        region: "string",
    });
    
    type: aws:workmail:DefaultDomain
    properties:
        domainName: string
        organizationId: string
        region: string
    

    DefaultDomain Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The DefaultDomain resource accepts the following input properties:

    DomainName string
    Mail domain name to set as the default.
    OrganizationId string
    Identifier of the WorkMail organization. Changing this forces a new resource.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    DomainName string
    Mail domain name to set as the default.
    OrganizationId string
    Identifier of the WorkMail organization. Changing this forces a new resource.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    domainName String
    Mail domain name to set as the default.
    organizationId String
    Identifier of the WorkMail organization. Changing this forces a new resource.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    domainName string
    Mail domain name to set as the default.
    organizationId string
    Identifier of the WorkMail organization. Changing this forces a new resource.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    domain_name str
    Mail domain name to set as the default.
    organization_id str
    Identifier of the WorkMail organization. Changing this forces a new resource.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    domainName String
    Mail domain name to set as the default.
    organizationId String
    Identifier of the WorkMail organization. Changing this forces a new resource.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DefaultDomain resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DefaultDomain Resource

    Get an existing DefaultDomain resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: DefaultDomainState, opts?: CustomResourceOptions): DefaultDomain
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            domain_name: Optional[str] = None,
            organization_id: Optional[str] = None,
            region: Optional[str] = None) -> DefaultDomain
    func GetDefaultDomain(ctx *Context, name string, id IDInput, state *DefaultDomainState, opts ...ResourceOption) (*DefaultDomain, error)
    public static DefaultDomain Get(string name, Input<string> id, DefaultDomainState? state, CustomResourceOptions? opts = null)
    public static DefaultDomain get(String name, Output<String> id, DefaultDomainState state, CustomResourceOptions options)
    resources:  _:    type: aws:workmail:DefaultDomain    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DomainName string
    Mail domain name to set as the default.
    OrganizationId string
    Identifier of the WorkMail organization. Changing this forces a new resource.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    DomainName string
    Mail domain name to set as the default.
    OrganizationId string
    Identifier of the WorkMail organization. Changing this forces a new resource.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    domainName String
    Mail domain name to set as the default.
    organizationId String
    Identifier of the WorkMail organization. Changing this forces a new resource.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    domainName string
    Mail domain name to set as the default.
    organizationId string
    Identifier of the WorkMail organization. Changing this forces a new resource.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    domain_name str
    Mail domain name to set as the default.
    organization_id str
    Identifier of the WorkMail organization. Changing this forces a new resource.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    domainName String
    Mail domain name to set as the default.
    organizationId String
    Identifier of the WorkMail organization. Changing this forces a new resource.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    Import

    Using pulumi import, import WorkMail Default Domain using the organization ID. For example:

    $ pulumi import aws:workmail/defaultDomain:DefaultDomain example "m-1234567890abcdef0"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    Viewing docs for AWS v7.24.0
    published on Tuesday, Mar 31, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.