Open majkelcc opened 2 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Running into the same issue on our end. It will in fact create the A record, but terraform doesn't seem to recognize that and gives the error saying :
│ Error: reading AWS Lightsail DomainEntry (@,domain.org,A,url.us-east-1.cs.amazonlightsail.com): empty result
│
│ with aws_lightsail_domain_entry.oe_domain_entry,
│ on main.tf line 45, in resource "aws_lightsail_domain_entry" "oe_domain_entry":
│ 45: resource "aws_lightsail_domain_entry" "oe_domain_entry" {
│
╵
Error: Terraform exited with code 1.
Error: Process completed with exit code 1.
Terraform version: ">= 1.2.0" AWS provider version: ">= 4.59.0"
More context. Trying to import the resource manually also fails:
aws lightsail get-domain --domain-name mydomain.org --region us-east-1
{
"domain": {
"name": "mydomain.org",
"arn": "arn:aws:lightsail:global:xxxxxxx:Domain/c6063fa0-3eb8-4e70-94cb-3121199e96a6",
"supportCode": "XXXXXXX//hostedzone/XXXXXXXXA",
"createdAt": "2024-10-18T22:36:43.252000-05:00",
"location": {
"availabilityZone": "all",
"regionName": "global"
},
"resourceType": "Domain",
"tags": [],
"domainEntries": [
{
"id": "1240386878",
"name": "\\100.mydomain.org",
"target": "xxxxxx.us-east-1.cs.amazonlightsail.com",
"isAlias": true,
"type": "A"
},
],
}
after running terraform import command:
terraform import aws_lightsail_domain_entry.oe_domain_entry 1240386878
│ Error: Cannot import non-existent remote object │ │ While attempting to import an existing object to "aws_lightsail_domain_entry.oe_domain_entry", the provider detected that no object │ exists with the given id. Only pre-existing objects can be imported; check that the id is correct and that it is associated with the │ provider's configured region or endpoint, or use "terraform apply" to create a new remote object for this resource. ╵
Terraform Core Version
1.9.5
AWS Provider Version
5.66.0
Affected Resource(s)
I'm running into several issues with
aws_lightsail_domain_entry
, which seems unusable at this stage.Expected Behavior
On the first run domain entries are created without errors and consecutive plans show no changes when no changes were introduced.
Actual Behavior
A
type entry:aws_lightsail_domain_entry
relevantA
record whenis_alias = true
CNAME
type entry fails to create in terraform on each run, but the record gets correctly created in AWS, causingrecord already exists
error in next runs.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Run
terraform apply
two times, one after another.Debug Output
First run
Second run
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No