Open
Description
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 "me too" comments, 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 Version and Provider Version
Terraform v1.9.3
on linux_amd64
- provider registry.terraform.io/oracle/oci v6.31.0
Affected Resource(s)
oci_database_pluggable_database
Terraform Configuration Files
....
resource "oci_database_pluggable_database" "extras" {
for_each = { for pdb in [
{
name = "clpdb02"
freeform_tags = { "component" : "clpdb02" }
},
{
name = "clpdb03"
freeform_tags = { "component" : "clpdb03" }
},
] : pdb.name => pdb }
container_database_id = "container db ocid"
pdb_name = lower(each.value.name)
pdb_admin_password = "password"
tde_wallet_password = "password"
should_pdb_admin_account_be_locked = false
freeform_tags = each.value.freeform_tags
lifecycle {
ignore_changes = [
defined_tags["Oracle-Tags.CreatedBy"],
defined_tags["Oracle-Tags.CreatedOn"],
# provider couldn't detect password changes outside of terraform
# also cannot update passwords when random password changes
pdb_admin_password,
tde_wallet_password,
]
}
}
...
Debug Output
Panic Output
Expected Behavior
when using for_each loop to create multiple pdbs, all pdbs should be created successfully
Actual Behavior
when creating multiple pdbs using for_each loop, even if only 2 pdbs, terraform apply fails with timeout error. rerun terraform apply shows at least one of the databases is tainted and has to be re-created.
Steps to Reproduce
- use the code snippet above and fill in the real value.
- in the for_each block, put in at least 2 blocks for 2 pdbs(one single pdb has no issue and only takes 3 minutes to complete successfully).
terraform apply
this will timeout with the following error
│ Error: Operation Timeout
│ Provider version: 6.31.0, released on 2025-03-19. This provider is 1 Update(s) behind to current.
│ Service: Database Pluggable
│ Error Message: timeout while waiting for state to become 'SUCCEEDED, FAILED, CANCELED' (timeout: 20m0s)
│ Suggestion: Try increasing the timeout by referring to this document: https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformtroubleshooting.htm#common_issues__timeoutwhilewaiting
│
│
│ with oci_database_pluggable_database.extras["clpdb02"],
│ on main.tf line 102, in resource "oci_database_pluggable_database" "extras":
│ 102: resource "oci_database_pluggable_database" "extras" {
│
- re-run terraform apply. this will create the 2nd pdb successfully with message indicating one of the pdbs was tainted. If total is more than 2 pdbs, this step will fail too as if the backend only allows one pdb to created at once, but terraform is not properly queuing the requests.
Terraform will perform the following actions:
# oci_database_pluggable_database.extras["clpdb02"] is tainted, so must be replaced
-/+ resource "oci_database_pluggable_database" "extras" {
~ compartment_id = "ocid1.compartment.oc1..aaaaaaaaui5npqsoh4mqtvtwaj242sdlwg7gusw3ohdegizqzgjs6pzp75dq" -> (known after apply)
~ connection_strings = [