You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform does not treat modules like black boxes, it incorporates their code and looks at all the code at once. In doing so, any other modules that consume this module's bucket_id output will only wait for the bucket to be created before they start using it. However, in many cases if not most cases, the bucket should not be used in other resources until after it is fully configured with access policies, lifecycle policies, etc. See cloudposse/terraform-aws-cloudtrail-s3-bucket#90 for an example.
Therefore, it would be helpful to delay the availability of bucket_id until after all of the configuration is completed.
Expected Behavior
One would expect that any resource the uses bucket_id would be free to use it once it is provided, and Terraform proceeds as such. However, some uses require certain configuration to be applied before use, and bucket_id is available well before the requested configuration is applied, causing those uses to fail.
bucket_id would be delayed until the bucket is fully configured. Possibly another output (bucket_id_early?) would be provided for use cases where the delayed bucket_id is not appropriate.
Alternatives Considered
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
I observed this just now.
Another alternative is to add an output "done" or "final" or similar that has a static value "true" that depends on all the module's resources. Downstream one can reference this output to make sure the module has been fully deployed.
EDIT: I wrote the above since https://github.com/cloudposse/terraform-aws-cloudtrail-s3-bucket/pull/91/files is supposed to fix this by adding a depends_on referencing the module, but I still experienced the race condition...
EDIT2: I take it back. The cloudtrail module was missing a depends_on cloudtrail_s3_bucket, due to s3_bucket_name being static.
Describe the Feature
Terraform does not treat modules like black boxes, it incorporates their code and looks at all the code at once. In doing so, any other modules that consume this module's
bucket_id
output will only wait for the bucket to be created before they start using it. However, in many cases if not most cases, the bucket should not be used in other resources until after it is fully configured with access policies, lifecycle policies, etc. See cloudposse/terraform-aws-cloudtrail-s3-bucket#90 for an example.Therefore, it would be helpful to delay the availability of
bucket_id
until after all of the configuration is completed.Expected Behavior
One would expect that any resource the uses
bucket_id
would be free to use it once it is provided, and Terraform proceeds as such. However, some uses require certain configuration to be applied before use, andbucket_id
is available well before the requested configuration is applied, causing those uses to fail.Use Case
See cloudposse/terraform-aws-cloudtrail-s3-bucket#90 for an example.
Describe Ideal Solution
bucket_id
would be delayed until the bucket is fully configured. Possibly another output (bucket_id_early
?) would be provided for use cases where the delayedbucket_id
is not appropriate.Alternatives Considered
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: