handsome-state-59775
03/30/2021, 1:55 AMpulumi_azure_native.storage
, i'm unable to extract account_name
from an StorageAccount
for use in supplying the same field name for FileShare
STORAGE_ACCOUNT_NAME = f'{PREFIX_CLEAN}storage'[:24]
storage_account = az.storage.StorageAccount(
resource_name='storageAccount',
resource_group_name=rg.name,
account_name=STORAGE_ACCOUNT_NAME, # HACK 1
kind=az.storage.Kind.STORAGE_V2,
sku=az.storage.SkuArgs(
name=az.storage.SkuName.STANDARD_LRS,
),
)
file_share = az.storage.FileShare(
resource_name='fileShare',
resource_group_name=rg.name,
# Unable to extract storage_account.account_name:
account_name=STORAGE_ACCOUNT_NAME, # HACK 2
share_name=f'{PREFIX_CLEAN}-share'[:63],
access_tier=az.storage.ShareAccessTier.TRANSACTION_OPTIMIZED,
share_quota=5120,
opts=p.ResourceOptions(
# Workaround for missing storage_account.account_name:
depends_on=[
storage_account, # HACK 3
],
parent=storage_account,
),
)
gentle-diamond-70147
03/30/2021, 3:21 AMaccount_name=storage_account.name
in your FileShare
handsome-state-59775
03/30/2021, 4:14 AM.name
usually maps to the referred resource's resource_name
, right? and every other property has a getter by the same name except this. just trying to understand if there's a pattern that i'm missing heretall-librarian-49374
03/30/2021, 6:27 AMname
.
We build that name
from resource_name
if the specific input property like account_name
is not specified, or from account_name
if it is.