Пример #1
0
from pulumi_azure_nextgen.resources import latest as resources
import pulumi_random as random

config = pulumi.Config()
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",
Пример #2
0
platformResourceGroup = resources.ResourceGroup(
    env_params_data["resourceGroups"]["platform"]["name"],
    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(
Пример #3
0
from pulumi import Config, Output, asset, export
from pulumi_azure_nextgen.storage.latest import (BlobContainer, PublicAccess,
                                                 StorageAccount)

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",
Пример #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)
Пример #5
0
    db_admin_username = config.get('db_admin_username') or 'controller'
    # The password for the admin user on the new PostgreSQL instance
    db_admin_password = config.require_secret('db_admin_password')

pulumi.log.info("Azure Location: {0}".format(location))

resource_group = resources.ResourceGroup(
    resource_name='rg-nc',
    resource_group_name='rg-nc-{0}'.format(installation_id),
    location=location)

storage_account = storage.StorageAccount(
    account_name='stnc{0}'.format(installation_id),
    resource_name='stnc',
    resource_group_name=resource_group.name,
    location=location,
    access_tier="Hot",
    enable_https_traffic_only=True,
    allow_blob_public_access=False,
    kind="StorageV2",
    sku=storage.SkuArgs(name="Standard_LRS", ))

net = network.VirtualNetwork(
    resource_name='vnet-nc',
    resource_group_name=resource_group.name,
    virtual_network_name='vnet-nc-{0}'.format(installation_id),
    location=resource_group.location,
    enable_ddos_protection=False,
    enable_vm_protection=False,
    address_space=network.AddressSpaceArgs(address_prefixes=['10.0.0.0/16']))

subnet = network.Subnet(resource_name='snet-nc',
Пример #6
0
import pulumi
import pulumi_azure_nextgen.authorization.latest as authorization
import pulumi_azure_nextgen.documentdb.latest as documentdb
import pulumi_azure_nextgen.logic.latest as logic
import pulumi_azure_nextgen.resources.latest as resources
import pulumi_azure_nextgen.storage.latest as storage
import pulumi_azure_nextgen.web.latest as web

# Create an Azure Resource Group
resource_group = resources.ResourceGroup("resourceGroup",
                                         resource_group_name="logicappdemo-rg")

# Create an Azure resource (Storage Account)
storage_account = storage.StorageAccount(
    "storageAccount",
    account_name="logicappdemosa21",
    resource_group_name=resource_group.name,
    sku=storage.SkuArgs(name=storage.SkuName.STANDARD_LRS, ),
    kind=storage.Kind.STORAGE_V2)

# Cosmos DB Account
cosmosdb_account = documentdb.DatabaseAccount(
    "cosmosdbAccount",
    account_name="logicappdemo-cdb",
    resource_group_name=resource_group.name,
    database_account_offer_type=documentdb.DatabaseAccountOfferType.STANDARD,
    locations=[
        documentdb.LocationArgs(
            location_name=resource_group.location,
            failover_priority=0,
        )
    ],