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

incapsula_site.domain_verification is not set when using CNAME verification #426

Open
2 tasks done
uduncanu opened this issue May 24, 2024 · 1 comment
Open
2 tasks done

Comments

@uduncanu
Copy link
Contributor

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Imperva provider version

Terraform 1.8.2
Imperva 3.25.0

Affected resource(s)

incapsula_site.domain_verification

Terraform configuration files

resource "incapsula_site" "site" {
  domain = "www.example.com"
  domain_validation = "cname"
  ignore_ssl = true
}
output "ssl_dns" {
  value = "${incapsula_site.site.dns_cname_record_name} CNAME ${incapsula_site.site.domain_verification}." : ""
}

Debug output

I've not managed to get debug outputs.

Panic output

No response

Expected output

The CNAME record value that needs to be created to validate SSL.

Actual output

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Invalid template interpolation value
│
│   on ../../../modules/imperva/base/resources.tf line 29, in output "ssl_dns":
│   29:   value = var.setup ? "${incapsula_site.site.dns_cname_record_name} CNAME ${incapsula_site.site.domain_verification}." : ""
│     ├────────────────
│     │ incapsula_site.site.domain_verification is null
│
│ The expression result is null. Cannot include a null value in a string template.

Steps to reproduce

  1. Create site via terraform using cname DNS verification
  2. Output the domain

Additional factoids

Looking at

if siteStatusResponse.Ssl.GeneratedCertificate.ValidationMethod == "dns" {
, I can see how the domain_verification value gets set when using DNS (TXT) verification, but can't see anything for CNAME verification.

On a related note, it would be really useful if the value was always there but empty no matter what type of verification you're using, rather than not existing at all unless you're using DNS verification.

References

No response

@BrachaY
Copy link
Collaborator

BrachaY commented May 26, 2024

Hi @uduncanu

Thank you for opening this issue.
We will handle it soon and let you know once we release the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants