Skip to content

Commit

Permalink
Added tag value resource
Browse files Browse the repository at this point in the history
  • Loading branch information
melinath committed Mar 18, 2021
1 parent a93f748 commit 2a9e92c
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 1 deletion.
56 changes: 56 additions & 0 deletions mmv1/products/tags/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,59 @@ objects:
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
output: true
- !ruby/object:Api::Resource
name: 'TagValue'
min_version: beta
base_url: tagValues
self_link: "tagValues/{{name}}"
update_verb: :PATCH
update_mask: true
description: A TagValue is a child of a particular TagKey. TagValues are used to group cloud resources for the purpose of controlling them using policies.
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation':
'https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing'
api: 'https://cloud.google.com/resource-manager/reference/rest/v3/tagValues'
properties:
- !ruby/object:Api::Type::String
name: name
description: |
The generated numeric id for the TagValue.
output: true
- !ruby/object:Api::Type::String
name: parent
description: |
Input only. The resource name of the new TagValue's parent. Must be of the form tagKeys/{tag_key_id}.
input: true
required: true
- !ruby/object:Api::Type::String
name: shortName
description: |
Input only. User-assigned short name for TagValue. The short name should be unique for TagValues within the same parent TagKey.
The short name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.
input: true
required: true
- !ruby/object:Api::Type::String
name: namespacedName
description: |
Output only. Namespaced name of the TagValue. Will be in the format {organizationId}/{tag_key_short_name}/{shortName}.
output: true
- !ruby/object:Api::Type::String
name: description
description: |
User-assigned description of the TagValue. Must not exceed 256 characters.
- !ruby/object:Api::Type::String
name: createTime
description: |
Output only. Creation time.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
output: true
- !ruby/object:Api::Type::String
name: updateTime
description: |
Output only. Update time.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
output: true
18 changes: 17 additions & 1 deletion mmv1/products/tags/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,26 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "tag_key_basic"
min_version: 'beta'
skip_vcr: true
skip_test: true
primary_resource_id: "key"
vars:
short_name: "foo"
test_env_vars:
org_id: :ORG_ID
TagValue: !ruby/object:Overrides::Terraform::ResourceOverride
autogen_async: true
mutex: tagValue/{{parent}}
id_format: "tagValues/{{name}}"
import_format: ["tagValues/{{name}}", "{{name}}"]
properties:
name: !ruby/object:Overrides::Terraform::PropertyOverride
custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb'
examples:
- !ruby/object:Provider::Terraform::Examples
name: "tag_value_basic"
min_version: 'beta'
primary_resource_id: "value"
vars:
short_name: "foo"
test_env_vars:
org_id: :ORG_ID
15 changes: 15 additions & 0 deletions mmv1/templates/terraform/examples/tag_value_basic.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "google_tags_tag_key" "key" {
provider = google-beta

parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>"
short_name = "keyname"
description = "For a certain set of resources."
}

resource "google_tags_tag_value" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta

parent = "tagKeys/${google_tags_tag_key.key.name}"
short_name = "<%= ctx[:vars]['short_name'] %>"
description = "For <%= ctx[:vars]['short_name'] %> resources.""
}

0 comments on commit 2a9e92c

Please sign in to comment.