@@ -152,6 +152,16 @@ those with Billing Account Administrators and Billing
152
152
Account Users IAM roles for the target account.` ,
153
153
Default : false ,
154
154
},
155
+ "enable_project_level_recipients" : {
156
+ Type : schema .TypeBool ,
157
+ Optional : true ,
158
+ Description : `When set to true, and when the budget has a single project configured,
159
+ notifications will be sent to project level recipients of that project.
160
+ This field will be ignored if the budget has multiple or no project configured.
161
+
162
+ Currently, project level recipients are the users with Owner role on a cloud project.` ,
163
+ Default : false ,
164
+ },
155
165
"monitoring_notification_channels" : {
156
166
Type : schema .TypeList ,
157
167
Optional : true ,
@@ -651,7 +661,8 @@ func resourceBillingBudgetUpdate(d *schema.ResourceData, meta interface{}) error
651
661
updateMask = append (updateMask , "notificationsRule.pubsubTopic" ,
652
662
"notificationsRule.schemaVersion" ,
653
663
"notificationsRule.monitoringNotificationChannels" ,
654
- "notificationsRule.disableDefaultIamRecipients" )
664
+ "notificationsRule.disableDefaultIamRecipients" ,
665
+ "notificationsRule.enableProjectLevelRecipients" )
655
666
}
656
667
657
668
if d .HasChange ("ownership_scope" ) {
@@ -1110,6 +1121,8 @@ func flattenBillingBudgetAllUpdatesRule(v interface{}, d *schema.ResourceData, c
1110
1121
flattenBillingBudgetAllUpdatesRuleMonitoringNotificationChannels (original ["monitoringNotificationChannels" ], d , config )
1111
1122
transformed ["disable_default_iam_recipients" ] =
1112
1123
flattenBillingBudgetAllUpdatesRuleDisableDefaultIamRecipients (original ["disableDefaultIamRecipients" ], d , config )
1124
+ transformed ["enable_project_level_recipients" ] =
1125
+ flattenBillingBudgetAllUpdatesRuleEnableProjectLevelRecipients (original ["enableProjectLevelRecipients" ], d , config )
1113
1126
return []interface {}{transformed }
1114
1127
}
1115
1128
func flattenBillingBudgetAllUpdatesRulePubsubTopic (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
@@ -1132,6 +1145,10 @@ func flattenBillingBudgetAllUpdatesRuleDisableDefaultIamRecipients(v interface{}
1132
1145
return v
1133
1146
}
1134
1147
1148
+ func flattenBillingBudgetAllUpdatesRuleEnableProjectLevelRecipients (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1149
+ return v
1150
+ }
1151
+
1135
1152
func flattenBillingBudgetOwnershipScope (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1136
1153
return v
1137
1154
}
@@ -1525,6 +1542,13 @@ func expandBillingBudgetAllUpdatesRule(v interface{}, d tpgresource.TerraformRes
1525
1542
transformed ["disableDefaultIamRecipients" ] = transformedDisableDefaultIamRecipients
1526
1543
}
1527
1544
1545
+ transformedEnableProjectLevelRecipients , err := expandBillingBudgetAllUpdatesRuleEnableProjectLevelRecipients (original ["enable_project_level_recipients" ], d , config )
1546
+ if err != nil {
1547
+ return nil , err
1548
+ } else if val := reflect .ValueOf (transformedEnableProjectLevelRecipients ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
1549
+ transformed ["enableProjectLevelRecipients" ] = transformedEnableProjectLevelRecipients
1550
+ }
1551
+
1528
1552
return transformed , nil
1529
1553
}
1530
1554
@@ -1544,6 +1568,10 @@ func expandBillingBudgetAllUpdatesRuleDisableDefaultIamRecipients(v interface{},
1544
1568
return v , nil
1545
1569
}
1546
1570
1571
+ func expandBillingBudgetAllUpdatesRuleEnableProjectLevelRecipients (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1572
+ return v , nil
1573
+ }
1574
+
1547
1575
func expandBillingBudgetOwnershipScope (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1548
1576
return v , nil
1549
1577
}
0 commit comments