Closed lsorber closed 2 years ago
I had this last night, pulled my hair our for hours on it.
I don't think it's a Terraform bug, but more of an AWS bug - if you try to recreate the custom domain link manually in the AWS app runner console, it gives you an empty list of validation records to add.
In the end I had to change the subdomain I was using in aws_apprunner_custom_domain_association
.domain_name
for it to work.
For the record, I am getting this when creating a domain association from scratch. The domain association ends up being created on AWS App Runner, and the certifcates actually do end up verified. The tf state file even shows the validation records marked as SUCCESS
.
Any workaround? Does changing the subdomain and changing it back work? I've completely destroyed everything and recreated it, and still hitting this :(
Hi everyone, I opened a PR with a fix that seems to fix it --> #22569 - couldn't find any other way to solve the issue... As I explained on the PR's description, it seems that for some blurry reason the returned state is not always the same and the app_runner module is not able to deal with that...
@johnraz this will make the terraform work, but does the custom domain work? Even when I do it manually in the console the DNS doesn't work.
@jvisker it does result in a correct terraform state and a functioning custom domain association, yes. You might be facing another issue different from the one I’m getting because on my side the custom domain was always added (even without my fix) but terraform couldn’t validate the resource’s state and update the terraform state accordingly. Also deleting / adding the custom domain association manually always worked too.
@johnraz I tried it again and I realized I can get it to work manually, just not with terraform on recreation. Great work.
This functionality has been released in v3.73.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Relevant part of our App Runner service module:
Debug Output
Expected Behavior
aws_apprunner_custom_domain_association
resource should be created.Actual Behavior
aws_apprunner_custom_domain_association
resource is not created because of unexpected state.Steps to Reproduce
aws_apprunner_custom_domain_association
with Terraform.