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

creatign multiple instances of sites using 'for_each" ends with error. #210

Open
2 tasks done
altmvogi opened this issue Sep 16, 2022 · 10 comments
Open
2 tasks done

Comments

@altmvogi
Copy link

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

D:\terraform\imperva\test>terraform -v
Terraform v1.2.9
on windows_amd64

  • provider registry.terraform.io/hashicorp/null v3.1.1
  • provider registry.terraform.io/imperva/incapsula v3.8.5

D:\terraform\imperva\test>
terraform {
required_providers {
incapsula = {
source = "imperva/incapsula"
version = "3.8.5"
}
}
}

Affected resource(s)

incasula_site

Terraform configuration files

provider "incapsula" {
  api_id  = var.app_id
  api_key = var.api_key
}

# Create a site
resource "incapsula_site" "example-site" {
  for_each     = toset(var.applications)
  domain       = each.key
  force_ssl    = true
  wildcard_san = true
}
Unfortunately, this is an issue related to a dynamic entry usign for_each, while the regular version using 1 instance works properly.

Debug output

terraform_imperva_debug.txt

Panic output

N/A

Expected output

created sites with no error response

Actual output

created sites with errors, whcih prevent the rest from the production script to be executed. However the sites are gettgin created normally in Imperva

Steps to reproduce

just run the config file and wait until it errors out

Additional factoids

No response

References

No response

@eilon-shai
Copy link
Contributor

Hi,

Can you please share the error you get?
Also can you please share the size of the applications set?

The same setup works for me with no errors for applications.size==12

Thanks,
Eilon

@altmvogi
Copy link
Author

Hi, I have an update for you. you are right this works on a new site creation, but in case the create and the change site is triggered after creation, the error appears. and the error comes from the "site update" fnction. so this is an issue, but has nothing to do with creating multiple instances with for each.

regards
Michael

@altmvogi
Copy link
Author

the go code includes a timeout of 5 seconds for the site creation to complete. can you please change the constant, that defines the waiting time to 10 seconds instead to see if this is enough?

@altmvogi
Copy link
Author

is this proiject still developped or not ? I would contribute, but my go knowledge is close to 0

@eilon-shai
Copy link
Contributor

can you please share the error that you get?

@BrachaY
Copy link
Collaborator

BrachaY commented Sep 28, 2022

@eilon-shai You can find the error in the debug log attached to the first message:

2022-09-16T03:15:02.562-0700 [INFO] provider.terraform-provider-incapsula_v3.8.5.exe: 2022/09/16 03:15:02 [DEBUG] Incapsula update site JSON response: {"res":3015,"res_message":"Internal error","debug_info":{"":"Add site operation hasn\u0027t finished.","id-info":"999999"}}: timestamp=2022-09-16T03:15:02.562-0700

There are multiple such errors.

@altmvogi
Copy link
Author

altmvogi commented Oct 11, 2022 via email

@altmvogi
Copy link
Author

altmvogi commented Oct 11, 2022 via email

@shirisemoimperva
Copy link
Collaborator

Hi, is this issue still relevant?

@altmvogi
Copy link
Author

altmvogi commented Jul 6, 2023 via email

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

No branches or pull requests

4 participants