rough-pilot-49913
11/20/2023, 9:03 AMpulumi import
to retrieve a main.py file. I've already discovered these resources using the Azure library for Python and created a file like this:
{
"resources": [
{
"name": ...,
"type": ...,
"id": ...
},
{
"name": ...,
"type": ...,
"id": ...
},
...
]
}
After running pulumi import -f file.json -o __main__.py
, I destroy my resources on the cloud and try pulumi up
with the generated script. However, I encounter errors because the deployment of resources doesn't follow the correct dependencies between resources. For instance, a VM with a network card is deployed before the network card. The dependency ID is a string like
vm= azure_native.compute.VirtualMachine("vm_name",
.....,
network_profile=azure_native.compute.NetworkProfileArgs(
network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
id="/subscriptions/..../resourceGroups/...../providers/Microsoft.Network/networkInterfaces/netinterf_name",
....
but I need nameOfResource.id
to make the dependency understandable to Pulumi.
Does anyone know how to automate this process?No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by