aws.lightsail.Instance
Explore with Pulumi AI
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:
- Availability
Zone 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
. - Blueprint
Id 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
. - Bundle
Id string - Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command:
aws lightsail get-bundles
. - Add
On InstanceAdd On - Add-on configuration for the instance. See below.
- Ip
Address stringType - IP address type of the Lightsail Instance. Valid values:
dualstack
,ipv4
,ipv6
. Default:dualstack
. - Key
Pair stringName - 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.
- 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. - User
Data string - Single lined launch script as a string to configure server with additional user data.
- Availability
Zone 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
. - Blueprint
Id 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
. - Bundle
Id string - Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command:
aws lightsail get-bundles
. - Add
On InstanceAdd On Args - Add-on configuration for the instance. See below.
- Ip
Address stringType - IP address type of the Lightsail Instance. Valid values:
dualstack
,ipv4
,ipv6
. Default:dualstack
. - Key
Pair stringName - 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.
- 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. - User
Data string - Single lined launch script as a string to configure server with additional user data.
- availability
Zone 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
. - blueprint
Id 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
. - bundle
Id String - Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command:
aws lightsail get-bundles
. - add
On InstanceAdd On - Add-on configuration for the instance. See below.
- ip
Address StringType - IP address type of the Lightsail Instance. Valid values:
dualstack
,ipv4
,ipv6
. Default:dualstack
. - key
Pair StringName - 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.
- 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. - user
Data String - Single lined launch script as a string to configure server with additional user data.
- availability
Zone 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
. - blueprint
Id 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
. - bundle
Id string - Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command:
aws lightsail get-bundles
. - add
On InstanceAdd On - Add-on configuration for the instance. See below.
- ip
Address stringType - IP address type of the Lightsail Instance. Valid values:
dualstack
,ipv4
,ipv6
. Default:dualstack
. - key
Pair stringName - 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.
- {[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. - user
Data 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 InstanceAdd On Args - Add-on configuration for the instance. See below.
- ip_
address_ strtype - IP address type of the Lightsail Instance. Valid values:
dualstack
,ipv4
,ipv6
. Default:dualstack
. - key_
pair_ strname - 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.
- 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.
- availability
Zone 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
. - blueprint
Id 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
. - bundle
Id String - Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command:
aws lightsail get-bundles
. - add
On Property Map - Add-on configuration for the instance. See below.
- ip
Address StringType - IP address type of the Lightsail Instance. Valid values:
dualstack
,ipv4
,ipv6
. Default:dualstack
. - key
Pair StringName - 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.
- 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. - user
Data 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
). - Cpu
Count int - Number of vCPUs the instance has.
- Created
At 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.
- Is
Static boolIp - Whether this instance has a static IP assigned to it.
- Private
Ip stringAddress - Private IP address of the instance.
- Public
Ip stringAddress - Public IP address of the instance.
- Ram
Size double - Amount of RAM in GB on the instance (e.g., 1.0).
- 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
). - Cpu
Count int - Number of vCPUs the instance has.
- Created
At 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.
- Is
Static boolIp - Whether this instance has a static IP assigned to it.
- Private
Ip stringAddress - Private IP address of the instance.
- Public
Ip stringAddress - Public IP address of the instance.
- Ram
Size float64 - Amount of RAM in GB on the instance (e.g., 1.0).
- 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
). - cpu
Count Integer - Number of vCPUs the instance has.
- created
At 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.
- is
Static BooleanIp - Whether this instance has a static IP assigned to it.
- private
Ip StringAddress - Private IP address of the instance.
- public
Ip StringAddress - Public IP address of the instance.
- ram
Size Double - Amount of RAM in GB on the instance (e.g., 1.0).
- 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
). - cpu
Count number - Number of vCPUs the instance has.
- created
At 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.
- is
Static booleanIp - Whether this instance has a static IP assigned to it.
- private
Ip stringAddress - Private IP address of the instance.
- public
Ip stringAddress - Public IP address of the instance.
- ram
Size number - Amount of RAM in GB on the instance (e.g., 1.0).
- {[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_ boolip - Whether this instance has a static IP assigned to it.
- private_
ip_ straddress - Private IP address of the instance.
- public_
ip_ straddress - Public IP address of the instance.
- ram_
size float - Amount of RAM in GB on the instance (e.g., 1.0).
- 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
). - cpu
Count Number - Number of vCPUs the instance has.
- created
At 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.
- is
Static BooleanIp - Whether this instance has a static IP assigned to it.
- private
Ip StringAddress - Private IP address of the instance.
- public
Ip StringAddress - Public IP address of the instance.
- ram
Size Number - Amount of RAM in GB on the instance (e.g., 1.0).
- 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.
- Add
On InstanceAdd On - Add-on configuration for the instance. See below.
- Arn string
- ARN of the Lightsail instance (matches
id
). - Availability
Zone 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
. - Blueprint
Id 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
. - Bundle
Id string - 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 string - Timestamp when the instance was created.
- Ip
Address stringType - 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.
- Is
Static boolIp - Whether this instance has a static IP assigned to it.
- Key
Pair stringName - 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:
- Private
Ip stringAddress - Private IP address of the instance.
- Public
Ip stringAddress - Public IP address of the instance.
- Ram
Size 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.
- 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. - Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - User
Data 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 InstanceAdd On Args - Add-on configuration for the instance. See below.
- Arn string
- ARN of the Lightsail instance (matches
id
). - Availability
Zone 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
. - Blueprint
Id 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
. - Bundle
Id string - 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 string - Timestamp when the instance was created.
- Ip
Address stringType - IP address type of the Lightsail Instance. Valid values:
dualstack
,ipv4
,ipv6
. Default:dualstack
. - Ipv6Addresses []string
- List of IPv6 addresses for the Lightsail instance.
- Is
Static boolIp - Whether this instance has a static IP assigned to it.
- Key
Pair stringName - 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:
- Private
Ip stringAddress - Private IP address of the instance.
- Public
Ip stringAddress - Public IP address of the instance.
- Ram
Size 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.
- 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. - map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - User
Data 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 InstanceAdd On - Add-on configuration for the instance. See below.
- arn String
- ARN of the Lightsail instance (matches
id
). - availability
Zone 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
. - blueprint
Id 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
. - bundle
Id String - Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command:
aws lightsail get-bundles
. - cpu
Count Integer - Number of vCPUs the instance has.
- created
At String - Timestamp when the instance was created.
- ip
Address StringType - 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.
- is
Static BooleanIp - Whether this instance has a static IP assigned to it.
- key
Pair StringName - 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:
- private
Ip StringAddress - Private IP address of the instance.
- public
Ip StringAddress - Public IP address of the instance.
- ram
Size 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.
- 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. - Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user
Data 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 InstanceAdd On - Add-on configuration for the instance. See below.
- arn string
- ARN of the Lightsail instance (matches
id
). - availability
Zone 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
. - blueprint
Id 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
. - bundle
Id string - Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command:
aws lightsail get-bundles
. - cpu
Count number - Number of vCPUs the instance has.
- created
At string - Timestamp when the instance was created.
- ip
Address stringType - IP address type of the Lightsail Instance. Valid values:
dualstack
,ipv4
,ipv6
. Default:dualstack
. - ipv6Addresses string[]
- List of IPv6 addresses for the Lightsail instance.
- is
Static booleanIp - Whether this instance has a static IP assigned to it.
- key
Pair stringName - 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:
- private
Ip stringAddress - Private IP address of the instance.
- public
Ip stringAddress - Public IP address of the instance.
- ram
Size 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.
- {[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. - {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user
Data 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 InstanceAdd On Args - 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_ strtype - 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_ boolip - Whether this instance has a static IP assigned to it.
- key_
pair_ strname - 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_ straddress - Private IP address of the instance.
- public_
ip_ straddress - 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.
- 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. - 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).
- add
On Property Map - Add-on configuration for the instance. See below.
- arn String
- ARN of the Lightsail instance (matches
id
). - availability
Zone 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
. - blueprint
Id 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
. - bundle
Id String - Bundle of specification information. A list of available bundle IDs can be obtained using the AWS CLI command:
aws lightsail get-bundles
. - cpu
Count Number - Number of vCPUs the instance has.
- created
At String - Timestamp when the instance was created.
- ip
Address StringType - 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.
- is
Static BooleanIp - Whether this instance has a static IP assigned to it.
- key
Pair StringName - 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:
- private
Ip StringAddress - Private IP address of the instance.
- public
Ip StringAddress - Public IP address of the instance.
- ram
Size 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.
- 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. - Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - user
Data 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
- Snapshot
Time 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 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 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 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
.
- snapshot
Time 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.