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 returns "Invalid site cname" for given "site_ip" value #358

Open
2 tasks done
crawfs opened this issue Sep 27, 2023 · 0 comments
Open
2 tasks done

Comments

@crawfs
Copy link

crawfs commented Sep 27, 2023

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

imperva/incapsula v3.20.4

Terraform 1.3.6

Affected resource(s)

incapsula_site

Terraform configuration files

resource "incapsula_site" "cloud" {
  depends_on             = [azurerm_dns_a_record.dns-prd-record]
  domain                 = "www.example.com"
  send_site_setup_emails = "false"
  site_ip                = "subdomain.example.com"
  data_storage_region    = "US"
  log_level              = "full"
}

Debug output

2023-09-27T13:00:10.823Z [INFO]  provider.terraform-provider-incapsula_v3.20.4: 2023/09/27 13:00:10 [INFO] Creating Incapsula site for domain: www.example.com: timestamp=2023-09-27T13:00:10.819Z
2023-09-27T13:00:10.823Z [INFO]  provider.terraform-provider-incapsula_v3.20.4: 2023/09/27 13:00:10 [INFO] Adding Incapsula site for domain: www.example.com (account ID 0): timestamp=2023-09-27T13:00:10.819Z
2023-09-27T13:00:11.185Z [INFO]  provider.terraform-provider-incapsula_v3.20.4: 2023/09/27 13:00:11 [DEBUG] Incapsula add site JSON response: {"res":2,"res_message":"Invalid input","debug_info":{"Invalid site cname":"subdomain.example.com.","id-info":"999999"}}: timestamp=2023-09-27T13:00:11.185Z
2023-09-27T13:00:11.185Z [INFO]  provider.terraform-provider-incapsula_v3.20.4: 2023/09/27 13:00:11 [ERROR] Could not create Incapsula site for domain: www.example.com, Error from Incapsula service when adding site for domain www.example.com: {"res":2,"res_message":"Invalid input","debug_info":{"Invalid site cname":"subdomain.example.com.","id-info":"999999"}}: timestamp=2023-09-27T13:00:11.185Z
2023-09-27T13:00:11.185Z [ERROR] provider.terraform-provider-incapsula_v3.20.4: Response contains error diagnostic: @module=sdk.proto diagnostic_detail= diagnostic_summary="Error from Incapsula service when adding site for domain www.example.com: {"res":2,"res_message":"Invalid input","debug_info":{"Invalid site cname":"subdomain.example.com.","id-info":"999999"}}" tf_proto_version=5.3 tf_provider_addr=provider diagnostic_severity=ERROR tf_req_id=a6ded97c-22e2-5bbc-cda3-01198befc1fb tf_resource_type=incapsula_site tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.14.1/tfprotov5/internal/diag/diagnostics.go:55 timestamp=2023-09-27T13:00:11.185Z
2023-09-27T13:00:11.186Z [ERROR] vertex "incapsula_site.profisee_cloud" error: Error from Incapsula service when adding site for domain www.example.com: {"res":2,"res_message":"Invalid input","debug_info":{"Invalid site cname":"subdomain.example.com.","id-info":"999999"}}

Panic output

No response

Expected output

The site should be created successfully with subdomain.example.com as the backend target. Worth mentioning that this fqdn does not cause errors when this same site is configured via the web portal with the same settings. Additionally even if it does error out "Invalid site cname" is insufficient information to appropriately troubleshoot

Actual output

╷
│ Error: Error from Incapsula service when adding site for domain www.example.com: {"res":2,"res_message":"Invalid input","debug_info":{"Invalid site cname":"subdomain.example.com.","id-info":"999999"}}
│ 
│   with incapsula_site.profisee_cloud,
│   on site.tf line 6, in resource "incapsula_site" "profisee_cloud":
│    6: resource "incapsula_site" "profisee_cloud" {
│ 
╵

Terraform returns error as shown

Steps to reproduce

As shown above

Additional factoids

Edited to remove the original domains used in configuration. The primary issue here is that "Invalid site cname" provides insufficient information as an error message

References

No response

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

1 participant