Skip to content

Commit

Permalink
Add pre-read for importing log view from previous versions (#11090)
Browse files Browse the repository at this point in the history
  • Loading branch information
trodge committed Jul 18, 2024
1 parent 60d6f43 commit 38da737
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions mmv1/products/logging/LogView.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ examples:
skip_docs: true
custom_code: !ruby/object:Provider::Terraform::CustomCode
encoder: templates/terraform/encoders/logging_log_view.go.erb
pre_read: templates/terraform/pre_read/logging_log_view.go.erb
parameters:
- !ruby/object:Api::Type::String
name: parent
Expand Down
19 changes: 19 additions & 0 deletions mmv1/templates/terraform/pre_read/logging_log_view.go.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<%- # the license inside this block applies to this file
# Copyright 2024 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.
-%>
resourceLoggingLogViewEncoder(d, nil, nil)
url, err = tpgresource.ReplaceVars(d, config, "{{LoggingBasePath}}{{parent}}/locations/{{location}}/buckets/{{bucket}}/views/{{name}}")
if err != nil {
return err
}

0 comments on commit 38da737

Please sign in to comment.