Hi everyone,
I am trying to generate Azure Loadbalancer Backend Pool Addresses, but I cannot seem to find the object to do that with.
I can see an LbBackendAddressPool object, but no direct way of adding any backend ip configuration settings. I do see a @builtins.property ‘backend_ip_configurations’, but no reference in init for the LbBackendAddressPool object, or a corresponding object.
Am I missing something, or do I need to use the escape hatch?
Kind regards,
Thomas Schockaert
I’m not familiar with the specific resources, but looking at the Terraform documentation, I’d expect there to be a LbBackendAddressPoolAddress
type.
I’m thinking more in the direction of how the frontend_ip_configuration is done for the loadbalancer resource: you pass in a list of LbFrontEndIPConfiguration objects - that part does work.
I’d expect an LbBackendAddressPoolBackendIpConfigurations object because I can see the following object defined in the cdktf generated code for Azure: DataAzurermLbBackendAddressPoolBackendIpConfigurations.
The class DataAzurermLbBackendAddressPool references that one, but I’m as of yet unsure about the difference between the DataAzurerm* classes and their counterparts without the ‘DataAzurerm’ prefix.
For this: ‘DataAzurermLbBackendAddressPool’, there is an ‘LbBackendAddressPool’.
For this: ‘DataAzurermLbBackendAddressPoolBackendIpConfigurations’, there seems to be no ‘LbBackendAddressPoolBackendIpConfigurations’.
I don’t know if that’s a bug, or if I’m just not understanding certain things about how cdktf does its thing.
–
Thomas
I found some Azure documentation and it seems like backend ip configuration just works differently than for frontend.
A data source (DataAzurerm
prefix) is basically just a way to look up data about existing infrastructure.
I can’t say for certain why the terminology for the returned backend address pool data is what it is, but the Azure api returns it that way, so Terraform exposes it.
Indeed, that seems to be the case: I should have a LbBackendAddressPoolAddress class in the generated init.py file, but it is not there.
I checked the provider version, and sure enough, apparently I was using an older version (2.0.0) - probably from the example on github. Once I set that to the latest version for azurerm, the object showed up.