Skip to content

Commit d41853b

Browse files
roaks3Dawid212
authored andcommitted
Clarify recommendation for simple map types (GoogleCloudPlatform#13551)
1 parent 3a05aae commit d41853b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/content/develop/add-fields.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ Replace `String` in the field type with one of the following options:
167167
key_name: 'KEY_NAME'
168168
key_description: |
169169
MULTILINE_KEY_FIELD_DESCRIPTION
170+
# Map of primitive values
171+
value_type:
172+
name: mapIntegerName
173+
type: Integer
174+
175+
# Map of complex values
170176
value_type:
171177
name: mapObjectName
172178
type: NestedObject
@@ -177,7 +183,7 @@ Replace `String` in the field type with one of the following options:
177183
MULTI_LINE_FIELD_DESCRIPTION
178184
```
179185
180-
This type is only used for string -> complex type mappings, use "KeyValuePairs" for simple mappings. Complex maps can't be represented natively in Terraform, and this type is transformed into an associative array (TypeSet) with the key merged into the object alongside other top-level fields.
186+
This type is used for general-case string -> non-string type mappings, use "KeyValuePairs" for string -> string mappings. Complex maps can't be represented natively in Terraform, and this type is transformed into an associative array (TypeSet) with the key merged into the object alongside other top-level fields.
181187
182188
For `key_name` and `key_description`, provide a domain-appropriate name and description. For example, a map that references a specific type of resource would generally use the singular resource kind as the key name (such as "topic" for PubSub Topic) and a descriptor of the expected format depending on the context (such as resourceId vs full resource name).
183189

0 commit comments

Comments
 (0)