File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ resource "time_sleep" "wait_for_authorization_policy" {
8787
8888resource  "ibm_iam_authorization_policy"  "backup_kms_policy"  {
8989  count                     =   local. create_backup_kms_policy  ?  1  :  0 
90-   source_service_account    =   local. kms_account_id 
9190  source_service_name       =  " databases-for-elasticsearch" 
9291  source_resource_group_id  =   var. resource_group_id 
9392  roles                     =   [" Reader"  ]
@@ -115,7 +114,7 @@ resource "ibm_iam_authorization_policy" "backup_kms_policy" {
115114  resource_attributes  {
116115    name      =  " resource" 
117116    operator  =  " stringEquals" 
118-     value     =   local. backup_encryption_key_crn 
117+     value     =   local. backup_kms_key_id 
119118  }
120119  #  Scope of policy now includes the key, so ensure to create new policy before
121120  #  destroying old one to prevent any disruption to every day services.
@@ -126,12 +125,12 @@ resource "ibm_iam_authorization_policy" "backup_kms_policy" {
126125
127126#  workaround for https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4478
128127resource  "time_sleep"  "wait_for_backup_kms_authorization_policy"  {
129-   depends_on       =   [ibm_iam_authorization_policy . backup_kms_policy ,  ibm_iam_authorization_policy . backup_kms_policy ]
128+   depends_on       =   [ibm_iam_authorization_policy . backup_kms_policy ]
130129  create_duration  =  " 30s" 
131130}
132131
133132resource  "ibm_database"  "elasticsearch"  {
134-   depends_on                 =   [time_sleep . wait_for_authorization_policy ]
133+   depends_on                 =   [time_sleep . wait_for_authorization_policy ,  time_sleep . wait_for_backup_kms_authorization_policy ]
135134  name                       =   var. name 
136135  plan                       =   var. plan 
137136  location                   =   var. region 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments