This function finds all data sources created by a specific provider in the Terraform configuration of the current plan's workspace using the tfconfig/v2 import.
This function is contained in the tfconfig-functions.sentinel module.
find_datasources_by_provider = func(provider)
- provider: the provider of data sources to find, given as a string.
None
This function returns a single flat map of data sources indexed by the complete addresses of the data sources (excluding indices representing their counts). The map is actually a filtered sub-collection of the tfconfig.resources
collection.
This function does not print anything.
Here are some examples of calling this function, assuming that the tfconfig-functions.sentinel file that contains it has been imported with the alias config
:
allAWSDatasources = config.find_datasources_by_provider("aws")
allAzureDatasources = config.find_datasources_by_provider("azurerm")
allGoogleDatasources = config.find_datasources_by_provider("google")
allVMwareDatasources = config.find_datasources_by_provider("vsphere")