cloudposse / terraform-aws-ec2-ami-backup

Terraform module for automatic & scheduled AMI creation
https://cloudposse.com/accelerate
Other
23 stars 29 forks source link

Resource not found #17

Open splio-kjoyeux opened 5 years ago

splio-kjoyeux commented 5 years ago

Hello,

I'm facing this issue using the last version of the module.

* module.ec2-ami-backup.aws_lambda_function.ami_cleanup: 1 error(s) occurred:

* module.ec2-ami-backup.aws_lambda_function.ami_cleanup: Resource 'aws_iam_role.ami_backup' not found for variable 'aws_iam_role.ami_backup.arn'
* module.ec2-ami-backup.aws_iam_role_policy.ami_backup: 1 error(s) occurred:

* module.ec2-ami-backup.aws_iam_role_policy.ami_backup: Resource 'aws_iam_role.ami_backup' not found for variable 'aws_iam_role.ami_backup.id'
* module.ec2-ami-backup.aws_lambda_function.ami_backup: 1 error(s) occurred:

* module.ec2-ami-backup.aws_lambda_function.ami_backup: Resource 'aws_iam_role.ami_backup' not found for variable 'aws_iam_role.ami_backup.arn'

Module has been invoked as such:

module "ec2-ami-backup" {
  source           = "cloudposse/ec2-ami-backup/aws"
  version          = "0.4.1"
  name             = "aws-par-prod-gitlab-nfs-backup"
  stage            = "${var.env}"
  namespace        = "aws-par-prod-gitlab-nfs-backup"
  region           = "${var.region}"
  ami_owner        = "xxxxx"
  instance_id      = "${aws_instance.gitlab-nfs.id}"
  retention_days   = "10"
  backup_schedule  = "cron(00 1 * * * *)"
  cleanup_schedule = "cron(00 6 * * * *)"
}

Do you have any ideas guys ?

Thanks.

Sincerely,

okgolove commented 5 years ago

The same problem.

okgolove commented 5 years ago

@splio-kjoyeux for me it didn't work because of name length. I had an error:

Error: Error running plan: 1 error occurred:
        * module.ad.module.ad-dc_backup.aws_iam_role.ami_backup: "name" cannot be longer than 64 characters