-
Notifications
You must be signed in to change notification settings - Fork 74
Description
TLDR
azurerm provider have ben restructured, so that it does no get parsed properly
Description
So apparently Microsoft decided to refactor their azurerm provider with the side-effect that the makecode.py are no longer able to parse any resources or datasources out of it.
After some digging, it seems they;
a) Moved the provider code into azurerm/internal/provider/provider.go (added an extra /provider in path)
b) Build the map of datasources and resources dynamically now:
c) Do this individually in the code for each service: https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/internal/services/appconfiguration/registration.go#L24
I can see how this make sense from a code perspective for them, but it make the current method of generating classes for datasources and resources in terrascript unable to do anything useful.
As a result of this, there is no classes for azurerm currently available in terrascript.
Possible workaround
def custom_data(data_type: str, name: str, *args, **kwargs):
""" Get a terrascript data object of the given type and name
:param data_type:
:param name:
:param args:
:param kwargs:
:return:
"""
return type(data_type, (terrascript.Data,), {})(name, *args, **kwargs)
Questions
- What is the proposed way to handle such situations?
- Does my workaround make sense, or is there a better way?
- Should terrascript have such a helper included (since this is hardly the first nor last time it will happen)?