feat: add Map type#18
Merged
Merged
Conversation
Map(value_type) provides map(string→T) support. Wire format: ["map", <value_type>], matches go-cty encoding. Encode/decode delegate to value_type per value. Handles None and Unknown sentinels like List/Set.
rhencke
added a commit
to rhencke/terraform-provider-terrible
that referenced
this pull request
Mar 24, 2026
…tags/skip_tags
Drops NormalizedJson workaround for structured framework attributes.
Users can now write natural HCL instead of jsonencode():
triggers = { version = var.app_version }
environment = { FOO = "bar" }
tags = ["deploy"]
skip_tags = ["slow"]
Depends on rhencke/tf feat/map-type (upstream PR: hfern/tf#18).
pyproject.toml sources tf from the fork until the PR merges.
This was referenced Mar 24, 2026
github-actions Bot
pushed a commit
to rhencke/terraform-provider-terrible
that referenced
this pull request
Mar 24, 2026
…128) * feat: use Map(String()) for triggers/environment, List(String()) for tags/skip_tags Drops NormalizedJson workaround for structured framework attributes. Users can now write natural HCL instead of jsonencode(): triggers = { version = var.app_version } environment = { FOO = "bar" } tags = ["deploy"] skip_tags = ["slow"] Depends on rhencke/tf feat/map-type (upstream PR: hfern/tf#18). pyproject.toml sources tf from the fork until the PR merges. * docs: update README to reflect current state (uv, dynamic module discovery, features) * refactor: remove gen/ and EphemeralMixin now that tf fork handles 6.9 natively - Delete terrible_provider/gen/ (custom 6.9 proto stubs no longer needed) - Remove EphemeralMixin and _xproto/_xdiags helpers from ephemeral.py - Simplify cli.py to call tf.runner.run_provider() directly (5 lines) - Remove EphemeralMixin tests (behaviour now covered in tf fork test suite) - Clean up pyproject.toml: remove gen/ exclusions from coverage/ruff/ty * chore: point tf dependency at git fork (feat/ephemeral-resources)
Owner
|
Thank you @rhencke for your contribution! 🎉 I've added some docs and a couple of e2e tests. |
hfern
approved these changes
Mar 27, 2026
Contributor
Author
|
Thank you! (tf is fantastic by the way) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Map(value_type)type formap(string→T)Terraform attributes["map", <value_type>]— matches go-cty/OpenTofu encodingencode/decodedelegate tovalue_typeper value, matchingList/SetpatternNoneandUnknownsentinels consistentlytest_types.pyMotivation
Without
Map, the only option for key→value attributes (e.g. environment variables, trigger maps) isNormalizedJson, which forces users to writejsonencode({...})in HCL. WithMap(String())users can write natural HCL:Test plan
test_map_encode— None/Unknown passthrough + encode/decode round-triptest_map_encode_delegates_to_value_type— value_type applied per valuetest_map_type_encoding— tf_type() for String/Number/Bool/nested typestest_map_semantic_equality— dict equality, None/Unknown/empty cases