I'm reading about the underpinnings of providers in Terraform. In my case I have two attributes as part of a resource which changes the power state of a server. They are desired_power_action
and the other is power_state
. desired_power_action
could be something like FORCE_OFF
. After the completion of this action I expect the power_state
to be off
.
desired_power_action
is a required field and power_state
is a computed field. As I understand it, in the plan phase it will project desired_power_action
to be whatever the user picks. Indeed, in my provider I simply set it to whatever the user said they wanted it to be as it is only what they desire it be set to. However for power_state
I'm not sure how to tell Terraform in my provider code that if the user sets desired_power_action
to FORCE_OFF
then the projected value of power_state
is then off
.
I know how to set that value at apply time but how do I tell Terraform at plan time power_state
should be XXXXXX after application?
Or am I misunderstanding and this isn't something I need to do?
(known after apply)
in the plan output to the terminal. Are you seeing some other issue here? – ydaetskcoR