chalice icon indicating copy to clipboard operation
chalice copied to clipboard

`null_data_source` is depricated in Terraform

Open jessebrennan opened this issue 3 years ago • 2 comments

chalice --version
chalice 1.26.4, python 3.8.3, linux 5.11.0-41-generic
terraform --version
Terraform v1.0.11
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.72.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/template v2.2.0

Your version of Terraform is out of date! The latest version
is 1.1.4. You can update by downloading from https://www.terraform.io/downloads.html

If I run terraform validate on the TF output from Chalice I get:

terraform validate
╷
│ Warning: Deprecated Resource
│ 
│   with module.chalice.data.null_data_source.chalice,
│   on chalice/chalice.tf.json line 99, in data.null_data_source.chalice:
│   99:             }
│ 
│ The null_data_source was historically used to construct intermediate values to re-use elsewhere in configuration, the same can now be achieved using locals
╵
Success! The configuration is valid, but there were some validation warnings as shown above.

jessebrennan avatar Jan 21 '22 18:01 jessebrennan

I noticed that chalice 1.26.5 addresses Terraform related issues. I just tested with that version of Chalice, but Terraform still emits the warning.

jessebrennan avatar Jan 21 '22 18:01 jessebrennan

Yeah the issue is that that null data source provides values that existing Chalice apps might be using in their existing tf templates so removing that provider would break their deployments. I think our best option until a v2.0 is to add a config option that tells chalice to generate the tf template without the null data source.

jamesls avatar Jan 24 '22 17:01 jamesls