Closed stockmaj closed 4 months ago
Hi @stockmaj,
we just hit the same issue and found out that the behavior is actually documented on the resource: https://registry.terraform.io/providers/imperva/incapsula/latest/docs/resources/site#site_ip
site_ip - (Optional) The web server IP/CNAME. This field should be specified when creating a site and the domain does not yet exist or the domain already points to Imperva Cloud. When specified, its value will be used for adding site only. After site is already created this field will be ignored. To modify site ip, please use resource incapsula_data_centers_configuration instead.
The code also illustrates this behavior: https://github.com/imperva/terraform-provider-incapsula/blob/8d8e58e7306e3c39694cf69633ac38858d01ab7f/incapsula/resource_site.go#L69-L76
Note, that the resource incapsula_data_centers_configuration
has quite a few fields, but can be imported in a Terraform config if your incapsula_site
already exists. If you are using a recent version of Terraform, you can use an import block, run a terraform plan
and easily deduce the current state of the data center configuration via diff.
import {
id = "1234567"
to = incapsula_data_centers_configuration.example
}
resource "incapsula_data_centers_configuration" "example" {
site_id = incapsula_site.example.id
site_topology = "SINGLE_DC"
data_center {
name = "New DC"
ip_mode = "SINGLE_IP"
origin_server {
address = "1.1.1.1"
is_active = true
}
}
}
Thanks @RomanNess
Confirmation
Terraform and Imperva provider version
Affected resource(s)
When I change the site_ip on an incapsula_site, the terraform plan does not detect any change to the resource.
If I go to the web console and change the website IP address/CNAME field without changing terraform, the terraform plan does not detect any change to the resource. In the example below, I can change 1.2.3.4 to 4.3.2.1 and terraform says there are no changes
Terraform configuration files
Debug output
There is company specific information in the debug output and I do not have an extra website license to be able to create one for testing purposes. This is replicable on multiple sites, though.****
Panic output
No response
Expected output
I expected the plan to say the IP address woudl be changed
Actual output
No changes. Your infrastructure matches the configuration.
Steps to reproduce
Yes, changing either terrraform or the website Server IP so they do not match should result in the terraform plan indicating an update to the incapsula_site
Additional factoids
No response
References
No response