For resources that are lists, such as Azure FunctionAppIdentity, how do you reference indexes properly in Python? For example:
function = FunctionApp(self, ... identity=[FunctionAppIdentity(type="SystemAssigned")], ...
# this is how you'd ref the identity principal_id in HCL:
# azurerm_function_app.function.identity.0.principal_id
# this errors with raise AttributeError("'%s' object has no attribute '%s'" % (type_info, name))
object_id = function.identity[0].principal_id
There are times where you’ll need to use tokens, but ideally how you’re referencing things should work.
The principal_id property doesn’t exist on the generated FunctionAppIdentity so it isn’t directly referenceable. This is pretty similar to https://github.com/aws/jsii/issues/1841, but is slightly different in that some properties actually do exist for configuration.
If you are still stuck on this, it should be possible to use an escape hatch to reference it.