gray-fall-86820
03/07/2024, 1:15 PM'__main__.py', '.gitignore', 'Pulumi.<stack-name>.yaml', Pulumi.yaml' and requirement.txt file
then I have a folder named 'azure' and inside that folder I have a folder named 'storage' -- both have the files '__init__.py'
in them. In my storage folder I have a 'main.py'
file that has the following content
import pulumi
import pulumi_azure_native as azure_native
config = pulumi.Config()
location = config.require("azure-native:location")
resource_group_name = config.require("azure-project:resourceGroupName")
storage_account_name = config.require("azure-project:storageAccountName")
# Define a resource group
resource_group = azure_native.resources.ResourceGroup(
"resource_group", resource_group_name=resource_group_name, location=location
)
# Create an Azure Storage Account using the name from the config
storage_account = azure_native.storage.StorageAccount(
"storage_account",
account_name=storage_account_name,
resource_group_name=resource_group.name,
location=resource_group.location,
sku=azure_native.storage.SkuArgs(name=azure_native.storage.SkuName.STANDARD_LRS),
kind=azure_native.storage.Kind.STORAGE_V2,
)
# Export the connection string of the storage account
primary_connection_string = pulumi.Output.all(
resource_group.name, storage_account.name
).apply(
lambda args: pulumi_azure_storage.get_storage_account_connection_string(
resource_group_name=args[0], storage_account_name=args[1]
)
)
pulumi.export("primary_connection_string", primary_connection_string)
and my yaml file at the root level has the following content.
config:
azure-native:location: "WestEurope"
dost-azure-project:resourceGroupName: "pulumi-test-dev"
dost-azure-project:storageAccountName: "pulumi-test-storage-account"
dost-azure-project:registryName: "pulumi-test-acr"
Unfortunately, I am getting this error ' error: Missing required configuration variable 'azure-projectazure nativelocation'
To me it seems that my main.py file in the azure/storage folder is not getting the config values from the .yaml file
Basically, what I want to do is to have a structure where I can have e.g. 'storage', 'containerregistry', 'serviceplan', 'database' etc. as module inside a folder called 'azure' using python
Any help/guidance in this regard will be really helpful.witty-battery-28013
03/08/2024, 8:08 AMmelodic-tomato-39005
03/08/2024, 9:47 AMdost-azure-project
but the error message says azure-project
.melodic-tomato-39005
03/08/2024, 9:51 AMgray-fall-86820
03/08/2024, 1:18 PM