https://pulumi.com logo
Title
p

powerful-football-81694

01/10/2020, 12:52 PM
Hi folks! We need to create an Azure SQL Database of type “Serverless” with Pulumi, but I can’t figure out how to do it. More info on that here: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-serverless In ARM terms, a serverless SQL database looks like this:
{
  "type": "Microsoft.Sql/servers/databases",
  "apiVersion": "2019-06-01-preview",
  "name": "ideliverable-licensing/Licensing",
  "location": "northeurope",
  "sku": {
    "name": "GP_S_Gen5",
    "tier": "GeneralPurpose",
    "family": "Gen5",
    "capacity": 1
  },
  "kind": "v12.0,user,vcore,serverless",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 17179869184,
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "zoneRedundant": false,
    "readScale": "Disabled",
    "readReplicaCount": 0,
    "autoPauseDelay": 60,
    "storageAccountType": "GRS",
    "minCapacity": 0.5
  }
}
But a lot of these options are missing from the corresponding
Pulumi.Azure
classes. How do we specify the “Gen5" SKU, the “serverless” kind, the minimum/maximum number of vcores, and the auto-pause delay?
Pulumi.Azure.Sql.DatabaseArgs
don’t include any of these as far as I can tell. Thankful for any and all guidance!
a

adventurous-garage-59192

01/10/2020, 1:57 PM
The Terraform provider doesn't support it yet unfortunately: https://github.com/terraform-providers/terraform-provider-azurerm/issues/4185 A
TemplateDeployment
can be used as a stop-gap in the meantime.
p

powerful-football-81694

01/10/2020, 2:08 PM
TemplateDeployment sounds interesting. Can that integrate with other resources using Input<T> and Output<T>?
(Using .NET Core with C#)
a

adventurous-garage-59192

01/10/2020, 3:14 PM
Somewhat. There's no C# example in the examples repo right now, but the TS example should be enough to go off: https://github.com/pulumi/examples/blob/master/azure-ts-arm-template/index.ts
p

powerful-football-81694

01/10/2020, 3:24 PM
I see - that’s helpful.
Looks like it won’t be able to track inputs for things that need to be specified in the template itself…
How would one typically do that, if for example, we have resource A, and a resource B of type TemplateDeployment, and an output of A needs to go into the template of B?
a

adventurous-garage-59192

01/11/2020, 12:34 AM
Use the "parameters" option.
p

powerful-football-81694

01/11/2020, 12:50 PM
I think this will work as a workaround for us.
Thanks @adventurous-garage-59192!
👍 1