Closed pysiok1983 closed 2 years ago
@pysiok1983 this limitation is at the API. There is little the provider can do. Does this make sense?
Can we add a delay for each iteration within this resource?
@pysiok1983 I don't think so. There is no need when one resource is created. When you prepare a module, that might be a good place to do. Does this make sense?
@pysiok1983 I don't think so. There is no need when one resource is created. When you prepare a module, that might be a good place to do. Does this make sense?
I have tested a module - same issue.
resource "time_sleep" "psc_propagation" {
create_duration = "15s"
}
module "psc_sb" {
source = "../psc"
for_each = var.psc_groups
service_attachment_name = each.value.service_attachment_name
service_attachment = each.value.service_attachment
depends_on = [ time_sleep.psc_propagation ]
}
@pysiok1983 sorry, what I meant was that delay logic could be built inside a module which might handle the concurrency in multiple instances, because this only happens when you create multiple instances at the same time. For your case, using -parallelism=1 is still the best choice, I think.
@pysiok1983 sorry, what I meant was that delay logic could be built inside a module which might handle the concurrency in multiple instances.
Are you able to provide an example?
@pysiok1983 sorry no. This repo is for the individual resource. If there is no existing module available, you probably need to build it by yourself.
To your suggestion here, not sure how delay for each iteration within this resource
can help? Can you elaborate?
Closing this now. @pysiok1983 feel free to reopen if you want to continue
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
1.2.7 Google provider - 4.32.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
│ Error: Error creating EndpointAttachment: googleapi: Error 400: the resource is locked by another operation where endpoint attachment psc1 is currently being created for organization proj1 by operation: d03e570e-56c4-4af9-85aa-c117a77be7ac │ Details: │ [ │ │ "@type": "type.googleapis.com/google.rpc.RequestInfo", │ "requestId": "210181044925815171" │ │ ]
Expected Behavior
Both PSCs should be created without any issues.
Actual Behavior
Seems that using a loop for google_apigee_endpoint_attachment causes an issue. The resource doesn't wait enough long and when the second psc is launching APIgee reports an issue.
Steps to Reproduce
terraform apply
Important Factoids
Using -parallelism=1 solved this issue but delays the whole deployment.
References
0000