Last active
June 16, 2020 13:55
-
-
Save hadoan/0840175b2b338f8f6e5e97474abfb378 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as pulumi from "@pulumi/pulumi"; | |
import * as azure from "@pulumi/azure"; | |
import { DeploymentConsts } from '../common/consts'; | |
export const dbUserName = "sql"; | |
export const dbUserPwd = "your-password";//hard-code, please use Pulumi config for this setting | |
export function newSqlServer(resourceGroup: azure.core.ResourceGroup) { | |
const serverName = DeploymentConsts.APP_NAME + "-sql-server"; | |
return new azure.sql.SqlServer(serverName, { | |
name: serverName, | |
resourceGroupName: resourceGroup.name, | |
administratorLogin: dbUserName, | |
administratorLoginPassword: dbUserPwd, | |
version: "12.0", | |
}); | |
} | |
export function newDb(resourceGroup: azure.core.ResourceGroup, sqlServer: azure.sql.SqlServer) { | |
return new azure.sql.Database("tmdbmovies", { | |
name: 'tmdbmovies', | |
resourceGroupName: resourceGroup.name, | |
serverName: sqlServer.name, | |
requestedServiceObjectiveName: "S0" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment