1. Packages
  2. AWS
  3. API Docs
  4. lightsail
  5. DomainEntry
AWS v6.83.0 published on Monday, Jun 16, 2025 by Pulumi

aws.lightsail.DomainEntry

Explore with Pulumi AI

aws logo
AWS v6.83.0 published on Monday, Jun 16, 2025 by Pulumi

    Manages a Lightsail domain entry (DNS record). Use this resource to define how DNS queries for your domain are handled.

    NOTE on id: In an effort to simplify imports, this resource id field has been updated to the standard resource id separator, a comma (,). For backward compatibility, the previous separator (underscore _) can still be used to read and import existing resources. When state is refreshed, the id will be updated to use the new standard separator. The previous separator will be deprecated in a future major release.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.lightsail.Domain("example", {domainName: "example.com"});
    const exampleDomainEntry = new aws.lightsail.DomainEntry("example", {
        domainName: example.domainName,
        name: "www",
        type: "A",
        target: "127.0.0.1",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.lightsail.Domain("example", domain_name="example.com")
    example_domain_entry = aws.lightsail.DomainEntry("example",
        domain_name=example.domain_name,
        name="www",
        type="A",
        target="127.0.0.1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := lightsail.NewDomain(ctx, "example", &lightsail.DomainArgs{
    			DomainName: pulumi.String("example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = lightsail.NewDomainEntry(ctx, "example", &lightsail.DomainEntryArgs{
    			DomainName: example.DomainName,
    			Name:       pulumi.String("www"),
    			Type:       pulumi.String("A"),
    			Target:     pulumi.String("127.0.0.1"),
    		})
    		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.LightSail.Domain("example", new()
        {
            DomainName = "example.com",
        });
    
        var exampleDomainEntry = new Aws.LightSail.DomainEntry("example", new()
        {
            DomainName = example.DomainName,
            Name = "www",
            Type = "A",
            Target = "127.0.0.1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lightsail.Domain;
    import com.pulumi.aws.lightsail.DomainArgs;
    import com.pulumi.aws.lightsail.DomainEntry;
    import com.pulumi.aws.lightsail.DomainEntryArgs;
    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()
                .domainName("example.com")
                .build());
    
            var exampleDomainEntry = new DomainEntry("exampleDomainEntry", DomainEntryArgs.builder()
                .domainName(example.domainName())
                .name("www")
                .type("A")
                .target("127.0.0.1")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:lightsail:Domain
        properties:
          domainName: example.com
      exampleDomainEntry:
        type: aws:lightsail:DomainEntry
        name: example
        properties:
          domainName: ${example.domainName}
          name: www
          type: A
          target: 127.0.0.1
    

    Create DomainEntry Resource

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

    Constructor syntax

    new DomainEntry(name: string, args: DomainEntryArgs, opts?: CustomResourceOptions);
    @overload
    def DomainEntry(resource_name: str,
                    args: DomainEntryArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def DomainEntry(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    domain_name: Optional[str] = None,
                    target: Optional[str] = None,
                    type: Optional[str] = None,
                    is_alias: Optional[bool] = None,
                    name: Optional[str] = None)
    func NewDomainEntry(ctx *Context, name string, args DomainEntryArgs, opts ...ResourceOption) (*DomainEntry, error)
    public DomainEntry(string name, DomainEntryArgs args, CustomResourceOptions? opts = null)
    public DomainEntry(String name, DomainEntryArgs args)
    public DomainEntry(String name, DomainEntryArgs args, CustomResourceOptions options)
    
    type: aws:lightsail:DomainEntry
    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 DomainEntryArgs
    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 DomainEntryArgs
    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 DomainEntryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DomainEntryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DomainEntryArgs
    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 domainEntryResource = new Aws.LightSail.DomainEntry("domainEntryResource", new()
    {
        DomainName = "string",
        Target = "string",
        Type = "string",
        IsAlias = false,
        Name = "string",
    });
    
    example, err := lightsail.NewDomainEntry(ctx, "domainEntryResource", &lightsail.DomainEntryArgs{
    	DomainName: pulumi.String("string"),
    	Target:     pulumi.String("string"),
    	Type:       pulumi.String("string"),
    	IsAlias:    pulumi.Bool(false),
    	Name:       pulumi.String("string"),
    })
    
    var domainEntryResource = new DomainEntry("domainEntryResource", DomainEntryArgs.builder()
        .domainName("string")
        .target("string")
        .type("string")
        .isAlias(false)
        .name("string")
        .build());
    
    domain_entry_resource = aws.lightsail.DomainEntry("domainEntryResource",
        domain_name="string",
        target="string",
        type="string",
        is_alias=False,
        name="string")
    
    const domainEntryResource = new aws.lightsail.DomainEntry("domainEntryResource", {
        domainName: "string",
        target: "string",
        type: "string",
        isAlias: false,
        name: "string",
    });
    
    type: aws:lightsail:DomainEntry
    properties:
        domainName: string
        isAlias: false
        name: string
        target: string
        type: string
    

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

    DomainName string
    Name of the Lightsail domain in which to create the entry.
    Target string
    Target of the domain entry.
    Type string

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    IsAlias bool
    Whether the entry should be an alias. Default: false.
    Name string
    Name of the entry record.
    DomainName string
    Name of the Lightsail domain in which to create the entry.
    Target string
    Target of the domain entry.
    Type string

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    IsAlias bool
    Whether the entry should be an alias. Default: false.
    Name string
    Name of the entry record.
    domainName String
    Name of the Lightsail domain in which to create the entry.
    target String
    Target of the domain entry.
    type String

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    isAlias Boolean
    Whether the entry should be an alias. Default: false.
    name String
    Name of the entry record.
    domainName string
    Name of the Lightsail domain in which to create the entry.
    target string
    Target of the domain entry.
    type string

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    isAlias boolean
    Whether the entry should be an alias. Default: false.
    name string
    Name of the entry record.
    domain_name str
    Name of the Lightsail domain in which to create the entry.
    target str
    Target of the domain entry.
    type str

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    is_alias bool
    Whether the entry should be an alias. Default: false.
    name str
    Name of the entry record.
    domainName String
    Name of the Lightsail domain in which to create the entry.
    target String
    Target of the domain entry.
    type String

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    isAlias Boolean
    Whether the entry should be an alias. Default: false.
    name String
    Name of the entry record.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DomainEntry 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 DomainEntry Resource

    Get an existing DomainEntry 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?: DomainEntryState, opts?: CustomResourceOptions): DomainEntry
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            domain_name: Optional[str] = None,
            is_alias: Optional[bool] = None,
            name: Optional[str] = None,
            target: Optional[str] = None,
            type: Optional[str] = None) -> DomainEntry
    func GetDomainEntry(ctx *Context, name string, id IDInput, state *DomainEntryState, opts ...ResourceOption) (*DomainEntry, error)
    public static DomainEntry Get(string name, Input<string> id, DomainEntryState? state, CustomResourceOptions? opts = null)
    public static DomainEntry get(String name, Output<String> id, DomainEntryState state, CustomResourceOptions options)
    resources:  _:    type: aws:lightsail:DomainEntry    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
    Name of the Lightsail domain in which to create the entry.
    IsAlias bool
    Whether the entry should be an alias. Default: false.
    Name string
    Name of the entry record.
    Target string
    Target of the domain entry.
    Type string

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    DomainName string
    Name of the Lightsail domain in which to create the entry.
    IsAlias bool
    Whether the entry should be an alias. Default: false.
    Name string
    Name of the entry record.
    Target string
    Target of the domain entry.
    Type string

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    domainName String
    Name of the Lightsail domain in which to create the entry.
    isAlias Boolean
    Whether the entry should be an alias. Default: false.
    name String
    Name of the entry record.
    target String
    Target of the domain entry.
    type String

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    domainName string
    Name of the Lightsail domain in which to create the entry.
    isAlias boolean
    Whether the entry should be an alias. Default: false.
    name string
    Name of the entry record.
    target string
    Target of the domain entry.
    type string

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    domain_name str
    Name of the Lightsail domain in which to create the entry.
    is_alias bool
    Whether the entry should be an alias. Default: false.
    name str
    Name of the entry record.
    target str
    Target of the domain entry.
    type str

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    domainName String
    Name of the Lightsail domain in which to create the entry.
    isAlias Boolean
    Whether the entry should be an alias. Default: false.
    name String
    Name of the entry record.
    target String
    Target of the domain entry.
    type String

    Type of record. Valid values: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT.

    The following arguments are optional:

    Import

    Using pulumi import, import Lightsail Domain Entry using the id attribute. For example:

    $ pulumi import aws:lightsail/domainEntry:DomainEntry example www,example.com,A,127.0.0.1
    

    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
    AWS v6.83.0 published on Monday, Jun 16, 2025 by Pulumi