1. Packages
  2. AWS
  3. API Docs
  4. workmail
  5. Domain
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 a mail domain registered to an AWS WorkMail organization.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.workmail.Domain("example", {
        organizationId: exampleAwsWorkmailOrganization.id,
        domainName: "example.com",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.workmail.Domain("example",
        organization_id=example_aws_workmail_organization["id"],
        domain_name="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 {
    		_, err := workmail.NewDomain(ctx, "example", &workmail.DomainArgs{
    			OrganizationId: pulumi.Any(exampleAwsWorkmailOrganization.Id),
    			DomainName:     pulumi.String("example.com"),
    		})
    		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.Domain("example", new()
        {
            OrganizationId = exampleAwsWorkmailOrganization.Id,
            DomainName = "example.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.workmail.Domain;
    import com.pulumi.aws.workmail.DomainArgs;
    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 Domain("example", DomainArgs.builder()
                .organizationId(exampleAwsWorkmailOrganization.id())
                .domainName("example.com")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:workmail:Domain
        properties:
          organizationId: ${exampleAwsWorkmailOrganization.id}
          domainName: example.com
    

    Create Domain Resource

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

    Constructor syntax

    new Domain(name: string, args: DomainArgs, opts?: CustomResourceOptions);
    @overload
    def Domain(resource_name: str,
               args: DomainArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Domain(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               domain_name: Optional[str] = None,
               organization_id: Optional[str] = None,
               region: Optional[str] = None)
    func NewDomain(ctx *Context, name string, args DomainArgs, opts ...ResourceOption) (*Domain, error)
    public Domain(string name, DomainArgs args, CustomResourceOptions? opts = null)
    public Domain(String name, DomainArgs args)
    public Domain(String name, DomainArgs args, CustomResourceOptions options)
    
    type: aws:workmail:Domain
    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 DomainArgs
    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 DomainArgs
    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 DomainArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DomainArgs
    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 exampledomainResourceResourceFromWorkmaildomain = new Aws.WorkMail.Domain("exampledomainResourceResourceFromWorkmaildomain", new()
    {
        DomainName = "string",
        OrganizationId = "string",
        Region = "string",
    });
    
    example, err := workmail.NewDomain(ctx, "exampledomainResourceResourceFromWorkmaildomain", &workmail.DomainArgs{
    	DomainName:     pulumi.String("string"),
    	OrganizationId: pulumi.String("string"),
    	Region:         pulumi.String("string"),
    })
    
    var exampledomainResourceResourceFromWorkmaildomain = new com.pulumi.aws.workmail.Domain("exampledomainResourceResourceFromWorkmaildomain", com.pulumi.aws.workmail.DomainArgs.builder()
        .domainName("string")
        .organizationId("string")
        .region("string")
        .build());
    
    exampledomain_resource_resource_from_workmaildomain = aws.workmail.Domain("exampledomainResourceResourceFromWorkmaildomain",
        domain_name="string",
        organization_id="string",
        region="string")
    
    const exampledomainResourceResourceFromWorkmaildomain = new aws.workmail.Domain("exampledomainResourceResourceFromWorkmaildomain", {
        domainName: "string",
        organizationId: "string",
        region: "string",
    });
    
    type: aws:workmail:Domain
    properties:
        domainName: string
        organizationId: string
        region: string
    

    Domain 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 Domain resource accepts the following input properties:

    DomainName string
    Mail domain name to register. Changing this forces a new resource.
    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 register. Changing this forces a new resource.
    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 register. Changing this forces a new resource.
    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 register. Changing this forces a new resource.
    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 register. Changing this forces a new resource.
    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 register. Changing this forces a new resource.
    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 Domain resource produces the following output properties:

    DkimVerificationStatus string
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsDefault bool
    Whether this domain is the default mail domain for the organization.
    IsTestDomain bool
    Whether this is the auto-provisioned test domain.
    OwnershipVerificationStatus string
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    Records List<DomainRecord>
    List of DNS records required for domain verification. See records below.
    DkimVerificationStatus string
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsDefault bool
    Whether this domain is the default mail domain for the organization.
    IsTestDomain bool
    Whether this is the auto-provisioned test domain.
    OwnershipVerificationStatus string
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    Records []DomainRecord
    List of DNS records required for domain verification. See records below.
    dkimVerificationStatus String
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    id String
    The provider-assigned unique ID for this managed resource.
    isDefault Boolean
    Whether this domain is the default mail domain for the organization.
    isTestDomain Boolean
    Whether this is the auto-provisioned test domain.
    ownershipVerificationStatus String
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    records List<DomainRecord>
    List of DNS records required for domain verification. See records below.
    dkimVerificationStatus string
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    id string
    The provider-assigned unique ID for this managed resource.
    isDefault boolean
    Whether this domain is the default mail domain for the organization.
    isTestDomain boolean
    Whether this is the auto-provisioned test domain.
    ownershipVerificationStatus string
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    records DomainRecord[]
    List of DNS records required for domain verification. See records below.
    dkim_verification_status str
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    id str
    The provider-assigned unique ID for this managed resource.
    is_default bool
    Whether this domain is the default mail domain for the organization.
    is_test_domain bool
    Whether this is the auto-provisioned test domain.
    ownership_verification_status str
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    records Sequence[DomainRecord]
    List of DNS records required for domain verification. See records below.
    dkimVerificationStatus String
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    id String
    The provider-assigned unique ID for this managed resource.
    isDefault Boolean
    Whether this domain is the default mail domain for the organization.
    isTestDomain Boolean
    Whether this is the auto-provisioned test domain.
    ownershipVerificationStatus String
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    records List<Property Map>
    List of DNS records required for domain verification. See records below.

    Look up Existing Domain Resource

    Get an existing Domain 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?: DomainState, opts?: CustomResourceOptions): Domain
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dkim_verification_status: Optional[str] = None,
            domain_name: Optional[str] = None,
            is_default: Optional[bool] = None,
            is_test_domain: Optional[bool] = None,
            organization_id: Optional[str] = None,
            ownership_verification_status: Optional[str] = None,
            records: Optional[Sequence[DomainRecordArgs]] = None,
            region: Optional[str] = None) -> Domain
    func GetDomain(ctx *Context, name string, id IDInput, state *DomainState, opts ...ResourceOption) (*Domain, error)
    public static Domain Get(string name, Input<string> id, DomainState? state, CustomResourceOptions? opts = null)
    public static Domain get(String name, Output<String> id, DomainState state, CustomResourceOptions options)
    resources:  _:    type: aws:workmail:Domain    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:
    DkimVerificationStatus string
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    DomainName string
    Mail domain name to register. Changing this forces a new resource.
    IsDefault bool
    Whether this domain is the default mail domain for the organization.
    IsTestDomain bool
    Whether this is the auto-provisioned test domain.
    OrganizationId string
    Identifier of the WorkMail organization. Changing this forces a new resource.
    OwnershipVerificationStatus string
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    Records List<DomainRecord>
    List of DNS records required for domain verification. See records below.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    DkimVerificationStatus string
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    DomainName string
    Mail domain name to register. Changing this forces a new resource.
    IsDefault bool
    Whether this domain is the default mail domain for the organization.
    IsTestDomain bool
    Whether this is the auto-provisioned test domain.
    OrganizationId string
    Identifier of the WorkMail organization. Changing this forces a new resource.
    OwnershipVerificationStatus string
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    Records []DomainRecordArgs
    List of DNS records required for domain verification. See records below.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    dkimVerificationStatus String
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    domainName String
    Mail domain name to register. Changing this forces a new resource.
    isDefault Boolean
    Whether this domain is the default mail domain for the organization.
    isTestDomain Boolean
    Whether this is the auto-provisioned test domain.
    organizationId String
    Identifier of the WorkMail organization. Changing this forces a new resource.
    ownershipVerificationStatus String
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    records List<DomainRecord>
    List of DNS records required for domain verification. See records below.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    dkimVerificationStatus string
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    domainName string
    Mail domain name to register. Changing this forces a new resource.
    isDefault boolean
    Whether this domain is the default mail domain for the organization.
    isTestDomain boolean
    Whether this is the auto-provisioned test domain.
    organizationId string
    Identifier of the WorkMail organization. Changing this forces a new resource.
    ownershipVerificationStatus string
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    records DomainRecord[]
    List of DNS records required for domain verification. See records below.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    dkim_verification_status str
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    domain_name str
    Mail domain name to register. Changing this forces a new resource.
    is_default bool
    Whether this domain is the default mail domain for the organization.
    is_test_domain bool
    Whether this is the auto-provisioned test domain.
    organization_id str
    Identifier of the WorkMail organization. Changing this forces a new resource.
    ownership_verification_status str
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    records Sequence[DomainRecordArgs]
    List of DNS records required for domain verification. See records below.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    dkimVerificationStatus String
    DKIM verification status. Values: PENDING, VERIFIED, FAILED.
    domainName String
    Mail domain name to register. Changing this forces a new resource.
    isDefault Boolean
    Whether this domain is the default mail domain for the organization.
    isTestDomain Boolean
    Whether this is the auto-provisioned test domain.
    organizationId String
    Identifier of the WorkMail organization. Changing this forces a new resource.
    ownershipVerificationStatus String
    Domain ownership verification status. Values: PENDING, VERIFIED, FAILED.
    records List<Property Map>
    List of DNS records required for domain verification. See records below.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    Supporting Types

    DomainRecord, DomainRecordArgs

    Hostname string
    DNS record hostname.
    Type string
    DNS record type (e.g. CNAME, MX, TXT).
    Value string
    DNS record value.
    Hostname string
    DNS record hostname.
    Type string
    DNS record type (e.g. CNAME, MX, TXT).
    Value string
    DNS record value.
    hostname String
    DNS record hostname.
    type String
    DNS record type (e.g. CNAME, MX, TXT).
    value String
    DNS record value.
    hostname string
    DNS record hostname.
    type string
    DNS record type (e.g. CNAME, MX, TXT).
    value string
    DNS record value.
    hostname str
    DNS record hostname.
    type str
    DNS record type (e.g. CNAME, MX, TXT).
    value str
    DNS record value.
    hostname String
    DNS record hostname.
    type String
    DNS record type (e.g. CNAME, MX, TXT).
    value String
    DNS record value.

    Import

    Using pulumi import, import WorkMail Domain using organization_id,domain_name. For example:

    $ pulumi import aws:workmail/domain:Domain example "m-1234567890abcdef0,example.com"
    

    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.