-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
Description
Version: 0.3.1
After this change 7290218#diff-c09d00f135e3672d079ff6e0556d957d deletion of the module fails with
Error: Invalid index
on .terraform/modules/remote_state/terraform-aws-remote-state-s3-backend-0.3.1/outputs.tf line 23, in output "terraform_iam_policy":
23: value = var.terraform_iam_policy_create ? aws_iam_policy.terraform[0] : null
|----------------
| aws_iam_policy.terraform is empty tuple
The given key does not identify an element in this collection value.
Before that change nothing was accessed by index.
Looks like changing output to this fixes the error
output "terraform_iam_policy" {
description = "The IAM Policy to access remote state environment."
value = var.terraform_iam_policy_create ? (
length(aws_iam_policy.terraform) == 0 ? null : aws_iam_policy.terraform[0]
) : null
}
Reactions are currently unavailable