This message was deleted.
# azure
s
This message was deleted.
t
b
my question is rather how to loop through the resource_name
data *=* conf.require_object("data")
bla *=* data.get("nums")
*for* x *in* bla:
sa_account *=* azure.storage.Account(
resource_name*=*,
resource_group_name*=*resource_group.name,
location*=*resource_group.location,
allow_blob_public_access*=*False,
is_hns_enabled*=*True,
account_kind*=*"StorageV2",
account_tier*=*"Standard",
min_tls_version*=*"TLS1_2",
enable_https_traffic_only*=*True,
account_replication_type*=*"GRS",
tags*=*{
"environment": "dev",
}
)
i would expect simply x, but i get a
IndentationError: expected an indented block
on this
and bla is
['sanmlps', 'sanmsds', 'sansdsd']
s
At least indentation error sounds legit in python based on what you pasted? you need to indent
sa_account = ...
b
Ok, can you give a example based on my code?
What i want to know is how to properly iterate using python lang in combination with an pulumi resource
In terraform iteration is very easy through complex objects, but i dont know how pulumi resources deal with it
@sparse-park-68967, @tall-librarian-49374 thanks for your comment
*for* x *in* bla:
sa_account *=* azure.storage.Account(
resource_name*=*x,
resource_group_name*=*resource_group.name,
location*=*resource_group.location,
allow_blob_public_access*=*False,
is_hns_enabled*=*True,
account_kind*=*"StorageV2",
account_tier*=*"Standard",
min_tls_version*=*"TLS1_2",
enable_https_traffic_only*=*True,
account_replication_type*=*"GRS",
tags*=*{
"environment": "dev",
}
)
fixed the indent indeed.. this is my first encounter with pulumi and python as well
gotta get familiar with the rules 🙂
as i understand tab/spaces are actually part of the language itself right
s
Good to hear! Welcome to python…