AWS Lightsail Instance
This page shows how to write Terraform and CloudFormation for Lightsail Instance and write them securely.
aws_lightsail_instance (Terraform)
The Instance in Lightsail can be configured in Terraform with the resource name aws_lightsail_instance
. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_lightsail_instance" "blog_beramaljariyah" {
name = "blog.beramaljariyah.org"
availability_zone = "ap-southeast-1a"
blueprint_id = "ubuntu_18_04"
bundle_id = "micro_2_0"
key_pair_name = "evermos"
resource "aws_lightsail_instance" "linux1" {
name = "linux1"
availability_zone = "us-east-1a"
blueprint_id = "centos_7_1901_01"
bundle_id = "xlarge_2_0"
}
resource "aws_lightsail_instance" "linux1" {
name = "linux1"
availability_zone = "us-east-1a"
blueprint_id = "centos_7_1901_01"
bundle_id = "xlarge_2_0"
}
resource "aws_lightsail_instance" "Autozona-Master" {
name = "Autozona-Master"
availability_zone = "us-east-1a"
blueprint_id = "ubuntu_18_04"
bundle_id = "micro_2_0"
key_pair_name = "Autozona"
Parameters
-
arn
optional computed - string -
availability_zone
required - string -
blueprint_id
required - string -
bundle_id
required - string -
cpu_count
optional computed - number -
created_at
optional computed - string -
id
optional computed - string -
ipv6_address
optional computed - string -
ipv6_addresses
optional computed - list of string -
is_static_ip
optional computed - bool -
key_pair_name
optional - string -
name
required - string -
private_ip_address
optional computed - string -
public_ip_address
optional computed - string -
ram_size
optional computed - number -
tags
optional - map from string to string -
user_data
optional - string -
username
optional computed - string
Explanation in Terraform Registry
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
AWS::Lightsail::Instance (CloudFormation)
The Instance in Lightsail can be configured in CloudFormation with the resource name AWS::Lightsail::Instance
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::Lightsail::Instance
Properties:
BlueprintId: !Ref BluePrintId
BundleId: !Ref BundleId
InstanceName: !Ref InstanceName
Networking:
Type: AWS::Lightsail::Instance
CreationPolicy:
ResourceSignal:
Timeout: PT15M
Properties:
BlueprintId: ubuntu_20_04
Parameters
-
Location
optional - Location -
Hardware
optional - Hardware -
State
optional - State -
Networking
optional - Networking -
InstanceName
required - String -
AvailabilityZone
optional - String -
BundleId
required - String -
BlueprintId
required - String -
AddOns
optional - List of AddOn -
UserData
optional - String -
KeyPairName
optional - String -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
The
AWS::Lightsail::Instance
resource specifies an Amazon Lightsail instance.
Frequently asked questions
What is AWS Lightsail Instance?
AWS Lightsail Instance is a resource for Lightsail of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Lightsail Instance?
For Terraform, the bentinata/tf, gilyas/infracost and infracost/infracost source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the allendcanning/cloudformation and AlexMikhalochkin/jarvis source code examples are useful. See the CloudFormation Example section for further details.