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
-
arnoptional computed - string -
availability_zonerequired - string -
blueprint_idrequired - string -
bundle_idrequired - string -
cpu_countoptional computed - number -
created_atoptional computed - string -
idoptional computed - string -
ipv6_addressoptional computed - string -
ipv6_addressesoptional computed - list of string -
is_static_ipoptional computed - bool -
key_pair_nameoptional - string -
namerequired - string -
private_ip_addressoptional computed - string -
public_ip_addressoptional computed - string -
ram_sizeoptional computed - number -
tagsoptional - map from string to string -
user_dataoptional - string -
usernameoptional 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
-
Locationoptional - Location -
Hardwareoptional - Hardware -
Stateoptional - State -
Networkingoptional - Networking -
InstanceNamerequired - String -
AvailabilityZoneoptional - String -
BundleIdrequired - String -
BlueprintIdrequired - String -
AddOnsoptional - List of AddOn -
UserDataoptional - String -
KeyPairNameoptional - String -
Tagsoptional - List of Tag
Explanation in CloudFormation Registry
The
AWS::Lightsail::Instanceresource 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.