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

Deprecation messages for data source attributes do not show in terraform plan #35454

Closed
maastha opened this issue Jul 14, 2024 · 3 comments
Closed
Labels
duplicate issue closed because another issue already tracks this problem enhancement

Comments

@maastha
Copy link

maastha commented Jul 14, 2024

Terraform Version

Terraform v1.9.2
on darwin_arm64
+ provider registry.terraform.io/mongodb/mongodbatlas v1.17.0

Terraform Configuration Files

data "mongodbatlas_advanced_cluster" "replicasetMultiCloud" {
	project_id = mongodbatlas_advanced_cluster.replicasetMultiCloud.project_id
	name 	     = mongodbatlas_advanced_cluster.replicasetMultiCloud.name
}

output "repSpecIDReplicaset" {
  value = data.mongodbatlas_advanced_cluster.replicasetMultiCloud.replication_specs[0].id  //This `id` attribute has been marked as deprecated in the schema
}

Debug Output

https://gist.github.com/maastha/5af8c7b6b789489af75195b89f118532

Expected Behavior

Terraform should show deprecation warnings for attributes in data sources that are marked as Deprecated in the schema if they are being referenced in Terraform configuration files similar to resource attribute deprecations.

Actual Behavior

No deprecation message is shown if outputting a deprecated attribute from the data source.

Steps to Reproduce

terraform init
terraform apply

Additional Context

We are working on deprecating some attributes for a resource & it's corresponding data source in our provider. The resource & data source are based in Plugin SDKv2.
During testing we noticed that any attribute marked as deprecated in the data source does not show a deprecation warning even if that attribute is being referenced in terraform config whereas deprecation in resource for all attributes works as expected and user can see a deprecation warning.

References

No response

@jbardin
Copy link
Member

jbardin commented Jul 15, 2024

Hi @maastha,

Thanks for filing the issue. The deprecation message for computed attributes currently only serves as documentation, so Terraform is working as designed in this instance. Terraform does not have the needed metadata necessary to provide the warning when the resource value is being evaluated elsewhere in the configuration.

Thanks

@jbardin jbardin added enhancement and removed bug labels Jul 15, 2024
@jbardin
Copy link
Member

jbardin commented Jul 15, 2024

Duplicate of #7569

@jbardin jbardin marked this as a duplicate of #7569 Jul 15, 2024
@jbardin jbardin closed this as completed Jul 15, 2024
@crw crw added duplicate issue closed because another issue already tracks this problem and removed new new issue not yet triaged labels Jul 15, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate issue closed because another issue already tracks this problem enhancement
Projects
None yet
Development

No branches or pull requests

3 participants