Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition creating delivery_channel before S3 bucket has been created #8

Open
adborden opened this issue Jun 8, 2021 · 0 comments

Comments

@adborden
Copy link

adborden commented Jun 8, 2021

I'm using grace-config with grace-logging and I ran into an error where the bucket does not exist. I've lost the Terraform output, but I saw the delivery_channel was being modified before the bucket creation had started and Terraform failed because the bucket name does not exist. Re-running terraform apply worked the second time because the bucket had been created by then.

It looks like you have an undocumented module_depends_on, could that be used to work-around the issue? I remember that terraform modules had some issues declaring dependencies on each other. Not sure if there's a better solution with the recent release of 1.0.

module "config" {
  providers = {
    aws = aws.child
  }

  source                        = "github.com/GSA/grace-config?ref=v0.0.3"
  bucket                        = "gsa-tts-grace-config-logging-${var.name}"
  config_snapshot_frequency     = "TwentyFour_Hours"
  iam_inactive_credentials_days = "365"
  access_key_expiration_days    = "365"
  #module_depends_on             = module.logging.aws_s3_bucket.logging
}

module "logging" {
  providers = {
    aws = aws.child
  }

  source                     = "github.com/GSA/grace-logging?ref=v0.0.11"
  access_logging_bucket_name = "gsa-tts-grace-config-access-${var.name}"
  cloudtrail_name            = "gsa-tts-wide"
  logging_bucket_name        = "gsa-tts-grace-config-logging-${var.name}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant