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

Clarify recommendation for simple map types #13551

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/content/develop/add-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ Replace `String` in the field type with one of the following options:
key_name: 'KEY_NAME'
key_description: |
MULTILINE_KEY_FIELD_DESCRIPTION
# Map of primitive values
value_type:
name: mapIntegerName
type: Integer

# Map of complex values
value_type:
name: mapObjectName
type: NestedObject
Expand All @@ -177,7 +183,7 @@ Replace `String` in the field type with one of the following options:
MULTI_LINE_FIELD_DESCRIPTION
```

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.
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.

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).

Expand Down
Loading