Reputation: 922
I have the following, when I try and run a "terraform plan" it is failing.
data "template_file" "s3_bucket_policy" {
template = "${file("${path.module}/templates/s3_bucket_policy.json")}"
vars = {
bucket_arn = aws_s3_bucket.app_bucket.arn
vpc_endpoint_id = var.vpc_endpoint_id
vpc_tools_endpoint_id = var.vpc_tools_endpoint_id
}
}
The output says Error: Cycle: data.template_file.s3_bucket_policy, aws_s3_bucket.app_bucket
- aws_s3_bucket.app_bucket.arn
was created earlier successfully.
I'd be happy with suggestions on how to troubleshoot!
Upvotes: 0
Views: 651
Reputation: 121
This can happen if your aws_s3_bucket.app_bucket
resource refers to data.template_file.s3_bucket_policy
.
Sharing your entire .tf
file will be helpful.
Upvotes: 1