@@ -177,7 +177,6 @@ If this parameter is 0, a default value of 5 is used.`,
177177 "enable_exactly_once_delivery" : {
178178 Type : schema .TypeBool ,
179179 Optional : true ,
180- ForceNew : true ,
181180 Description : `If 'true', Pub/Sub provides the following guarantees for the delivery
182181of a message with a given value of messageId on this Subscriptions':
183182
@@ -702,6 +701,12 @@ func resourcePubsubSubscriptionUpdate(d *schema.ResourceData, meta interface{})
702701 } else if v , ok := d .GetOkExists ("retry_policy" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , retryPolicyProp )) {
703702 obj ["retryPolicy" ] = retryPolicyProp
704703 }
704+ enableExactlyOnceDeliveryProp , err := expandPubsubSubscriptionEnableExactlyOnceDelivery (d .Get ("enable_exactly_once_delivery" ), d , config )
705+ if err != nil {
706+ return err
707+ } else if v , ok := d .GetOkExists ("enable_exactly_once_delivery" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , enableExactlyOnceDeliveryProp )) {
708+ obj ["enableExactlyOnceDelivery" ] = enableExactlyOnceDeliveryProp
709+ }
705710
706711 obj , err = resourcePubsubSubscriptionUpdateEncoder (d , meta , obj )
707712 if err != nil {
@@ -751,6 +756,10 @@ func resourcePubsubSubscriptionUpdate(d *schema.ResourceData, meta interface{})
751756 if d .HasChange ("retry_policy" ) {
752757 updateMask = append (updateMask , "retryPolicy" )
753758 }
759+
760+ if d .HasChange ("enable_exactly_once_delivery" ) {
761+ updateMask = append (updateMask , "enableExactlyOnceDelivery" )
762+ }
754763 // updateMask is a URL parameter but not present in the schema, so replaceVars
755764 // won't set it
756765 url , err = addQueryParams (url , map [string ]string {"updateMask" : strings .Join (updateMask , "," )})
0 commit comments