Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add google_firebase_android_app resource #8293

Closed
mleonhard opened this issue Jan 25, 2021 · 9 comments
Closed

Add google_firebase_android_app resource #8293

mleonhard opened this issue Jan 25, 2021 · 9 comments
Labels
enhancement size/m tpgtools Issues related to the tpgtools generator
Milestone

Comments

@mleonhard
Copy link

mleonhard commented Jan 25, 2021

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. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

I wish to automate configuring Firebase Cloud Messaging for Android apps. This has several purposes:

  • eliminate error-prone manual steps
  • reduce manual handling of credentials
  • bring FCM config under our software development process (code reviews, continuous integration, continuous deployment)

New or Affected Resource(s)

  • google_firebase_android_app resource
    • google_firebase_project_id
    • package_name
    • google_services_json attribute

Potential Terraform Configuration

resource "google_project" "default" {
  provider = google-beta

  project_id = "app-staging"
  name       = "app-staging"
  org_id     = "123456789"
}

resource "google_firebase_project" "default" {
  provider = google-beta
  project  = google_project.default.project_id
}

resource "google_firebase_android_app" "default" {
  google_firebase_project_id = google_firebase_project.default.id
  package_name = "com.example.app.staging"
}
output "google_services_json" {
  value = google_firebase_android_app.default.google_services_json
}

References

@ghost ghost added the enhancement label Jan 25, 2021
@mleonhard mleonhard changed the title Add google_firebase_android_app resource with apns_auth_key arg Add google_firebase_android_app resource Jan 25, 2021
@slevenick
Copy link
Collaborator

Same as others the other linked requests, we will need a REST API for this

@slevenick slevenick added the tpgtools Issues related to the tpgtools generator label Mar 29, 2021
@slevenick slevenick removed their assignment Mar 29, 2021
@mleonhard
Copy link
Author

This ticket is labeled "waiting-response". Does that mean it is waiting for a response from me?

@slevenick slevenick added this to the Goals milestone Jun 25, 2021
@slevenick slevenick added size/m and removed upstream labels Jun 25, 2021
@slevenick
Copy link
Collaborator

Ah, nope that was a mistake. There is an API for this, so I've sized & milestoned it

@Bharathkumarraju
Copy link

@mleonhard when can this be available in tf code?

@canatella
Copy link

Here is the code for a module I created to do that using the firebase CLI. It's far from perfect, sometimes I need to apply multiple times, but it does the job: https://gist.github.com/canatella/121eab76622679b477bfdb0e19fd99b2

This is how I use it:

provider "google" {
  alias = "user"
  scopes = [
    "https://www.googleapis.com/auth/cloud-platform",
    "https://www.googleapis.com/auth/userinfo.email",
  ]
}

data "google_client_config" "default" {
  provider = google.user
}

data "google_service_account_access_token" "default" {
  provider               = google.user
  target_service_account = "something@foobar.iam.gserviceaccount.com"
  scopes                 = ["userinfo-email", "cloud-platform"]
  lifetime               = "3600s"
}

provider "google" {
  access_token = data.google_service_account_access_token.default.access_token
}

module "android_app" {
  source               = "./../firebase-app"
  firebase_admin_token = data.google_service_account_access_token.default.access_token
  project              = google_app_engine_application.hopper.project
  platform             = "android"
  bundle               = "com.foobar"
  name                 = "My application"
}

@Bharathkumarraju
Copy link

@canatella thank you let me test it as well.

@tylerg-dev
Copy link

FYI: Android App is available in the google-beta provider now: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/firebase_android_app

@wyardley
Copy link

I think this can probably be closed now, right?

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement size/m tpgtools Issues related to the tpgtools generator
Projects
None yet
Development

No branches or pull requests

6 participants