Hello,
I have following code.
resource "random_id" "this" {
byte_length = 4
}
data "external" "this" {
program = ["/bin/sh", "-c", "./script.sh ${random_id.this.hex}"]
}
# Put result to state
resource "null_resource" "state" {
triggers = {
key = data.external.this.result.key
}
lifecycle {
ignore_changes = [triggers]
}
}
I’m need to run data.external
resource only once due API architecture because second call with same param will fail. Is it possible to do it somehow only during creation of random_id.this
resource?