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

Delay availability of bucket ID until bucket is fully configured #228

Open
Nuru opened this issue Apr 15, 2024 · 0 comments
Open

Delay availability of bucket ID until bucket is fully configured #228

Nuru opened this issue Apr 15, 2024 · 0 comments

Comments

@Nuru
Copy link
Sponsor Contributor

Nuru commented Apr 15, 2024

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, and bucket_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 delayed bucket_id is not appropriate.

Alternatives Considered

No response

Additional Context

No response

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