-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Deprecation Warning For Outputs #36016
base: main
Are you sure you want to change the base?
Conversation
The reason we don't have deprecation warnings in outputs is really the same reason we don't have deprecation warnings for resource attributes, there is no way to track value provenance. The approach taken here will flag every use of the module value as triggering the deprecation, rather than just use of the deprecated output value. When references are evaluated in Terraform, they are always evaluated by getting the entire container of values because any indices need to be evaluated as part of the larger expression. So when you reference a module output, you actually obtain an object containing all outputs; and further if the module is expanded, you get a container of all module objects. The easiest problem to see may be a reference like this:
The base reference is to the entire tuple of module objects ( There are a lot of other similar use cases, like passing module object around as arguments themselves should not trigger deprecation warnings if the deprecated output values are never used. |
1a9eda2
to
6fa3566
Compare
6fa3566
to
f64dd2d
Compare
In this PR @DanielMSchmidt and I take a first stab at #18381 and add a new attribute to the
output
block to allow it to be marked as deprecated.UX
If this is the right approach, my suggestion would be to deal with the deprecation of inputs in a separate PR.
Partially resolves #18381
Target Release
1.11.x