opentofu/internal/command/views
Liam Cervante 4d837df546
Plannable import: Add generated config to JSON and human-readable plan output (#33154)
* command: keep our promises

* remove some nil config checks

Remove some of the safety checks that ensure plan nodes have config attached at the appropriate time.

* add GeneratedConfig to plan changes objects

Add a new GeneratedConfig field alongside Importing in plan changes.

* add config generation package

The genconfig package implements HCL config generation from provider state values.

Thanks to @mildwonkey whose implementation of terraform add is the basis for this package.

* generate config during plan

If a resource is being imported and does not already have config, attempt to generate that config during planning. The config is generated from the state as an HCL string, and then parsed back into an hcl.Body to attach to the plan graph node.

The generated config string is attached to the change emitted by the plan.

* complete config generation prototype, and add tests

* Plannable import: Add generated config to json and human-readable plan output

---------

Co-authored-by: Katy Moe <katy@katy.moe>
2023-05-11 08:50:03 +02:00
..
json Plannable import: Add generated config to JSON and human-readable plan output (#33154) 2023-05-11 08:50:03 +02:00
testdata/show cli: Migrate show command to use command arguments and views 2022-01-13 11:00:03 -06:00
apply_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
apply.go Revert "Plannable import: Make the streamed logs more consistent during a plan operation (#33155)" 2023-05-10 11:00:45 +02:00
hook_count_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
hook_count.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
hook_json_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
hook_json.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
hook_ui_test.go Revert "Plannable import: Make the streamed logs more consistent during a plan operation (#33155)" 2023-05-10 11:00:45 +02:00
hook_ui.go Revert "Plannable import: Make the streamed logs more consistent during a plan operation (#33155)" 2023-05-10 11:00:45 +02:00
json_view_test.go [Plannable Import] Implement streamed logs for plan (#33106) 2023-05-04 10:02:06 +02:00
json_view.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
operation_test.go [Plannable Import] Implement streamed logs for plan (#33106) 2023-05-04 10:02:06 +02:00
operation.go [Plannable Import] Implement streamed logs for plan (#33106) 2023-05-04 10:02:06 +02:00
output_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
output.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
plan_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
plan.go Revert "Plannable import: Make the streamed logs more consistent during a plan operation (#33155)" 2023-05-10 11:00:45 +02:00
refresh_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
refresh.go Revert "Plannable import: Make the streamed logs more consistent during a plan operation (#33155)" 2023-05-10 11:00:45 +02:00
show_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
show.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
state_locker.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
test_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
validate_test.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
validate.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
view.go [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00