예제 #1
0
location = config.get("location") or "WestUS"

resource_group = resources.ResourceGroup("resourceGroup",
    resource_group_name="synapse-rg",
    location=location)

storage_account = storage.StorageAccount("storageAccount",
    resource_group_name=resource_group.name,
    location=resource_group.location,
    account_name="synapsesa",
    access_tier="Hot",
    enable_https_traffic_only=True,
    is_hns_enabled=True,
    kind="StorageV2",
    sku=storage.SkuArgs(
        name="Standard_RAGRS",
    ))

data_lake_storage_account_url = storage_account.name.apply(lambda name: f"https://{name}.dfs.core.windows.net")

users = storage.BlobContainer("users",
    resource_group_name=resource_group.name,
    account_name=storage_account.name,
    container_name="users",
    public_access="None")

workspace = synapse.Workspace("workspace",
    resource_group_name=resource_group.name,
    location=resource_group.location,
    workspace_name="my-workspace",
    default_data_lake_storage=synapse.DataLakeStorageAccountDetailsArgs(
예제 #2
0
username = "******"

config = Config()
pwd = config.require("sqlPassword")

resource_group = resource.ResourceGroup("appservicerg",
                                        resource_group_name="appservicerg",
                                        location="westus2")

storage_account = storage.StorageAccount(
    "appservicesa",
    account_name="appservicesa",
    resource_group_name=resource_group.name,
    kind="StorageV2",
    sku=storage.SkuArgs(name=storage.SkuName.STANDARD_LRS))

app_service_plan = web.AppServicePlan(
    "appservice-asp",
    name="appservice-asp",
    resource_group_name=resource_group.name,
    kind="App",
    sku=web.SkuDescriptionArgs(
        tier="Basic",
        name="B1",
    ))

storage_container = BlobContainer(
    "appservice-c",
    container_name="appservice-c",
    account_name=storage_account.name,
예제 #3
0
    resource_group_name=env_params_data["resourceGroups"]["platform"]["name"],
    location=generic_params_data["regions"]["primaryRegion"]["name"],
)

# Create an Azure Storage Account
print(
    "Creating or updating storage account in resource group: ",
    str(platformResourceGroup.name),
)
platformStorageAccount = storage.StorageAccount(
    env_params_data["storageAccounts"]["platform"]["name"],
    account_name=env_params_data["storageAccounts"]["platform"]["name"],
    kind=env_params_data["storageAccounts"]["settings"]["kind"],
    location=platformResourceGroup.location,
    resource_group_name=platformResourceGroup.name,
    sku=storage.SkuArgs(name=env_params_data["storageAccounts"]["settings"]
                        ["accountReplicationType"], ),
)

# Create the platform virtual networks
for virtualNetwork in env_params_data["virtualNetworks"]["resources"]:
    print(
        "Creating or updating virtual network",
        virtualNetwork["name"],
        "in resource group",
        str(platformResourceGroup.name),
    )

    platformVirtualNetwork = network.VirtualNetwork(
        virtualNetwork["name"],
        virtual_network_name=virtualNetwork["name"],
        location=platformResourceGroup.location,
예제 #4
0
"""An Azure RM Python Pulumi program"""

import pulumi
from pulumi_azure_nextgen.storage import latest as storage
from pulumi_azure_nextgen.resources import latest as resources

# Create an Azure Resource Group
resource_group = resources.ResourceGroup('resource_group',
                                         resource_group_name='martin-test-rg',
                                         location='westeurope')

# Create an Azure resource (Storage Account)
account = storage.StorageAccount('sa',
                                 account_name='martinteststorage123',
                                 resource_group_name=resource_group.name,
                                 location=resource_group.location,
                                 sku=storage.SkuArgs(name='Standard_LRS', ),
                                 kind='StorageV2')

# Export the primary key of the Storage Account
primary_key = pulumi.Output.all(resource_group.name, account.name) \
    .apply(lambda args: storage.list_storage_account_keys(
        resource_group_name=args[0],
        account_name=args[1]
    )).apply(lambda accountKeys: accountKeys.keys[0].value)

pulumi.export("primary_storage_key", primary_key)