Skip to main content

domains

Creates, updates, deletes, gets or lists a domains resource.

Overview

Namedomains
TypeResource
Idaws.lightsail.domains

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the domain. (pattern: <code>\w[\w-]*\w</code>)
arnstringThe Amazon Resource Name (ARN) of the domain recordset (arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE). (pattern: <code>.\S.</code>)
created_atstring (date-time)The date when the domain recordset was created.
domain_entriesarrayAn array of key-value pairs containing information about the domain entries.
locationobjectThe AWS Region and Availability Zones where the domain recordset was created.
registered_domain_delegation_infoobjectAn object that describes the state of the Route 53 domain delegation to a Lightsail DNS zone.
resource_typestringThe resource type. (ContainerService, Instance, StaticIp, KeyPair, InstanceSnapshot, Domain, PeeredVpc, LoadBalancer, LoadBalancerTlsCertificate, Disk, DiskSnapshot, RelationalDatabase, RelationalDatabaseSnapshot, ExportSnapshotRecord, CloudFormationStackRecord, Alarm, ContactMethod, Distribution, Certificate, Bucket)
support_codestringThe support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
tagsarrayThe tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_domainselectregionReturns information about a specific domain recordset.
get_domainsselectregionReturns a list of all domains in the user's account.
create_domain_entryinsertregion, domainName, domainEntryCreates one of the following domain name system (DNS) records in a domain DNS zone: Address (A), canonical name (CNAME), mail exchanger (MX), name server (NS), start of authority (SOA), service locator (SRV), or text (TXT). The create domain entry operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.
create_domaininsertregion, domainNameCreates a domain resource for the specified domain (example.com). The create domain operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.
update_domain_entryupdateregion, domainName, domainEntryUpdates a domain recordset after it is created. The update domain entry operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.
delete_domain_entrydeleteregionDeletes a specific domain entry. The delete domain entry operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.
delete_domaindeleteregionDeletes the specified domain recordset and all of its domain records. The delete domain operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about a specific domain recordset.

SELECT
name,
arn,
created_at,
domain_entries,
location,
registered_domain_delegation_info,
resource_type,
support_code,
tags
FROM aws.lightsail.domains
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates one of the following domain name system (DNS) records in a domain DNS zone: Address (A), canonical name (CNAME), mail exchanger (MX), name server (NS), start of authority (SOA), service locator (SRV), or text (TXT). The create domain entry operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.

INSERT INTO aws.lightsail.domains (
domainName,
domainEntry,
region
)
SELECT
'{{ domainName }}' /* required */,
'{{ domainEntry }}' /* required */,
'{{ region }}'
RETURNING
operation
;

UPDATE examples

Updates a domain recordset after it is created. The update domain entry operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.

UPDATE aws.lightsail.domains
SET
domainName = '{{ domainName }}',
domainEntry = '{{ domainEntry }}'
WHERE
region = '{{ region }}' --required
AND domainName = '{{ domainName }}' --required
AND domainEntry = '{{ domainEntry }}' --required
RETURNING
operations;

DELETE examples

Deletes a specific domain entry. The delete domain entry operation supports tag-based access control via resource tags applied to the resource identified by domain name. For more information, see the Amazon Lightsail Developer Guide.

DELETE FROM aws.lightsail.domains
WHERE region = '{{ region }}' --required
;