Creates a domain entry resource
resource "aws_lightsail_domain" "test" {
domain_name = "mydomain.com"
}
resource "aws_lightsail_domain_entry" "test" {
domain_name = aws_lightsail_domain.domain_test.domain_name
name = "www"
type = "A"
target = "127.0.0.1"
}
This resource supports the following arguments:
domain_name
- (Required) The name of the Lightsail domain in which to create the entryname
- (Required) Name of the entry recordtype
- (Required) Type of recordtarget
- (Required) Target of the domain entryis_alias
- (Optional) If the entry should be an alias Defaults to false
This resource exports the following attributes in addition to the arguments above:
id
- A combination of attributes to create a unique id: name
,domain_name
,type
,target
In Terraform v1.5.0 and later, use an import
block to import aws_lightsail_domain_entry
using the id attribute. For example:
import {
to = aws_lightsail_domain_entry.example
id = "www,mydomain.com,A,127.0.0.1"
}
Using terraform import
, import aws_lightsail_domain_entry
using the id attribute. For example:
% terraform import aws_lightsail_domain_entry.example www,mydomain.com,A,127.0.0.1