-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Add terraform query
subcommand (TF-25494)
#37174
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
base: main
Are you sure you want to change the base?
Conversation
69f538d
to
5964722
Compare
5964722
to
788a724
Compare
518bd67
to
4ff576a
Compare
ee5b81f
to
0d9f62d
Compare
788a724
to
ad7d289
Compare
0d9f62d
to
b0a7c2e
Compare
ad7d289
to
5651d47
Compare
5651d47
to
b23cd80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some very early thoughts that jumped out to me - don't need to be addressed properly yet or anything.
|
||
ProviderAddr addrs.AbsProviderConfig | ||
|
||
Results cty.Value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results cty.Value | |
Results []cty.Value |
Since this must be a slice / tuple - is it perhaps more clear to just not include that part in the cty encoding? This makes it totally unambiguous that this is a list of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we're storing the result in the following form:
cty.ObjectVal(map[string]cty.Value{"data": cty.TupleVal(results), "config": config})
This matches the schema and makes encoding/decoding easy, but I guess we really only need the tuple val in the plan 🤔
|
||
ProviderAddr addrs.AbsProviderConfig | ||
|
||
Results cty.Value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metanote: because of the way things might change over time this may eventually become a list of structs in which one of the things that it might contain is the value. We might add some metadata about the query results (like you see in the ResourceInstanceChange
for example.
This representation can change as it likes (as it is internal only) but eventually this will go into the jsonplan
package which has to be more backwards compatible. At that point - I'd pre-emptively add this into a json object instead of just adding the value directly. This makes it easier to add metadata in the future, as it wouldn't be a breaking change.
You could also do that here as well, to keep the internal and external representations closer together. But, that is totally optional for here, but definitely something you should consider for the external representation.
WIP
Target Release
1.13.x
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry