I am getting following error with Terraform after upgrading to 0.13
Error: Invalid depends_on reference on modules/iam/outputs.tf line 10, in output "config": 7: aws_iam_role_policy_attachment.eks_worker_node.policy_arn,
References in depends_on must be to a whole object (resource, etc), not to an attribute of an object. This error persist on all line from 7-11. Below is the output file from IAM module:
output "config" {
value = {
service_role = aws_iam_role.eks_service_role.name
node_role = aws_iam_role.eks_node.name
}
depends_on = [
aws_iam_role_policy_attachment.eks_worker_node.policy_arn,
aws_iam_role_policy_attachment.eks_cni.policy_arn,
aws_iam_role_policy_attachment.ecr.policy_arn,
aws_iam_role_policy_attachment.eks_service_policy.policy_arn,
aws_iam_role_policy_attachment.eks_cluster_policy.policy_arn,
]
}