Skip to content

Commit

Permalink
Cloud Storage for Firebase provider (GoogleCloudPlatform#6899)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainshen49 authored and hao-nan-li committed Dec 6, 2022
1 parent 88004bd commit 4b3f11c
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
52 changes: 52 additions & 0 deletions mmv1/products/firebasestorage/api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2022 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
!ruby/object:Api::Product
name: FirebaseStorage
display_name: Cloud Storage for Firebase
versions:
- !ruby/object:Api::Product::Version
name: beta
base_url: https://firebasestorage.googleapis.com/v1beta/
scopes:
- https://www.googleapis.com/auth/cloud-platform
objects:
- !ruby/object:Api::Resource
name: "Bucket"
min_version: beta
base_url: projects/{{project}}/buckets
self_link: projects/{{project}}/buckets/{{bucket_id}}
create_url: projects/{{project}}/buckets/{{bucket_id}}:addFirebase
delete_url: projects/{{project}}/buckets/{{bucket_id}}:removeFirebase
delete_verb: :POST
description: |
An association between a Firebase project and a Google Cloud Storage bucket.
This association enables integration of Cloud Storage buckets with Firebase such as Firebase SDKS, Authentication, and Security Rules.
input: true # Does not support update operation. There is nothing to update.
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
"Official Documentation": "https://firebase.google.com/docs/storage/"
api: "https://firebase.google.com/docs/reference/rest/storage/rest/v1beta/projects.buckets"
parameters:
- !ruby/object:Api::Type::String
name: bucket_id
description: Required. Immutable. The ID of the underlying Google Cloud Storage bucket
input: true
url_param_only: true
properties:
- !ruby/object:Api::Type::String
name: name
pattern: projects/{{project}}/buckets/{{bucket_id}}
description: Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID
output: true
26 changes: 26 additions & 0 deletions mmv1/products/firebasestorage/terraform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2022 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

--- !ruby/object:Provider::Terraform::Config
overrides: !ruby/object:Overrides::ResourceOverrides
Bucket: !ruby/object:Overrides::Terraform::ResourceOverride
import_format: ['projects/{{project}}/buckets/{{bucket_id}}','{{project}}/{{bucket_id}}']
examples:
- !ruby/object:Provider::Terraform::Examples
name: "firebasestorage_bucket_basic"
min_version: "beta"
primary_resource_id: "default"
vars:
bucket_id: test_bucket
test_env_vars:
project_id: :PROJECT_NAME
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "google_storage_bucket" "default" {
provider = google-beta
name = "<%= ctx[:vars]['bucket_id'] %>"
location = "US"
uniform_bucket_level_access = true
}

resource "google_firebase_storage_bucket" "default" {
provider = google-beta
project = "<%= ctx[:test_env_vars]['project_id'] %>"
bucket_id = google_storage_bucket.default.id
}

0 comments on commit 4b3f11c

Please sign in to comment.