Beispiel #1
0
import pulumi_azure_native.storage as storage
import pulumi_azure_native.web as web
from pulumi import Config, Output, asset, export
from pulumi_azure_native.storage import (BlobContainer, PublicAccess,
                                         StorageAccount)

username = "******"

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

resource_group = resource.ResourceGroup("appservicerg")

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

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

storage_container = BlobContainer("appservice-c",
                                  account_name=storage_account.name,
                                  public_access=PublicAccess.NONE,
                                  resource_group_name=resource_group.name)
Beispiel #2
0
"""An Azure RM Python Pulumi program"""

import pulumi
from pulumi_azure_native import storage
from pulumi_azure_native import resources

# Create an Azure Resource Group
resource_group = resources.ResourceGroup('cloudskills-rg')

# Create an Azure resource (Storage Account)
account = storage.StorageAccount('sa',
                                 resource_group_name=resource_group.name,
                                 sku=storage.SkuArgs(
                                     name=storage.SkuName.STANDARD_LRS, ),
                                 kind=storage.Kind.STORAGE_V2)

# 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)
Beispiel #3
0
import pulumi
import pulumi_azure_native.authorization as authorization
import pulumi_azure_native.storage as storage
import pulumi_azure_native.synapse as synapse
import pulumi_azure_native.resources as resources
import pulumi_random as random

config = pulumi.Config()

resource_group = resources.ResourceGroup("synapse-rg")

storage_account = storage.StorageAccount(
    "synapsesa",
    resource_group_name=resource_group.name,
    access_tier=storage.AccessTier.HOT,
    enable_https_traffic_only=True,
    is_hns_enabled=True,
    kind=storage.Kind.STORAGE_V2,
    sku=storage.SkuArgs(name=storage.SkuName.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,
                              public_access=storage.PublicAccess.NONE)

workspace = synapse.Workspace(
    "workspace",
    resource_group_name=resource_group.name,
Beispiel #4
0
import pulumi
import pulumi_azure_native.authorization as authorization
import pulumi_azure_native.documentdb as documentdb
import pulumi_azure_native.logic as logic
import pulumi_azure_native.resources as resources
import pulumi_azure_native.storage as storage
import pulumi_azure_native.web as web

# Create an Azure Resource Group
resource_group = resources.ResourceGroup("resourceGroup")

# Create an Azure resource (Storage Account)
storage_account = storage.StorageAccount(
    "logicappdemosa",
    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(
    "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,
        )
    ],
    consistency_policy=documentdb.ConsistencyPolicyArgs(
Beispiel #5
0
resource_group = resources.ResourceGroup("resourceGroup")

profile = cdn.Profile("profile",
                      resource_group_name=resource_group.name,
                      sku=cdn.SkuArgs(name=cdn.SkuName.STANDARD_MICROSOFT, ))

storage_account = storage.StorageAccount(
    "storageaccount",
    access_tier=storage.AccessTier.HOT,
    enable_https_traffic_only=True,
    encryption=storage.EncryptionArgs(
        key_source=storage.KeySource.MICROSOFT_STORAGE,
        services=storage.EncryptionServicesArgs(
            blob=storage.EncryptionServiceArgs(enabled=True, ),
            file=storage.EncryptionServiceArgs(enabled=True, ),
        ),
    ),
    kind=storage.Kind.STORAGE_V2,
    network_rule_set=storage.NetworkRuleSetArgs(
        bypass=storage.Bypass.AZURE_SERVICES,
        default_action=storage.DefaultAction.ALLOW,
    ),
    resource_group_name=resource_group.name,
    sku=storage.SkuArgs(name=storage.SkuName.STANDARD_LRS, ))

endpoint_origin = storage_account.primary_endpoints.apply(
    lambda primary_endpoints: primary_endpoints.web.replace("https://", ""
                                                            ).replace("/", ""))

endpoint = cdn.Endpoint(
    "endpoint",