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

Cloud Storage for Firebase provider #6899

Merged
merged 4 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
rainshen49 marked this conversation as resolved.
Show resolved Hide resolved
}

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