1. Packages
  2. AWS
  3. API Docs
  4. lightsail
  5. Instance
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.lightsail.Instance

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides a Lightsail Instance. Amazon Lightsail is a service to provide easy virtual private servers with custom software already setup. See What is Amazon Lightsail? for more information.

    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";
    
    // Create a new GitLab Lightsail Instance
    const gitlabTest = new aws.lightsail.Instance("gitlab_test", {
        name: "custom_gitlab",
        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
    
    # Create a new GitLab Lightsail Instance
    gitlab_test = aws.lightsail.Instance("gitlab_test",
        name="custom_gitlab",
        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/v6/go/aws/lightsail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new GitLab Lightsail Instance
    		_, err := lightsail.NewInstance(ctx, "gitlab_test", &lightsail.InstanceArgs{
    			Name:             pulumi.String("custom_gitlab"),
    			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(() => 
    {
        // Create a new GitLab Lightsail Instance
        var gitlabTest = new Aws.LightSail.Instance("gitlab_test", new()
        {
            Name = "custom_gitlab",
            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) {
            // Create a new GitLab Lightsail Instance
            var gitlabTest = new Instance("gitlabTest", InstanceArgs.builder()
                .name("custom_gitlab")
                .availabilityZone("us-east-1b")
                .blueprintId("amazon_linux_2")
                .bundleId("nano_3_0")
                .keyPairName("some_key_name")
                .tags(Map.of("foo", "bar"))
                .build());
    
        }
    }
    
    resources:
      # Create a new GitLab Lightsail Instance
      gitlabTest:
        type: aws:lightsail:Instance
        name: gitlab_test
        properties:
          name: custom_gitlab
          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 custom = new aws.lightsail.Instance("custom", {
        name: "custom",
        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
    
    custom = aws.lightsail.Instance("custom",
        name="custom",
        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/v6/go/aws/lightsail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := lightsail.NewInstance(ctx, "custom", &lightsail.InstanceArgs{
    			Name:             pulumi.String("custom"),
    			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 custom = new Aws.LightSail.Instance("custom", new()
        {
            Name = "custom",
            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 custom = new Instance("custom", InstanceArgs.builder()
                .name("custom")
                .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:
      custom:
        type: aws:lightsail:Instance
        properties:
          name: custom
          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 test = new aws.lightsail.Instance("test", {
        name: "custom_instance",
        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
    
    test = aws.lightsail.Instance("test",
        name="custom_instance",
        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/v6/go/aws/lightsail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := lightsail.NewInstance(ctx, "test", &lightsail.InstanceArgs{
    			Name:             pulumi.String("custom_instance"),
    			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 test = new Aws.LightSail.Instance("test", new()
        {
            Name = "custom_instance",
            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 test = new Instance("test", InstanceArgs.builder()
                .name("custom_instance")
                .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:
      test:
        type: aws:lightsail:Instance
        properties:
          name: custom_instance
          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,
                 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",
        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"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	UserData: pulumi.String("string"),
    })
    
    var exampleinstanceResourceResourceFromLightsailinstance = new Instance("exampleinstanceResourceResourceFromLightsailinstance", InstanceArgs.builder()
        .availabilityZone("string")
        .blueprintId("string")
        .bundleId("string")
        .addOn(InstanceAddOnArgs.builder()
            .snapshotTime("string")
            .status("string")
            .type("string")
            .build())
        .ipAddressType("string")
        .keyPairName("string")
        .name("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",
        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",
        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
        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
    The 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
    The 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
    The bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    AddOn InstanceAddOn
    The add on configuration for the instance. Detailed below.
    IpAddressType string
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    KeyPairName string
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    Name string
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    Tags Dictionary<string, string>
    A 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
    The 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
    The 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
    The bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    AddOn InstanceAddOnArgs
    The add on configuration for the instance. Detailed below.
    IpAddressType string
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    KeyPairName string
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    Name string
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    Tags map[string]string
    A 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
    The 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
    The 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
    The bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    addOn InstanceAddOn
    The add on configuration for the instance. Detailed below.
    ipAddressType String
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    keyPairName String
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    name String
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    tags Map<String,String>
    A 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
    The 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
    The 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
    The bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    addOn InstanceAddOn
    The add on configuration for the instance. Detailed below.
    ipAddressType string
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    keyPairName string
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    name string
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    tags {[key: string]: string}
    A 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
    The 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
    The 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
    The 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
    The add on configuration for the instance. Detailed below.
    ip_address_type str
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    key_pair_name str
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    name str
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    tags Mapping[str, str]
    A 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
    The 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
    The 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
    The 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
    The add on configuration for the instance. Detailed below.
    ipAddressType String
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    keyPairName String
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    name String
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    tags Map<String>
    A 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
    The ARN of the Lightsail instance (matches id).
    CpuCount int
    The number of vCPUs the instance has.
    CreatedAt string
    The 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
    A Boolean value indicating whether this instance has a static IP assigned to it.
    PrivateIpAddress string
    The private IP address of the instance.
    PublicIpAddress string
    The public IP address of the instance.
    RamSize double
    The amount of RAM in GB on the instance (e.g., 1.0).
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Username string
    The user name for connecting to the instance (e.g., ec2-user).
    Arn string
    The ARN of the Lightsail instance (matches id).
    CpuCount int
    The number of vCPUs the instance has.
    CreatedAt string
    The 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
    A Boolean value indicating whether this instance has a static IP assigned to it.
    PrivateIpAddress string
    The private IP address of the instance.
    PublicIpAddress string
    The public IP address of the instance.
    RamSize float64
    The amount of RAM in GB on the instance (e.g., 1.0).
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Username string
    The user name for connecting to the instance (e.g., ec2-user).
    arn String
    The ARN of the Lightsail instance (matches id).
    cpuCount Integer
    The number of vCPUs the instance has.
    createdAt String
    The 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
    A Boolean value indicating whether this instance has a static IP assigned to it.
    privateIpAddress String
    The private IP address of the instance.
    publicIpAddress String
    The public IP address of the instance.
    ramSize Double
    The amount of RAM in GB on the instance (e.g., 1.0).
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    username String
    The user name for connecting to the instance (e.g., ec2-user).
    arn string
    The ARN of the Lightsail instance (matches id).
    cpuCount number
    The number of vCPUs the instance has.
    createdAt string
    The 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
    A Boolean value indicating whether this instance has a static IP assigned to it.
    privateIpAddress string
    The private IP address of the instance.
    publicIpAddress string
    The public IP address of the instance.
    ramSize number
    The amount of RAM in GB on the instance (e.g., 1.0).
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    username string
    The user name for connecting to the instance (e.g., ec2-user).
    arn str
    The ARN of the Lightsail instance (matches id).
    cpu_count int
    The number of vCPUs the instance has.
    created_at str
    The 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
    A Boolean value indicating whether this instance has a static IP assigned to it.
    private_ip_address str
    The private IP address of the instance.
    public_ip_address str
    The public IP address of the instance.
    ram_size float
    The amount of RAM in GB on the instance (e.g., 1.0).
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    username str
    The user name for connecting to the instance (e.g., ec2-user).
    arn String
    The ARN of the Lightsail instance (matches id).
    cpuCount Number
    The number of vCPUs the instance has.
    createdAt String
    The 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
    A Boolean value indicating whether this instance has a static IP assigned to it.
    privateIpAddress String
    The private IP address of the instance.
    publicIpAddress String
    The public IP address of the instance.
    ramSize Number
    The amount of RAM in GB on the instance (e.g., 1.0).
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    username String
    The 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,
            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)
    Resource lookup is not supported in YAML
    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
    The add on configuration for the instance. Detailed below.
    Arn string
    The ARN of the Lightsail instance (matches id).
    AvailabilityZone string
    The 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
    The 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
    The bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    CpuCount int
    The number of vCPUs the instance has.
    CreatedAt string
    The timestamp when the instance was created.
    IpAddressType string
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    Ipv6Addresses List<string>
    List of IPv6 addresses for the Lightsail instance.
    IsStaticIp bool
    A Boolean value indicating whether this instance has a static IP assigned to it.
    KeyPairName string
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    Name string
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    PrivateIpAddress string
    The private IP address of the instance.
    PublicIpAddress string
    The public IP address of the instance.
    RamSize double
    The amount of RAM in GB on the instance (e.g., 1.0).
    Tags Dictionary<string, string>
    A 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>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    UserData string
    Single lined launch script as a string to configure server with additional user data
    Username string
    The user name for connecting to the instance (e.g., ec2-user).
    AddOn InstanceAddOnArgs
    The add on configuration for the instance. Detailed below.
    Arn string
    The ARN of the Lightsail instance (matches id).
    AvailabilityZone string
    The 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
    The 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
    The bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    CpuCount int
    The number of vCPUs the instance has.
    CreatedAt string
    The timestamp when the instance was created.
    IpAddressType string
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    Ipv6Addresses []string
    List of IPv6 addresses for the Lightsail instance.
    IsStaticIp bool
    A Boolean value indicating whether this instance has a static IP assigned to it.
    KeyPairName string
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    Name string
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    PrivateIpAddress string
    The private IP address of the instance.
    PublicIpAddress string
    The public IP address of the instance.
    RamSize float64
    The amount of RAM in GB on the instance (e.g., 1.0).
    Tags map[string]string
    A 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
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    UserData string
    Single lined launch script as a string to configure server with additional user data
    Username string
    The user name for connecting to the instance (e.g., ec2-user).
    addOn InstanceAddOn
    The add on configuration for the instance. Detailed below.
    arn String
    The ARN of the Lightsail instance (matches id).
    availabilityZone String
    The 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
    The 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
    The bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    cpuCount Integer
    The number of vCPUs the instance has.
    createdAt String
    The timestamp when the instance was created.
    ipAddressType String
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    ipv6Addresses List<String>
    List of IPv6 addresses for the Lightsail instance.
    isStaticIp Boolean
    A Boolean value indicating whether this instance has a static IP assigned to it.
    keyPairName String
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    name String
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    privateIpAddress String
    The private IP address of the instance.
    publicIpAddress String
    The public IP address of the instance.
    ramSize Double
    The amount of RAM in GB on the instance (e.g., 1.0).
    tags Map<String,String>
    A 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>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    userData String
    Single lined launch script as a string to configure server with additional user data
    username String
    The user name for connecting to the instance (e.g., ec2-user).
    addOn InstanceAddOn
    The add on configuration for the instance. Detailed below.
    arn string
    The ARN of the Lightsail instance (matches id).
    availabilityZone string
    The 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
    The 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
    The bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    cpuCount number
    The number of vCPUs the instance has.
    createdAt string
    The timestamp when the instance was created.
    ipAddressType string
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    ipv6Addresses string[]
    List of IPv6 addresses for the Lightsail instance.
    isStaticIp boolean
    A Boolean value indicating whether this instance has a static IP assigned to it.
    keyPairName string
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    name string
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    privateIpAddress string
    The private IP address of the instance.
    publicIpAddress string
    The public IP address of the instance.
    ramSize number
    The amount of RAM in GB on the instance (e.g., 1.0).
    tags {[key: string]: string}
    A 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}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    userData string
    Single lined launch script as a string to configure server with additional user data
    username string
    The user name for connecting to the instance (e.g., ec2-user).
    add_on InstanceAddOnArgs
    The add on configuration for the instance. Detailed below.
    arn str
    The ARN of the Lightsail instance (matches id).
    availability_zone str
    The 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
    The 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
    The 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
    The number of vCPUs the instance has.
    created_at str
    The timestamp when the instance was created.
    ip_address_type str
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    ipv6_addresses Sequence[str]
    List of IPv6 addresses for the Lightsail instance.
    is_static_ip bool
    A Boolean value indicating whether this instance has a static IP assigned to it.
    key_pair_name str
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    name str
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    private_ip_address str
    The private IP address of the instance.
    public_ip_address str
    The public IP address of the instance.
    ram_size float
    The amount of RAM in GB on the instance (e.g., 1.0).
    tags Mapping[str, str]
    A 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]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    user_data str
    Single lined launch script as a string to configure server with additional user data
    username str
    The user name for connecting to the instance (e.g., ec2-user).
    addOn Property Map
    The add on configuration for the instance. Detailed below.
    arn String
    The ARN of the Lightsail instance (matches id).
    availabilityZone String
    The 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
    The 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
    The bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command: aws lightsail get-bundles.
    cpuCount Number
    The number of vCPUs the instance has.
    createdAt String
    The timestamp when the instance was created.
    ipAddressType String
    The IP address type of the Lightsail Instance. Valid Values: dualstack | ipv4.
    ipv6Addresses List<String>
    List of IPv6 addresses for the Lightsail instance.
    isStaticIp Boolean
    A Boolean value indicating whether this instance has a static IP assigned to it.
    keyPairName String
    The name of your key pair. Created in the Lightsail console (cannot use aws.ec2.KeyPair at this time)
    name String
    The name of the Lightsail Instance. Names must be unique within each AWS Region in your Lightsail account.
    privateIpAddress String
    The private IP address of the instance.
    publicIpAddress String
    The public IP address of the instance.
    ramSize Number
    The amount of RAM in GB on the instance (e.g., 1.0).
    tags Map<String>
    A 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>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    userData String
    Single lined launch script as a string to configure server with additional user data
    username String
    The user name for connecting to the instance (e.g., ec2-user).

    Supporting Types

    InstanceAddOn, InstanceAddOnArgs

    SnapshotTime string
    The 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
    The status of the add on. Valid Values: Enabled, Disabled.
    Type string
    The add-on type. There is currently only one valid type AutoSnapshot.
    SnapshotTime string
    The 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
    The status of the add on. Valid Values: Enabled, Disabled.
    Type string
    The add-on type. There is currently only one valid type AutoSnapshot.
    snapshotTime String
    The 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
    The status of the add on. Valid Values: Enabled, Disabled.
    type String
    The add-on type. There is currently only one valid type AutoSnapshot.
    snapshotTime string
    The 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
    The status of the add on. Valid Values: Enabled, Disabled.
    type string
    The add-on type. There is currently only one valid type AutoSnapshot.
    snapshot_time str
    The 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
    The status of the add on. Valid Values: Enabled, Disabled.
    type str
    The add-on type. There is currently only one valid type AutoSnapshot.
    snapshotTime String
    The 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
    The status of the add on. Valid Values: Enabled, Disabled.
    type String
    The 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 gitlab_test 'custom_gitlab'
    

    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.60.0 published on Tuesday, Nov 19, 2024 by Pulumi