aws.lightsail.Instance
Explore with Pulumi AI
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={
"snapshotTime": "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
The Instance resource accepts the following input properties:
- Availability
Zone 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
. - Blueprint
Id 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
. - Bundle
Id string - 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 Pulumi.Aws. Light Sail. Inputs. Instance Add On - The add on configuration for the instance. Detailed below.
- Ip
Address stringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - Key
Pair stringName - 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.
- 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. - User
Data string - Single lined launch script as a string to configure server with additional user data
- Availability
Zone 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
. - Blueprint
Id 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
. - Bundle
Id string - 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 InstanceAdd On Args - The add on configuration for the instance. Detailed below.
- Ip
Address stringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - Key
Pair stringName - 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.
- 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. - User
Data string - Single lined launch script as a string to configure server with additional user data
- availability
Zone 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
. - blueprint
Id 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
. - bundle
Id String - 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 InstanceAdd On - The add on configuration for the instance. Detailed below.
- ip
Address StringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - key
Pair StringName - 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.
- 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. - user
Data String - Single lined launch script as a string to configure server with additional user data
- availability
Zone 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
. - blueprint
Id 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
. - bundle
Id string - 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 InstanceAdd On - The add on configuration for the instance. Detailed below.
- ip
Address stringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - key
Pair stringName - 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.
- {[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. - user
Data 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 InstanceAdd On Args - The add on configuration for the instance. Detailed below.
- ip_
address_ strtype - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - key_
pair_ strname - 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.
- 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
- availability
Zone 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
. - blueprint
Id 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
. - bundle
Id String - 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 Property Map - The add on configuration for the instance. Detailed below.
- ip
Address StringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - key
Pair StringName - 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.
- 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. - 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
- The ARN of the Lightsail instance (matches
id
). - Cpu
Count int - The number of vCPUs the instance has.
- Created
At 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.
- Is
Static boolIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- Private
Ip stringAddress - The private IP address of the instance.
- Public
Ip stringAddress - The public IP address of the instance.
- Ram
Size double - The amount of RAM in GB on the instance (e.g., 1.0).
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Username string
- The user name for connecting to the instance (e.g., ec2-user).
- Arn string
- The ARN of the Lightsail instance (matches
id
). - Cpu
Count int - The number of vCPUs the instance has.
- Created
At 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.
- Is
Static boolIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- Private
Ip stringAddress - The private IP address of the instance.
- Public
Ip stringAddress - The public IP address of the instance.
- Ram
Size float64 - The amount of RAM in GB on the instance (e.g., 1.0).
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Username string
- The user name for connecting to the instance (e.g., ec2-user).
- arn String
- The ARN of the Lightsail instance (matches
id
). - cpu
Count Integer - The number of vCPUs the instance has.
- created
At 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.
- is
Static BooleanIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- private
Ip StringAddress - The private IP address of the instance.
- public
Ip StringAddress - The public IP address of the instance.
- ram
Size Double - The amount of RAM in GB on the instance (e.g., 1.0).
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - username String
- The user name for connecting to the instance (e.g., ec2-user).
- arn string
- The ARN of the Lightsail instance (matches
id
). - cpu
Count number - The number of vCPUs the instance has.
- created
At 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.
- is
Static booleanIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- private
Ip stringAddress - The private IP address of the instance.
- public
Ip stringAddress - The public IP address of the instance.
- ram
Size number - The amount of RAM in GB on the instance (e.g., 1.0).
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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_ boolip - A Boolean value indicating whether this instance has a static IP assigned to it.
- private_
ip_ straddress - The private IP address of the instance.
- public_
ip_ straddress - The public IP address of the instance.
- ram_
size float - The amount of RAM in GB on the instance (e.g., 1.0).
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - username str
- The user name for connecting to the instance (e.g., ec2-user).
- arn String
- The ARN of the Lightsail instance (matches
id
). - cpu
Count Number - The number of vCPUs the instance has.
- created
At 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.
- is
Static BooleanIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- private
Ip StringAddress - The private IP address of the instance.
- public
Ip StringAddress - The public IP address of the instance.
- ram
Size Number - The amount of RAM in GB on the instance (e.g., 1.0).
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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.
- Add
On Pulumi.Aws. Light Sail. Inputs. Instance Add On - The add on configuration for the instance. Detailed below.
- Arn string
- The ARN of the Lightsail instance (matches
id
). - Availability
Zone 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
. - Blueprint
Id 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
. - Bundle
Id string - 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 string - The timestamp when the instance was created.
- Ip
Address stringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - Ipv6Addresses List<string>
- List of IPv6 addresses for the Lightsail instance.
- Is
Static boolIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- Key
Pair stringName - 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.
- Private
Ip stringAddress - The private IP address of the instance.
- Public
Ip stringAddress - The public IP address of the instance.
- Ram
Size double - The amount of RAM in GB on the instance (e.g., 1.0).
- 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. - Dictionary<string, string>
- A 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
- The user name for connecting to the instance (e.g., ec2-user).
- Add
On InstanceAdd On Args - The add on configuration for the instance. Detailed below.
- Arn string
- The ARN of the Lightsail instance (matches
id
). - Availability
Zone 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
. - Blueprint
Id 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
. - Bundle
Id string - 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 string - The timestamp when the instance was created.
- Ip
Address stringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - Ipv6Addresses []string
- List of IPv6 addresses for the Lightsail instance.
- Is
Static boolIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- Key
Pair stringName - 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.
- Private
Ip stringAddress - The private IP address of the instance.
- Public
Ip stringAddress - The public IP address of the instance.
- Ram
Size float64 - The amount of RAM in GB on the instance (e.g., 1.0).
- 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. - map[string]string
- A 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
- The user name for connecting to the instance (e.g., ec2-user).
- add
On InstanceAdd On - The add on configuration for the instance. Detailed below.
- arn String
- The ARN of the Lightsail instance (matches
id
). - availability
Zone 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
. - blueprint
Id 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
. - bundle
Id String - 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 Integer - The number of vCPUs the instance has.
- created
At String - The timestamp when the instance was created.
- ip
Address StringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - ipv6Addresses List<String>
- List of IPv6 addresses for the Lightsail instance.
- is
Static BooleanIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- key
Pair StringName - 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.
- private
Ip StringAddress - The private IP address of the instance.
- public
Ip StringAddress - The public IP address of the instance.
- ram
Size Double - The amount of RAM in GB on the instance (e.g., 1.0).
- 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. - Map<String,String>
- A 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
- The user name for connecting to the instance (e.g., ec2-user).
- add
On InstanceAdd On - The add on configuration for the instance. Detailed below.
- arn string
- The ARN of the Lightsail instance (matches
id
). - availability
Zone 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
. - blueprint
Id 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
. - bundle
Id string - 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 number - The number of vCPUs the instance has.
- created
At string - The timestamp when the instance was created.
- ip
Address stringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - ipv6Addresses string[]
- List of IPv6 addresses for the Lightsail instance.
- is
Static booleanIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- key
Pair stringName - 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.
- private
Ip stringAddress - The private IP address of the instance.
- public
Ip stringAddress - The public IP address of the instance.
- ram
Size number - The amount of RAM in GB on the instance (e.g., 1.0).
- {[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. - {[key: string]: string}
- A 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
- The user name for connecting to the instance (e.g., ec2-user).
- add_
on InstanceAdd On Args - 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_ strtype - 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_ boolip - A Boolean value indicating whether this instance has a static IP assigned to it.
- key_
pair_ strname - 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_ straddress - The private IP address of the instance.
- public_
ip_ straddress - The public IP address of the instance.
- ram_
size float - The amount of RAM in GB on the instance (e.g., 1.0).
- 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. - Mapping[str, str]
- A 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
- The user name for connecting to the instance (e.g., ec2-user).
- add
On Property Map - The add on configuration for the instance. Detailed below.
- arn String
- The ARN of the Lightsail instance (matches
id
). - availability
Zone 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
. - blueprint
Id 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
. - bundle
Id String - 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 Number - The number of vCPUs the instance has.
- created
At String - The timestamp when the instance was created.
- ip
Address StringType - The IP address type of the Lightsail Instance. Valid Values:
dualstack
|ipv4
. - ipv6Addresses List<String>
- List of IPv6 addresses for the Lightsail instance.
- is
Static BooleanIp - A Boolean value indicating whether this instance has a static IP assigned to it.
- key
Pair StringName - 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.
- private
Ip StringAddress - The private IP address of the instance.
- public
Ip StringAddress - The public IP address of the instance.
- ram
Size Number - The amount of RAM in GB on the instance (e.g., 1.0).
- 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. - Map<String>
- A 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
- The user name for connecting to the instance (e.g., ec2-user).
Supporting Types
InstanceAddOn, InstanceAddOnArgs
- Snapshot
Time 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 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 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 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
.
- snapshot
Time 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.