""" ## Create API accessible with a key api = appsync.GraphQLApi( "key", authentication_type="API_KEY", schema=schema ) api_key = appsync.ApiKey( "key", api_id=api.id) random_string = random.RandomString( "random-datasource-name", length=15, special="false", number="false", ) ## Link a data source to the Dynamo DB Table data_source = appsync.DataSource( "tenants-ds", name=random_string.result, api_id=api.id, type="AMAZON_DYNAMODB", dynamodb_config={ "table_name": table.name }, service_role_arn=role.arn) ## A resolver for the [getTenantById] query
from pulumi import export import pulumi_rancher2 as rancher2 import pulumi_random as random username = random.RandomString("random-username", length=10, special="false") my_user = rancher2.User("python-user", name="Python User", username=username.result, password="******", enabled="true", ) export("username", my_user.name)
from pulumi import Config, export, ResourceOptions from pulumi_azure import core, network, lb, compute import pulumi_random as random config = Config() admin_user = config.get("adminUser") or "azureuser" admin_password = config.get_secret("adminPassword") or random.RandomPassword( "pwd", length=20, special="true").result domain = config.get("domain") or random.RandomString( "domain", length=10, number="false", special="false", upper="false").result application_port = config.get_float("applicationPort") or 80 resource_group = core.ResourceGroup("vmss-rg") public_ip = network.PublicIp("public-ip", resource_group_name=resource_group.name, allocation_method="Static", domain_name_label=domain) load_balancer = lb.LoadBalancer("lb", resource_group_name=resource_group.name, frontend_ip_configurations=[{ "name": "PublicIPAddress", "publicIpAddressId": public_ip.id, }]) bpepool = lb.BackendAddressPool("bpepool", resource_group_name=resource_group.name, loadbalancer_id=load_balancer.id)
# Copyright 2016-2021, Pulumi Corporation. All rights reserved. import pulumi import pulumi_azure_nextgen as azure_nextgen import pulumi_random as random # TODO: Remove after autonaming support is added. random_suffix = random.RandomString("randomSuffix", length=10, special=False, upper=False) config = pulumi.Config() storage_account_name = config.get("storageAccountName") if storage_account_name is None: storage_account_name = random_suffix.result.apply( lambda result: f"site{result}") cdn_endpoint_name = config.get("cdnEndpointName") if cdn_endpoint_name is None: cdn_endpoint_name = storage_account_name.apply( lambda result: f"cdn-endpnt-{result}") cdn_profile_name = config.get("cdnProfileName") if cdn_profile_name is None: cdn_profile_name = storage_account_name.apply( lambda result: f"cdn-profile-{result}") resource_group = azure_nextgen.resources.latest.ResourceGroup( "resourceGroup", resource_group_name=random_suffix.result.apply( lambda result: f"rg{result}"))
from pulumi import Config, export, ResourceOptions from pulumi_azure import core, network, lb, compute import pulumi_random as random config = Config() admin_user = config.get("adminUser") or "azureuser" admin_password = config.get_secret("adminPassword") or random.RandomPassword( "pwd", length=20, special=True).result domain = config.get("domain") or random.RandomString( "domain", length=10, number=False, special=False, upper=False).result application_port = config.get_float("applicationPort") or 80 resource_group = core.ResourceGroup("vmss-rg") public_ip = network.PublicIp("public-ip", resource_group_name=resource_group.name, allocation_method="Static", domain_name_label=domain) load_balancer = lb.LoadBalancer("lb", resource_group_name=resource_group.name, frontend_ip_configurations=[ lb.LoadBalancerFrontendIpConfigurationArgs( name="PublicIPAddress", public_ip_address_id=public_ip.id, ) ]) bpepool = lb.BackendAddressPool("bpepool", resource_group_name=resource_group.name, loadbalancer_id=load_balancer.id)
"resourceGroup", resource_group_name="appservice-docker-rg", location=location) plan = web.AppServicePlan("plan", resource_group_name=resource_group.name, name="linux-asp", location=resource_group.location, kind="Linux", reserved=True, sku=web.SkuDescriptionArgs( name="B1", tier="Basic", )) suffix = random.RandomString("suffix", length=6, special=False, upper=False) # # Scenario 1: deploying an image from Docker Hub. # The example uses a HelloWorld application written in Go. # Image: https://hub.docker.com/r/microsoft/azure-appservices-go-quickstart/ # image_in_docker_hub = "microsoft/azure-appservices-go-quickstart" hello_app = web.WebApp( "helloApp", resource_group_name=resource_group.name, location=plan.location, name=suffix.result.apply(lambda result: f"hello-app-{result}"), server_farm_id=plan.id, site_config=web.SiteConfigArgs(