Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong resoruce reported at error: origin.0.domain_name must not be empty, got #36854

Open
EugenKon opened this issue Apr 4, 2025 · 0 comments
Labels
bug new new issue not yet triaged

Comments

@EugenKon
Copy link

EugenKon commented Apr 4, 2025

Terraform Version

v1.11.3

Terraform Configuration Files

resource "aws_cloudfront_distribution" "radix-cdn-cloudfront" {
  aliases         = [local.cluster.domain.radix_cdn]
  enabled         = true

  origin {
    domain_name = coalesce(local.cluster.domain.radix, "stub")
    origin_id   = local.radix-cdn-id
    ....
  }

  origin {
    domain_name = local.cluster.domain.radix_unbranded
    origin_id   = local.radix-unbranded-cdn-id
    ...
  }
}

Debug Output

│ Error: origin.0.domain_name must not be empty, got
│
│   with module.cdn[0].aws_cloudfront_distribution.radix-cdn-cloudfront,
│   on modules/cdn/cloudfront.tf line 124, in resource "aws_cloudfront_distribution" "radix-cdn-cloudfront":
│  124: resource "aws_cloudfront_distribution" "radix-cdn-cloudfront" {

Expected Behavior

Here the problem with the second origin, thus I expect index to be 1 instead of 0:

origin.1.domain_name must not be empty, got

Actual Behavior

TF reports that error is located at resource with index 0.

Steps to Reproduce

To resolve the issue apply the next changes to the second origin:

- domain_name = local.cluster.domain.radix_unbranded
+ domain_name = coalesce( local.cluster.domain.radix_unbranded, "stub" )

Additional Context

Also got looks weird. I expect it should be Error: origin.1.domain_name must not be empty, got "". Otherwise it looks like unfinished sentence.

References

No response

Generative AI / LLM assisted development?

No response

@EugenKon EugenKon added bug new new issue not yet triaged labels Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

1 participant