Skip to content

Commit

Permalink
Make bundle_id required and immutable for Firebase AppleApp. (#7849) (#…
Browse files Browse the repository at this point in the history
…5577)

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored May 2, 2023
1 parent 9b72955 commit d396c8e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .changelog/7849.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
firebase: specified required argument `bundle_id` in `google_firebase_apple_app`
```
21 changes: 6 additions & 15 deletions google-beta/resource_firebase_apple_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ func ResourceFirebaseAppleApp() *schema.Resource {
},

Schema: map[string]*schema.Schema{
"bundle_id": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `The canonical bundle ID of the Apple app as it would appear in the Apple AppStore.`,
},
"display_name": {
Type: schema.TypeString,
Required: true,
Expand All @@ -53,11 +59,6 @@ func ResourceFirebaseAppleApp() *schema.Resource {
Optional: true,
Description: `The automatically generated Apple ID assigned to the Apple app by Apple in the Apple App Store.`,
},
"bundle_id": {
Type: schema.TypeString,
Optional: true,
Description: `The canonical bundle ID of the Apple app as it would appear in the Apple AppStore.`,
},
"team_id": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -271,12 +272,6 @@ func resourceFirebaseAppleAppUpdate(d *schema.ResourceData, meta interface{}) er
} else if v, ok := d.GetOkExists("display_name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, displayNameProp)) {
obj["displayName"] = displayNameProp
}
bundleIdProp, err := expandFirebaseAppleAppBundleId(d.Get("bundle_id"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("bundle_id"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, bundleIdProp)) {
obj["bundleId"] = bundleIdProp
}
appStoreIdProp, err := expandFirebaseAppleAppAppStoreId(d.Get("app_store_id"), d, config)
if err != nil {
return err
Expand All @@ -302,10 +297,6 @@ func resourceFirebaseAppleAppUpdate(d *schema.ResourceData, meta interface{}) er
updateMask = append(updateMask, "displayName")
}

if d.HasChange("bundle_id") {
updateMask = append(updateMask, "bundleId")
}

if d.HasChange("app_store_id") {
updateMask = append(updateMask, "appStoreId")
}
Expand Down
8 changes: 4 additions & 4 deletions website/docs/r/firebase_apple_app.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ The following arguments are supported:
(Required)
The user-assigned display name of the App.

* `bundle_id` -
(Required)
The canonical bundle ID of the Apple app as it would appear in the Apple AppStore.

- - -

- - -

* `bundle_id` -
(Optional)
The canonical bundle ID of the Apple app as it would appear in the Apple AppStore.

* `app_store_id` -
(Optional)
Expand Down

0 comments on commit d396c8e

Please sign in to comment.