binbashar / terraform-aws-vpc-flowlogs

Terraform module which creates VPC flow logs to S3 on AWS https://registry.terraform.io/modules/binbashar/vpc-flowlogs
MIT License
4 stars 14 forks source link

Error re-deploying network layer caused trying to destroy existent s3 bucket #13

Closed mvago-flx closed 2 years ago

mvago-flx commented 2 years ago

Describe the Bug

When we try to re-apply the network layer, fails on creating s3 bucket. The s3 bucket already exists

Expected Behavior

Delete or reuse existent bucket

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to '...' network layer on terraform-aws-vpc-flowlogs
  2. Run '....' leverage run init & leverage run apply
  3. Enter '....'
  4. See error image

Environment (please complete the following information):

leverage, version 1.7.2

Anything that will help us triage the bug will help. Here are some ideas:

Additional Context

Possible solutions 1- hacer q al bucket name lo obtenga desde el modulo q lo crea; de ese modo TF se daria cuenta q primero tiene q aplicar el modulo q crea el bucket y luego cualquier otro recurso q use el bucket 2- usar depends_on, como dijo Exe, para indicarle explicitamente a TF q tiene q respetar un orden de creacion

exequielrafaela commented 2 years ago

@lgallard let's consider what we've discussed with @diego-ojeda-binbash and @mvago-flx to fix this:

Consider S3 terraform module as reference => https://github.com/binbashar/terraform-aws-s3-bucket

exequielrafaela commented 2 years ago

@mvago-flx thanks for reporting this issue and all your collaboration to solve it, keep it rocking! 🎸. Leaving below the reference PRs that actually solved the issue.

ps. Special thanks to @diego-ojeda-binbash and @lgallard 🙏🏼 🚀

CC: @binbashar/leverage-project-terraform-admin @binbashar/leverage-project-terraform-dev