1. Packages
  2. AWS
  3. API Docs
  4. lightsail
  5. Instance
AWS v7.1.0 published on Monday, Jul 21, 2025 by Pulumi

aws.lightsail.Instance

Explore with Pulumi AI

aws logo
AWS v7.1.0 published on Monday, Jul 21, 2025 by Pulumi

    Manages a Lightsail Instance. Use this resource to create easy virtual private servers with custom software already setup.

    Note: Lightsail is currently only supported in a limited number of AWS Regions, please see “Regions and Availability Zones in Amazon Lightsail” for more details

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.lightsail.Instance("example", {
        name: "example",
        availabilityZone: "us-east-1b",
        blueprintId: "amazon_linux_2",
        bundleId: "nano_3_0",
        keyPairName: "some_key_name",
        tags: {
            foo: "bar",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.lightsail.Instance("example",
        name="example",
        availability_zone="us-east-1b",
        blueprint_id="amazon_linux_2",
        bundle_id="nano_3_0",
        key_pair_name="some_key_name",
        tags={
            "foo": "bar",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/lightsail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := lightsail.NewInstance(ctx, "example", &lightsail.InstanceArgs{
    			Name:             pulumi.String("example"),
    			AvailabilityZone: pulumi.String("us-east-1b"),
    			BlueprintId:      pulumi.String("amazon_linux_2"),
    			BundleId:         pulumi.String("nano_3_0"),
    			KeyPairName:      pulumi.String("some_key_name"),
    			Tags: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    		})
    		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.Instance("example", new()
        {
            Name = "example",
            AvailabilityZone = "us-east-1b",
            BlueprintId = "amazon_linux_2",
            BundleId = "nano_3_0",
            KeyPairName = "some_key_name",
            Tags = 
            {
                { "foo", "bar" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lightsail.Instance;
    import com.pulumi.aws.lightsail.InstanceArgs;
    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 Instance("example", InstanceArgs.builder()
                .name("example")
                .availabilityZone("us-east-1b")
                .blueprintId("amazon_linux_2")
                .bundleId("nano_3_0")
                .keyPairName("some_key_name")
                .tags(Map.of("foo", "bar"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:lightsail:Instance
        properties:
          name: example
          availabilityZone: us-east-1b
          blueprintId: amazon_linux_2
          bundleId: nano_3_0
          keyPairName: some_key_name
          tags:
            foo: bar
    

    Example With User Data

    Lightsail user data is handled differently than EC2 user data. Lightsail user data only accepts a single lined string. The below example shows installing apache and creating the index page.

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.lightsail.Instance("example", {
        name: "example",
        availabilityZone: "us-east-1b",
        blueprintId: "amazon_linux_2",
        bundleId: "nano_3_0",
        userData: "sudo yum install -y httpd && sudo systemctl start httpd && sudo systemctl enable httpd && echo '<h1>Deployed via Pulumi</h1>' | sudo tee /var/www/html/index.html",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.lightsail.Instance("example",
        name="example",
        availability_zone="us-east-1b",
        blueprint_id="amazon_linux_2",
        bundle_id="nano_3_0",
        user_data="sudo yum install -y httpd && sudo systemctl start httpd && sudo systemctl enable httpd && echo '<h1>Deployed via Pulumi</h1>' | sudo tee /var/www/html/index.html")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/lightsail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := lightsail.NewInstance(ctx, "example", &lightsail.InstanceArgs{
    			Name:             pulumi.String("example"),
    			AvailabilityZone: pulumi.String("us-east-1b"),
    			BlueprintId:      pulumi.String("amazon_linux_2"),
    			BundleId:         pulumi.String("nano_3_0"),
    			UserData:         pulumi.String("sudo yum install -y httpd && sudo systemctl start httpd && sudo systemctl enable httpd && echo '<h1>Deployed via Pulumi</h1>' | sudo tee /var/www/html/index.html"),
    		})
    		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.Instance("example", new()
        {
            Name = "example",
            AvailabilityZone = "us-east-1b",
            BlueprintId = "amazon_linux_2",
            BundleId = "nano_3_0",
            UserData = "sudo yum install -y httpd && sudo systemctl start httpd && sudo systemctl enable httpd && echo '<h1>Deployed via Pulumi</h1>' | sudo tee /var/www/html/index.html",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lightsail.Instance;
    import com.pulumi.aws.lightsail.InstanceArgs;
    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 Instance("example", InstanceArgs.builder()
                .name("example")
                .availabilityZone("us-east-1b")
                .blueprintId("amazon_linux_2")
                .bundleId("nano_3_0")
                .userData("sudo yum install -y httpd && sudo systemctl start httpd && sudo systemctl enable httpd && echo '<h1>Deployed via Pulumi</h1>' | sudo tee /var/www/html/index.html")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:lightsail:Instance
        properties:
          name: example
          availabilityZone: us-east-1b
          blueprintId: amazon_linux_2
          bundleId: nano_3_0
          userData: sudo yum install -y httpd && sudo systemctl start httpd && sudo systemctl enable httpd && echo '<h1>Deployed via Pulumi</h1>' | sudo tee /var/www/html/index.html
    

    Enable Auto Snapshots

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.lightsail.Instance("example", {
        name: "example",
        availabilityZone: "us-east-1b",
        blueprintId: "amazon_linux_2",
        bundleId: "nano_3_0",
        addOn: {
            type: "AutoSnapshot",
            snapshotTime: "06:00",
            status: "Enabled",
        },
        tags: {
            foo: "bar",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.lightsail.Instance("example",
        name="example",
        availability_zone="us-east-1b",
        blueprint_id="amazon_linux_2",
        bundle_id="nano_3_0",
        add_on={
            "type": "AutoSnapshot",
            "snapshot_time": "06:00",
            "status": "Enabled",
        },
        tags={
            "foo": "bar",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/lightsail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := lightsail.NewInstance(ctx, "example", &lightsail.InstanceArgs{
    			Name:             pulumi.String("example"),
    			AvailabilityZone: pulumi.String("us-east-1b"),
    			BlueprintId:      pulumi.String("amazon_linux_2"),
    			BundleId:         pulumi.String("nano_3_0"),
    			AddOn: &lightsail.InstanceAddOnArgs{
    				Type:         pulumi.String("AutoSnapshot"),
    				SnapshotTime: pulumi.String("06:00"),
    				Status:       pulumi.String("Enabled"),
    			},
    			Tags: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    		})
    		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.Instance("example", new()
        {
            Name = "example",
            AvailabilityZone = "us-east-1b",
            BlueprintId = "amazon_linux_2",
            BundleId = "nano_3_0",
            AddOn = new Aws.LightSail.Inputs.InstanceAddOnArgs
            {
                Type = "AutoSnapshot",
                SnapshotTime = "06:00",
                Status = "Enabled",
            },
            Tags = 
            {
                { "foo", "bar" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lightsail.Instance;
    import com.pulumi.aws.lightsail.InstanceArgs;
    import com.pulumi.aws.lightsail.inputs.InstanceAddOnArgs;
    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 Instance("example", InstanceArgs.builder()
                .name("example")
                .availabilityZone("us-east-1b")
                .blueprintId("amazon_linux_2")
                .bundleId("nano_3_0")
                .addOn(InstanceAddOnArgs.builder()
                    .type("AutoSnapshot")
                    .snapshotTime("06:00")
                    .status("Enabled")
                    .build())
                .tags(Map.of("foo", "bar"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:lightsail:Instance
        properties:
          name: example
          availabilityZone: us-east-1b
          blueprintId: amazon_linux_2
          bundleId: nano_3_0
          addOn:
            type: AutoSnapshot
            snapshotTime: 06:00
            status: Enabled
          tags:
            foo: bar
    

    Create Instance Resource

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

    Constructor syntax

    new Instance(name: string, args: InstanceArgs, opts?: CustomResourceOptions);
    @overload
    def Instance(resource_name: str,
                 args: InstanceArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Instance(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 availability_zone: Optional[str] = None,
                 blueprint_id: Optional[str] = None,
                 bundle_id: Optional[str] = None,
                 add_on: Optional[InstanceAddOnArgs] = None,
                 ip_address_type: Optional[str] = None,
                 key_pair_name: Optional[str] = None,
                 name: Optional[str] = None,
                 region: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 user_data: Optional[str] = None)
    func NewInstance(ctx *Context, name string, args InstanceArgs, opts ...ResourceOption) (*Instance, error)
    public Instance(string name, InstanceArgs args, CustomResourceOptions? opts = null)
    public Instance(String name, InstanceArgs args)
    public Instance(String name, InstanceArgs args, CustomResourceOptions options)
    
    type: aws:lightsail:Instance
    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 InstanceArgs
    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 InstanceArgs
    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 InstanceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InstanceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InstanceArgs
    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 exampleinstanceResourceResourceFromLightsailinstance = new Aws.LightSail.Instance("exampleinstanceResourceResourceFromLightsailinstance", new()
    {
        AvailabilityZone = "string",
        BlueprintId = "string",
        BundleId = "string",
        AddOn = new Aws.LightSail.Inputs.InstanceAddOnArgs
        {
            SnapshotTime = "string",
            Status = "string",
            Type = "string",
        },
        IpAddressType = "string",
        KeyPairName = "string",
        Name = "string",
        Region = "string",
        Tags = 
        {
            { "string", "string" },
        },
        UserData = "string",
    });
    
    example, err := lightsail.NewInstance(ctx, "exampleinstanceResourceResourceFromLightsailinstance", &lightsail.InstanceArgs{
    	AvailabilityZone: pulumi.String("string"),
    	BlueprintId:      pulumi.String("string"),
    	BundleId:         pulumi.String("string"),
    	AddOn: &lightsail.InstanceAddOnArgs{
    		SnapshotTime: pulumi.String("string"),
    		Status:       pulumi.String("string"),
    		Type:         pulumi.String("string"),
    	},
    	IpAddressType: pulumi.String("string"),
    	KeyPairName:   pulumi.String("string"),
    	Name:          pulumi.String("string"),
    	Region:        pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	UserData: pulumi.String("string"),
    })
    
    var exampleinstanceResourceResourceFromLightsailinstance = new com.pulumi.aws.lightsail.Instance("exampleinstanceResourceResourceFromLightsailinstance", com.pulumi.aws.lightsail.InstanceArgs.builder()
        .availabilityZone("string")
        .blueprintId("string")
        .bundleId("string")
        .addOn(InstanceAddOnArgs.builder()
            .snapshotTime("string")
            .status("string")
            .type("string")
            .build())
        .ipAddressType("string")
        .keyPairName("string")
        .name("string")
        .region("string")
        .tags(Map.of("string", "string"))
        .userData("string")
        .build());
    
    exampleinstance_resource_resource_from_lightsailinstance = aws.lightsail.Instance("exampleinstanceResourceResourceFromLightsailinstance",
        availability_zone="string",
        blueprint_id="string",
        bundle_id="string",
        add_on={
            "snapshot_time": "string",
            "status": "string",
            "type": "string",
        },
        ip_address_type="string",
        key_pair_name="string",
        name="string",
        region="string",
        tags={
            "string": "string",
        },
        user_data="string")
    
    const exampleinstanceResourceResourceFromLightsailinstance = new aws.lightsail.Instance("exampleinstanceResourceResourceFromLightsailinstance", {
        availabilityZone: "string",
        blueprintId: "string",
        bundleId: "string",
        addOn: {
            snapshotTime: "string",
            status: "string",
            type: "string",
        },
        ipAddressType: "string",
        keyPairName: "string",
        name: "string",
        region: "string",
        tags: {
            string: "string",
        },
        userData: "string",
    });
    
    type: aws:lightsail:Instance
    properties:
        addOn:
            snapshotTime: string
            status: string
            type: string
        availabilityZone: string
        blueprintId: string
        bundleId: string
        ipAddressType: string
        keyPairName: string
        name: string
        region: string
        tags:
            string: string
        userData: string
    

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

    AvailabilityZone string
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    BlueprintId string
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    BundleId string
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    AddOn InstanceAddOn
    Add-on configuration for the instance. See below.
    IpAddressType string
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    KeyPairName string
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    Name string

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags Dictionary<string, string>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    UserData string
    Single lined launch script as a string to configure server with additional user data.
    AvailabilityZone string
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    BlueprintId string
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    BundleId string
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    AddOn InstanceAddOnArgs
    Add-on configuration for the instance. See below.
    IpAddressType string
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    KeyPairName string
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    Name string

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags map[string]string
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    UserData string
    Single lined launch script as a string to configure server with additional user data.
    availabilityZone String
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    blueprintId String
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    bundleId String
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    addOn InstanceAddOn
    Add-on configuration for the instance. See below.
    ipAddressType String
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    keyPairName String
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    name String

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String,String>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    userData String
    Single lined launch script as a string to configure server with additional user data.
    availabilityZone string
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    blueprintId string
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    bundleId string
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    addOn InstanceAddOn
    Add-on configuration for the instance. See below.
    ipAddressType string
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    keyPairName string
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    name string

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags {[key: string]: string}
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    userData string
    Single lined launch script as a string to configure server with additional user data.
    availability_zone str
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    blueprint_id str
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    bundle_id str
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    add_on InstanceAddOnArgs
    Add-on configuration for the instance. See below.
    ip_address_type str
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    key_pair_name str
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    name str

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Mapping[str, str]
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    user_data str
    Single lined launch script as a string to configure server with additional user data.
    availabilityZone String
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    blueprintId String
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    bundleId String
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    addOn Property Map
    Add-on configuration for the instance. See below.
    ipAddressType String
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    keyPairName String
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    name String

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    userData String
    Single lined launch script as a string to configure server with additional user data.

    Outputs

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

    Arn string
    ARN of the Lightsail instance (matches id).
    CpuCount int
    Number of vCPUs the instance has.
    CreatedAt string
    Timestamp when the instance was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6Addresses List<string>
    List of IPv6 addresses for the Lightsail instance.
    IsStaticIp bool
    Whether this instance has a static IP assigned to it.
    PrivateIpAddress string
    Private IP address of the instance.
    PublicIpAddress string
    Public IP address of the instance.
    RamSize double
    Amount of RAM in GB on the instance (e.g., 1.0).
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    Username string
    User name for connecting to the instance (e.g., ec2-user).
    Arn string
    ARN of the Lightsail instance (matches id).
    CpuCount int
    Number of vCPUs the instance has.
    CreatedAt string
    Timestamp when the instance was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6Addresses []string
    List of IPv6 addresses for the Lightsail instance.
    IsStaticIp bool
    Whether this instance has a static IP assigned to it.
    PrivateIpAddress string
    Private IP address of the instance.
    PublicIpAddress string
    Public IP address of the instance.
    RamSize float64
    Amount of RAM in GB on the instance (e.g., 1.0).
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    Username string
    User name for connecting to the instance (e.g., ec2-user).
    arn String
    ARN of the Lightsail instance (matches id).
    cpuCount Integer
    Number of vCPUs the instance has.
    createdAt String
    Timestamp when the instance was created.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6Addresses List<String>
    List of IPv6 addresses for the Lightsail instance.
    isStaticIp Boolean
    Whether this instance has a static IP assigned to it.
    privateIpAddress String
    Private IP address of the instance.
    publicIpAddress String
    Public IP address of the instance.
    ramSize Double
    Amount of RAM in GB on the instance (e.g., 1.0).
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    username String
    User name for connecting to the instance (e.g., ec2-user).
    arn string
    ARN of the Lightsail instance (matches id).
    cpuCount number
    Number of vCPUs the instance has.
    createdAt string
    Timestamp when the instance was created.
    id string
    The provider-assigned unique ID for this managed resource.
    ipv6Addresses string[]
    List of IPv6 addresses for the Lightsail instance.
    isStaticIp boolean
    Whether this instance has a static IP assigned to it.
    privateIpAddress string
    Private IP address of the instance.
    publicIpAddress string
    Public IP address of the instance.
    ramSize number
    Amount of RAM in GB on the instance (e.g., 1.0).
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    username string
    User name for connecting to the instance (e.g., ec2-user).
    arn str
    ARN of the Lightsail instance (matches id).
    cpu_count int
    Number of vCPUs the instance has.
    created_at str
    Timestamp when the instance was created.
    id str
    The provider-assigned unique ID for this managed resource.
    ipv6_addresses Sequence[str]
    List of IPv6 addresses for the Lightsail instance.
    is_static_ip bool
    Whether this instance has a static IP assigned to it.
    private_ip_address str
    Private IP address of the instance.
    public_ip_address str
    Public IP address of the instance.
    ram_size float
    Amount of RAM in GB on the instance (e.g., 1.0).
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    username str
    User name for connecting to the instance (e.g., ec2-user).
    arn String
    ARN of the Lightsail instance (matches id).
    cpuCount Number
    Number of vCPUs the instance has.
    createdAt String
    Timestamp when the instance was created.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6Addresses List<String>
    List of IPv6 addresses for the Lightsail instance.
    isStaticIp Boolean
    Whether this instance has a static IP assigned to it.
    privateIpAddress String
    Private IP address of the instance.
    publicIpAddress String
    Public IP address of the instance.
    ramSize Number
    Amount of RAM in GB on the instance (e.g., 1.0).
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    username String
    User name for connecting to the instance (e.g., ec2-user).

    Look up Existing Instance Resource

    Get an existing Instance 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?: InstanceState, opts?: CustomResourceOptions): Instance
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            add_on: Optional[InstanceAddOnArgs] = None,
            arn: Optional[str] = None,
            availability_zone: Optional[str] = None,
            blueprint_id: Optional[str] = None,
            bundle_id: Optional[str] = None,
            cpu_count: Optional[int] = None,
            created_at: Optional[str] = None,
            ip_address_type: Optional[str] = None,
            ipv6_addresses: Optional[Sequence[str]] = None,
            is_static_ip: Optional[bool] = None,
            key_pair_name: Optional[str] = None,
            name: Optional[str] = None,
            private_ip_address: Optional[str] = None,
            public_ip_address: Optional[str] = None,
            ram_size: Optional[float] = None,
            region: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None,
            user_data: Optional[str] = None,
            username: Optional[str] = None) -> Instance
    func GetInstance(ctx *Context, name string, id IDInput, state *InstanceState, opts ...ResourceOption) (*Instance, error)
    public static Instance Get(string name, Input<string> id, InstanceState? state, CustomResourceOptions? opts = null)
    public static Instance get(String name, Output<String> id, InstanceState state, CustomResourceOptions options)
    resources:  _:    type: aws:lightsail:Instance    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:
    AddOn InstanceAddOn
    Add-on configuration for the instance. See below.
    Arn string
    ARN of the Lightsail instance (matches id).
    AvailabilityZone string
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    BlueprintId string
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    BundleId string
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    CpuCount int
    Number of vCPUs the instance has.
    CreatedAt string
    Timestamp when the instance was created.
    IpAddressType string
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    Ipv6Addresses List<string>
    List of IPv6 addresses for the Lightsail instance.
    IsStaticIp bool
    Whether this instance has a static IP assigned to it.
    KeyPairName string
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    Name string

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    PrivateIpAddress string
    Private IP address of the instance.
    PublicIpAddress string
    Public IP address of the instance.
    RamSize double
    Amount of RAM in GB on the instance (e.g., 1.0).
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags Dictionary<string, string>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    UserData string
    Single lined launch script as a string to configure server with additional user data.
    Username string
    User name for connecting to the instance (e.g., ec2-user).
    AddOn InstanceAddOnArgs
    Add-on configuration for the instance. See below.
    Arn string
    ARN of the Lightsail instance (matches id).
    AvailabilityZone string
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    BlueprintId string
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    BundleId string
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    CpuCount int
    Number of vCPUs the instance has.
    CreatedAt string
    Timestamp when the instance was created.
    IpAddressType string
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    Ipv6Addresses []string
    List of IPv6 addresses for the Lightsail instance.
    IsStaticIp bool
    Whether this instance has a static IP assigned to it.
    KeyPairName string
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    Name string

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    PrivateIpAddress string
    Private IP address of the instance.
    PublicIpAddress string
    Public IP address of the instance.
    RamSize float64
    Amount of RAM in GB on the instance (e.g., 1.0).
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags map[string]string
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    UserData string
    Single lined launch script as a string to configure server with additional user data.
    Username string
    User name for connecting to the instance (e.g., ec2-user).
    addOn InstanceAddOn
    Add-on configuration for the instance. See below.
    arn String
    ARN of the Lightsail instance (matches id).
    availabilityZone String
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    blueprintId String
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    bundleId String
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    cpuCount Integer
    Number of vCPUs the instance has.
    createdAt String
    Timestamp when the instance was created.
    ipAddressType String
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    ipv6Addresses List<String>
    List of IPv6 addresses for the Lightsail instance.
    isStaticIp Boolean
    Whether this instance has a static IP assigned to it.
    keyPairName String
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    name String

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    privateIpAddress String
    Private IP address of the instance.
    publicIpAddress String
    Public IP address of the instance.
    ramSize Double
    Amount of RAM in GB on the instance (e.g., 1.0).
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String,String>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    userData String
    Single lined launch script as a string to configure server with additional user data.
    username String
    User name for connecting to the instance (e.g., ec2-user).
    addOn InstanceAddOn
    Add-on configuration for the instance. See below.
    arn string
    ARN of the Lightsail instance (matches id).
    availabilityZone string
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    blueprintId string
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    bundleId string
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    cpuCount number
    Number of vCPUs the instance has.
    createdAt string
    Timestamp when the instance was created.
    ipAddressType string
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    ipv6Addresses string[]
    List of IPv6 addresses for the Lightsail instance.
    isStaticIp boolean
    Whether this instance has a static IP assigned to it.
    keyPairName string
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    name string

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    privateIpAddress string
    Private IP address of the instance.
    publicIpAddress string
    Public IP address of the instance.
    ramSize number
    Amount of RAM in GB on the instance (e.g., 1.0).
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags {[key: string]: string}
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    userData string
    Single lined launch script as a string to configure server with additional user data.
    username string
    User name for connecting to the instance (e.g., ec2-user).
    add_on InstanceAddOnArgs
    Add-on configuration for the instance. See below.
    arn str
    ARN of the Lightsail instance (matches id).
    availability_zone str
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    blueprint_id str
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    bundle_id str
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    cpu_count int
    Number of vCPUs the instance has.
    created_at str
    Timestamp when the instance was created.
    ip_address_type str
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    ipv6_addresses Sequence[str]
    List of IPv6 addresses for the Lightsail instance.
    is_static_ip bool
    Whether this instance has a static IP assigned to it.
    key_pair_name str
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    name str

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    private_ip_address str
    Private IP address of the instance.
    public_ip_address str
    Public IP address of the instance.
    ram_size float
    Amount of RAM in GB on the instance (e.g., 1.0).
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Mapping[str, str]
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    user_data str
    Single lined launch script as a string to configure server with additional user data.
    username str
    User name for connecting to the instance (e.g., ec2-user).
    addOn Property Map
    Add-on configuration for the instance. See below.
    arn String
    ARN of the Lightsail instance (matches id).
    availabilityZone String
    Availability Zone in which to create your instance. A list of available zones can be obtained using the AWS CLI command: aws lightsail get-regions --include-availability-zones.
    blueprintId String
    ID for a virtual private server image. A list of available blueprint IDs can be obtained using the AWS CLI command: aws lightsail get-blueprints.
    bundleId String
    Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    cpuCount Number
    Number of vCPUs the instance has.
    createdAt String
    Timestamp when the instance was created.
    ipAddressType String
    IP address type of the Lightsail Instance. Valid values: dualstack, ipv4, ipv6. Default: dualstack.
    ipv6Addresses List<String>
    List of IPv6 addresses for the Lightsail instance.
    isStaticIp Boolean
    Whether this instance has a static IP assigned to it.
    keyPairName String
    Name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time).
    name String

    Name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.

    The following arguments are optional:

    privateIpAddress String
    Private IP address of the instance.
    publicIpAddress String
    Public IP address of the instance.
    ramSize Number
    Amount of RAM in GB on the instance (e.g., 1.0).
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    userData String
    Single lined launch script as a string to configure server with additional user data.
    username String
    User name for connecting to the instance (e.g., ec2-user).

    Supporting Types

    InstanceAddOn, InstanceAddOnArgs

    SnapshotTime string
    Daily time when an automatic snapshot will be created. Must be in HH:00 format, and in an hourly increment and specified in Coordinated Universal Time (UTC). The snapshot will be automatically created between the time specified and up to 45 minutes after.
    Status string
    Status of the add-on. Valid values: Enabled, Disabled.
    Type string
    Add-on type. There is currently only one valid type AutoSnapshot.
    SnapshotTime string
    Daily time when an automatic snapshot will be created. Must be in HH:00 format, and in an hourly increment and specified in Coordinated Universal Time (UTC). The snapshot will be automatically created between the time specified and up to 45 minutes after.
    Status string
    Status of the add-on. Valid values: Enabled, Disabled.
    Type string
    Add-on type. There is currently only one valid type AutoSnapshot.
    snapshotTime String
    Daily time when an automatic snapshot will be created. Must be in HH:00 format, and in an hourly increment and specified in Coordinated Universal Time (UTC). The snapshot will be automatically created between the time specified and up to 45 minutes after.
    status String
    Status of the add-on. Valid values: Enabled, Disabled.
    type String
    Add-on type. There is currently only one valid type AutoSnapshot.
    snapshotTime string
    Daily time when an automatic snapshot will be created. Must be in HH:00 format, and in an hourly increment and specified in Coordinated Universal Time (UTC). The snapshot will be automatically created between the time specified and up to 45 minutes after.
    status string
    Status of the add-on. Valid values: Enabled, Disabled.
    type string
    Add-on type. There is currently only one valid type AutoSnapshot.
    snapshot_time str
    Daily time when an automatic snapshot will be created. Must be in HH:00 format, and in an hourly increment and specified in Coordinated Universal Time (UTC). The snapshot will be automatically created between the time specified and up to 45 minutes after.
    status str
    Status of the add-on. Valid values: Enabled, Disabled.
    type str
    Add-on type. There is currently only one valid type AutoSnapshot.
    snapshotTime String
    Daily time when an automatic snapshot will be created. Must be in HH:00 format, and in an hourly increment and specified in Coordinated Universal Time (UTC). The snapshot will be automatically created between the time specified and up to 45 minutes after.
    status String
    Status of the add-on. Valid values: Enabled, Disabled.
    type String
    Add-on type. There is currently only one valid type AutoSnapshot.

    Import

    Using pulumi import, import Lightsail Instances using their name. For example:

    $ pulumi import aws:lightsail/instance:Instance example 'example'
    

    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 v7.1.0 published on Monday, Jul 21, 2025 by Pulumi