cloudposse / terraform-aws-efs-backup

Terraform module designed to easily backup EFS filesystems to S3 using DataPipeline
https://cloudposse.com/accelerate
Apache License 2.0
43 stars 33 forks source link

Error: Missing resource instance key #41

Open apxela opened 5 years ago

apxela commented 5 years ago

Hello,

I want to do some tests with terraform-aws-efs-backup module in version 0.9.0. I have this code: `module "efs_backup" { source = "git::https://github.com/cloudposse/terraform-aws-efs-backup.git?ref=master"

name = "${var.name}" stage = "${var.stage}" namespace = "${var.namespace}" vpc_id = "${var.vpc_id}" efs_mount_target_id = "${var.efs_mount_target_id}" use_ip_address = "false" noncurrent_version_expiration_days = "${var.noncurrent_version_expiration_days}" ssh_key_pair = "${var.ssh_key_pair}" datapipeline_config = "${var.datapipeline_config}" modify_security_group = "true" }

output "efs_backup_security_group" { value = "${module.efs_backup.security_group_id}" } with these variables: variable "name" { default = "jira-efs" }

variable "stage" { default = "stage" }

variable "namespace" { default = "namespace" }

variable "vpc_id" { default = "vpc-02c0d010183c3c1ce" }

variable "efs_mount_target_id" { default = "fs-2c057de4" }

variable "noncurrent_version_expiration_days" { default = "30" }

variable "ssh_key_pair" {}

variable "datapipeline_config" { type = "map" default = { instance_type = "t2.micro" email = "" period = "24 hours" timeout = "60 Minutes" } }`

when I launched terraform plan I got this error multiple times with all the attributes:

`Error: Missing resource instance key

on .terraform/modules/efs_backup.backups_label/outputs.tf line 2, in output "id": 2: value = "${null_resource.default.triggers.id}"

Because null_resource.default has "count" set, its attributes must be accessed on specific instances.

For example, to correlate with indices of a referring resource, use: null_resource.default[count.index]`

I am pretty new with terraform, so probably I am missing something, but after readinng some posts I think it could be related with the new version of terrform (I am using version 0.12).

Thank you very much for your work!

Regards