Skip to content

Commit

Permalink
Add IAM resources for Cloud Deploy Target (#9927)
Browse files Browse the repository at this point in the history
* Add IAM resources for Cloud Deploy Target

* update

* add back import_format
  • Loading branch information
nownabe committed Feb 23, 2024
1 parent 77453ca commit 39bd019
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
40 changes: 40 additions & 0 deletions mmv1/products/clouddeploy/Target.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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.

--- !ruby/object:Api::Resource
name: 'Target'
description: |
The Cloud Deploy `Target` resource.
base_url: 'projects/{{project}}/locations/{{location}}/targets'
self_link: 'projects/{{project}}/locations/{{location}}/targets/{{name}}'
exclude_resource: true
id_format: 'projects/{{project}}/locations/{{location}}/targets/{{name}}'
import_format:
- 'projects/{{project}}/locations/{{location}}/targets/{{name}}'
iam_policy: !ruby/object:Api::Resource::IamPolicy
parent_resource_attribute: 'name'
method_name_separator: ':'
base_url: 'projects/{{project}}/locations/{{location}}/targets/{{name}}'
import_format: ['projects/{{project}}/locations/{{location}}/targets/{{name}}', '{{name}}']
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'clouddeploy_target_basic'
primary_resource_id: 'default'
primary_resource_name: 'fmt.Sprintf("tf-test-cd-target%s", context["random_suffix"])'
vars:
target: 'cd-target'
properties:
- !ruby/object:Api::Type::String
name: "name"
description: "Dummy property."
required: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "google_clouddeploy_target" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['target'] %>"
location = "us-central1"
}

0 comments on commit 39bd019

Please sign in to comment.