AWS Lightsail Domain
This page shows how to write Terraform and CloudFormation for Lightsail Domain and write them securely.
aws_lightsail_domain (Terraform)
The Domain in Lightsail can be configured in Terraform with the resource name aws_lightsail_domain
. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_lightsail_domain" "template_domain" {
domain_name = "template.example.com"
}
resource "aws_lightsail_domain" "groganburners_ie" {
domain_name = "groganburners.ie"
}
# Set up domain name
resource "aws_lightsail_domain" "groganburners_com" {
resource "aws_lightsail_domain" "default" {
domain_name = "dev-properteers-wordpress-instance.com"
}
resource "aws_lightsail_domain" "this" {
domain_name = var.domain_name
}
Parameters
-
arn
optional computed - string -
domain_name
required - string -
id
optional computed - string
Explanation in Terraform Registry
Creates a domain resource for the specified domain (e.g., example.com). You cannot register a new domain name using Lightsail. You must register a domain name using Amazon Route 53 or another domain name registrar. If you have already registered your domain, you can enter its name in this parameter to manage the DNS records for that domain.
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 Domain?
AWS Lightsail Domain 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 Domain?
For Terraform, the smashse/iac-public, GroganBurners/tine and devops-adeel/wordpress 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.