Variables locals and output


I am trying to sort out a scenario/module where I want to

a. define a variable in file
b. perform some business logic inside using null provider and null_resources block
c. In the null_resource block I want to store the processed output in the variable which I had defined in step 1
d. output the variable in which can in turn be called in other modules

my contains the definition for the variable called as value, it’s of type string and has no default value

this is how my looks
provider "null" { }

resource "null_resource" "get-valuefromfile" {var.value= file("/var/result/value.txt")}

In the file,

    output "valuefromfile" {value = ["${var.value}"]}

Whenever I run this
on line 15, in resource “null_resource” “get-valuefromfile”:
15: var.value= file("/var/result/value.txt")

An argument or block definition is required here. To set an argument, use the
equals sign “=” to introduce the argument value.

I am not able to figure out why value assignment throws up an error
What are the possible ways of accomplishing this.

Going by the same analogy, can I do this inside the null resource block
var.value1 = local.local_variable_lookup_from_a_map1
var.value2 = local.local_variable_lookup_from_a_map2
var.value3 = “{var.value1}{var.value2}”
output var.value3