Race condition creating delivery_channel before S3 bucket has been created
- Dominant language
- HCL
- Stars
- 4
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
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.
```terraform
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}"
}
```
Contributor guide
Assessment
This issue has not been assessed yet.