Skip to content

Instantly share code, notes, and snippets.

@pierskarsenbarg
Last active May 25, 2021 10:45
Show Gist options
  • Select an option

  • Save pierskarsenbarg/1ca7905192c75491cafc604e5c1c8182 to your computer and use it in GitHub Desktop.

Select an option

Save pierskarsenbarg/1ca7905192c75491cafc604e5c1c8182 to your computer and use it in GitHub Desktop.
using System.Threading.Tasks;
using Pulumi;
using Pulumi.AzureNative.Resources;
using Sql = Pulumi.AzureNative.Sql;
using System;
class MyStack : Stack
{
public MyStack()
{
// Create an Azure Resource Group
var resourceGroup = new ResourceGroup("resourceGroup");
var server = new Sql.Server("server", new Sql.ServerArgs
{
AdministratorLogin = "dummylogin",
AdministratorLoginPassword = "PLACEHOLDER",
ResourceGroupName = resourceGroup.Name,
ServerName = "my-server",
});
//Create database
var database = new Sql.Database("database", new Sql.DatabaseArgs
{
DatabaseName = "testdb",
ResourceGroupName = resourceGroup.Name,
ServerName = server.Name,
Sku = new Sql.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen4",
Name = "BC",
},
});
database.Name.Apply(x => DeployDapacSingleParameter(x));
Output.All(server.Name, database.Name)
.Apply(x => DeployDapacMultiplParameters(x[0], x[1]));
}
private Task DeployDapacSingleParameter(string dbName)
{
throw new NotImplementedException();
}
private Task DeployDapacMultiplParameters(string serverName, string dbName)
{
throw new NotImplementedException();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment