I'm not quite sure how to solve this problem in terraform.
We have an EMR cluster, with some bootstrap actions that are specified as S3 resources. A simplified view of our terraform config is:
resource "aws_s3_bucket_object" "bootstrap_action" {
bucket = "${var.s3_emr_bootstrap_bucket}"
key = "bootstrap"
content = <<EOF
#!/bin/bash
echo "Doing bootstrap actions"
EOF
}
resource "aws_emr_cluster" "emr_cluster" {
...configuration of the EMR cluster...
bootstrap_action {
path = "s3://${aws_s3_bucket_object.bootstrap_action.bucket}/${aws_s3_bucket_object.bootstrap_action.key}"
name = "Bootstrap Step"
}
}
What we'd like to do is make it so that changing the contents of the bootstrap action script cause the cluster to rebuild. Right now we have to manually taint the cluster if this changes.
I have tried using "depends_on", but that just affects ordering, it doesn't actually force a rebuild.
There is some discussion of this issue in: https://github.com/hashicorp/terraform/issues/8099 Reading that I don't see an obvious solution, but figured I'd post a question anyway.