This module is created to expose the module versions in a Terraform run.
The epp0/environment provider is used to allow you to go splunking through run and environment data.
The main contribution, is a use of the terraform local resource to pull the ./terraform/modules/modules.json
file content as json data that can be utilised with policy enforcement and other features.
see examples folder and default example
the data is exposed as an out put in mock-tfstate-v2.sentinel
outputs = {
...
"modules_json": {
"name": "modules_json",
"sensitive": false,
"value": {
"Modules": [
...
{
"Dir": ".terraform/modules/helloworld",
"Key": "helloworld",
"Source": "registry.terraform.io/briancain/helloworld/aws",
"Version": "2020.4.21",
},
while the mock-tfconfig-v2.sentinel only shows the constraint not the actual module
module_calls = {
...
"source": "briancain/helloworld/aws",
"version_constraint": "> 2020.3",
},
worth noting the raw data is also available in the local resource which parses the file, but that is a much more complex structure to operate over.
Currently maintained by these contributors.
MIT License. See LICENSE for full details.
Name | Version |
---|---|
terraform | >= 1.5 |
environment | 1.3.4 |
Name | Version |
---|---|
environment | 1.3.4 |
local | 2.4.0 |
terraform | n/a |
Name | Source | Version |
---|---|---|
helloworld | briancain/helloworld/aws | 2020.4.21 |
Name | Type |
---|---|
terraform_data.test | resource |
environment_variables.all | data source |
local_file.modules_json | data source |
No inputs.
Name | Description |
---|---|
environment_data_all | All environment variables, derived from Epp0/environment provider |
modules_json | The content of the modules.json file |