terraform-provider-incapsula
terraform-provider-incapsula copied to clipboard
incapsula_site returns "Invalid site cname" for given "site_ip" value
Confirmation
- [X] My issue isn't already found on the issue tracker.
- [X] 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/[email protected]/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