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

Unable to create multiple ibm_logs_outgoing_webhook resources in a for_each loop #5734

Open
ocofaigh opened this issue Oct 19, 2024 · 0 comments
Labels
service/Cloud Logs Issues related to Cloud Logs

Comments

@ocofaigh
Copy link
Contributor

ocofaigh commented Oct 19, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

tf 1.9.2
ibm provider 1.70.1

Affected Resource(s)

  • ibm_logs_outgoing_webhook

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "ibm_logs_outgoing_webhook" "en_integration" {
  for_each    = { for idx, en in var.existing_en_instances : idx => en }
  instance_id = ibm_resource_instance.cloud_logs.guid
  region      = var.region
  name        = each.value.en_integration_name
  type        = "ibm_event_notifications"

  ibm_event_notifications {
    event_notifications_instance_id = each.value.en_instance_id
    region_id                       = each.value.en_region
  }
}

Debug Output

│ Error: ---
│ id: terraform-693866e6
│ summary: 'CreateOutgoingWebhookWithContext failed: No authentication information in
│   RequestContext'
│ severity: error
│ resource: ibm_logs_outgoing_webhook
│ operation: create
│ component:
│   name: github.com/IBM-Cloud/terraform-provider-ibm
│   version: 1.70.1
│ ---
│ 
│ 
│   with module.observability_instances.module.cloud_logs[0].ibm_logs_outgoing_webhook.en_integration["1"],
│   on ../../modules/cloud_logs/main.tf line 104, in resource "ibm_logs_outgoing_webhook" "en_integration":
│  104: resource "ibm_logs_outgoing_webhook" "en_integration" {
│ 

Panic Output

Expected Behavior

No error

Actual Behavior

If you try to create more than 1 ibm_logs_outgoing_webhook resource, you get the error above. It seems like the backend cannot handle the requests in such quick succession.

Steps to Reproduce

  1. terraform apply

Important Factoids

If I wait some time, and re-apply - it passes, its definitely a timing issue.
I cannot find any way to add a sleep inside the for_each loop in terraform. It seems its not possible, so perhaps workaround could be added to the provider to retry with a backoff wait.

References

  • #0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Cloud Logs Issues related to Cloud Logs
Projects
None yet
Development

No branches or pull requests

1 participant