Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.postgresql.kotlin
import com.pulumi.azure.postgresql.DatabaseArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "api-rg-pro",
* location: "West Europe",
* });
* const exampleServer = new azure.postgresql.Server("example", {
* name: "postgresql-server-1",
* location: example.location,
* resourceGroupName: example.name,
* skuName: "B_Gen5_2",
* storageMb: 5120,
* backupRetentionDays: 7,
* geoRedundantBackupEnabled: false,
* autoGrowEnabled: true,
* administratorLogin: "psqladmin",
* administratorLoginPassword: "H@Sh1CoR3!",
* version: "9.5",
* sslEnforcementEnabled: true,
* });
* const exampleDatabase = new azure.postgresql.Database("example", {
* name: "exampledb",
* resourceGroupName: example.name,
* serverName: exampleServer.name,
* charset: "UTF8",
* collation: "English_United States.1252",
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="api-rg-pro",
* location="West Europe")
* example_server = azure.postgresql.Server("example",
* name="postgresql-server-1",
* location=example.location,
* resource_group_name=example.name,
* sku_name="B_Gen5_2",
* storage_mb=5120,
* backup_retention_days=7,
* geo_redundant_backup_enabled=False,
* auto_grow_enabled=True,
* administrator_login="psqladmin",
* administrator_login_password="H@Sh1CoR3!",
* version="9.5",
* ssl_enforcement_enabled=True)
* example_database = azure.postgresql.Database("example",
* name="exampledb",
* resource_group_name=example.name,
* server_name=example_server.name,
* charset="UTF8",
* collation="English_United States.1252")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "api-rg-pro",
* Location = "West Europe",
* });
* var exampleServer = new Azure.PostgreSql.Server("example", new()
* {
* Name = "postgresql-server-1",
* Location = example.Location,
* ResourceGroupName = example.Name,
* SkuName = "B_Gen5_2",
* StorageMb = 5120,
* BackupRetentionDays = 7,
* GeoRedundantBackupEnabled = false,
* AutoGrowEnabled = true,
* AdministratorLogin = "psqladmin",
* AdministratorLoginPassword = "H@Sh1CoR3!",
* Version = "9.5",
* SslEnforcementEnabled = true,
* });
* var exampleDatabase = new Azure.PostgreSql.Database("example", new()
* {
* Name = "exampledb",
* ResourceGroupName = example.Name,
* ServerName = exampleServer.Name,
* Charset = "UTF8",
* Collation = "English_United States.1252",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("api-rg-pro"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleServer, err := postgresql.NewServer(ctx, "example", &postgresql.ServerArgs{
* Name: pulumi.String("postgresql-server-1"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* SkuName: pulumi.String("B_Gen5_2"),
* StorageMb: pulumi.Int(5120),
* BackupRetentionDays: pulumi.Int(7),
* GeoRedundantBackupEnabled: pulumi.Bool(false),
* AutoGrowEnabled: pulumi.Bool(true),
* AdministratorLogin: pulumi.String("psqladmin"),
* AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"),
* Version: pulumi.String("9.5"),
* SslEnforcementEnabled: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* _, err = postgresql.NewDatabase(ctx, "example", &postgresql.DatabaseArgs{
* Name: pulumi.String("exampledb"),
* ResourceGroupName: example.Name,
* ServerName: exampleServer.Name,
* Charset: pulumi.String("UTF8"),
* Collation: pulumi.String("English_United States.1252"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.postgresql.Server;
* import com.pulumi.azure.postgresql.ServerArgs;
* import com.pulumi.azure.postgresql.Database;
* import com.pulumi.azure.postgresql.DatabaseArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("api-rg-pro")
* .location("West Europe")
* .build());
* var exampleServer = new Server("exampleServer", ServerArgs.builder()
* .name("postgresql-server-1")
* .location(example.location())
* .resourceGroupName(example.name())
* .skuName("B_Gen5_2")
* .storageMb(5120)
* .backupRetentionDays(7)
* .geoRedundantBackupEnabled(false)
* .autoGrowEnabled(true)
* .administratorLogin("psqladmin")
* .administratorLoginPassword("H@Sh1CoR3!")
* .version("9.5")
* .sslEnforcementEnabled(true)
* .build());
* var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
* .name("exampledb")
* .resourceGroupName(example.name())
* .serverName(exampleServer.name())
* .charset("UTF8")
* .collation("English_United States.1252")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: api-rg-pro
* location: West Europe
* exampleServer:
* type: azure:postgresql:Server
* name: example
* properties:
* name: postgresql-server-1
* location: ${example.location}
* resourceGroupName: ${example.name}
* skuName: B_Gen5_2
* storageMb: 5120
* backupRetentionDays: 7
* geoRedundantBackupEnabled: false
* autoGrowEnabled: true
* administratorLogin: psqladmin
* administratorLoginPassword: H@Sh1CoR3!
* version: '9.5'
* sslEnforcementEnabled: true
* exampleDatabase:
* type: azure:postgresql:Database
* name: example
* properties:
* name: exampledb
* resourceGroupName: ${example.name}
* serverName: ${exampleServer.name}
* charset: UTF8
* collation: English_United States.1252
* ```
*
* ## Import
* PostgreSQL Database's can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:postgresql/database:Database database1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforPostgreSQL/servers/server1/databases/database1
* ```
* @property charset Specifies the Charset for the PostgreSQL Database, which needs [to be a valid PostgreSQL Charset](https://www.postgresql.org/docs/current/static/multibyte.html). Changing this forces a new resource to be created.
* @property collation Specifies the Collation for the PostgreSQL Database, which needs [to be a valid PostgreSQL Collation](https://www.postgresql.org/docs/current/static/collation.html). Note that Microsoft uses different [notation](https://msdn.microsoft.com/library/windows/desktop/dd373814.aspx) - en-US instead of en_US. Changing this forces a new resource to be created.
* @property name Specifies the name of the PostgreSQL Database, which needs [to be a valid PostgreSQL identifier](https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). Changing this forces a new resource to be created.
* @property resourceGroupName The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.
* @property serverName Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.
*/
public data class DatabaseArgs(
public val charset: Output? = null,
public val collation: Output? = null,
public val name: Output? = null,
public val resourceGroupName: Output? = null,
public val serverName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.postgresql.DatabaseArgs =
com.pulumi.azure.postgresql.DatabaseArgs.builder()
.charset(charset?.applyValue({ args0 -> args0 }))
.collation(collation?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.serverName(serverName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [DatabaseArgs].
*/
@PulumiTagMarker
public class DatabaseArgsBuilder internal constructor() {
private var charset: Output? = null
private var collation: Output? = null
private var name: Output? = null
private var resourceGroupName: Output? = null
private var serverName: Output? = null
/**
* @param value Specifies the Charset for the PostgreSQL Database, which needs [to be a valid PostgreSQL Charset](https://www.postgresql.org/docs/current/static/multibyte.html). Changing this forces a new resource to be created.
*/
@JvmName("dfiopunlslinxrfe")
public suspend fun charset(`value`: Output) {
this.charset = value
}
/**
* @param value Specifies the Collation for the PostgreSQL Database, which needs [to be a valid PostgreSQL Collation](https://www.postgresql.org/docs/current/static/collation.html). Note that Microsoft uses different [notation](https://msdn.microsoft.com/library/windows/desktop/dd373814.aspx) - en-US instead of en_US. Changing this forces a new resource to be created.
*/
@JvmName("lavccldwgpxsopqy")
public suspend fun collation(`value`: Output) {
this.collation = value
}
/**
* @param value Specifies the name of the PostgreSQL Database, which needs [to be a valid PostgreSQL identifier](https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). Changing this forces a new resource to be created.
*/
@JvmName("gnptfngekttyxoep")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.
*/
@JvmName("altgtjdfyrmvfpra")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.
*/
@JvmName("fugbawxdxmbncdee")
public suspend fun serverName(`value`: Output) {
this.serverName = value
}
/**
* @param value Specifies the Charset for the PostgreSQL Database, which needs [to be a valid PostgreSQL Charset](https://www.postgresql.org/docs/current/static/multibyte.html). Changing this forces a new resource to be created.
*/
@JvmName("ibyfdqemcvhmjbsy")
public suspend fun charset(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.charset = mapped
}
/**
* @param value Specifies the Collation for the PostgreSQL Database, which needs [to be a valid PostgreSQL Collation](https://www.postgresql.org/docs/current/static/collation.html). Note that Microsoft uses different [notation](https://msdn.microsoft.com/library/windows/desktop/dd373814.aspx) - en-US instead of en_US. Changing this forces a new resource to be created.
*/
@JvmName("psdyhwysfjcyalrr")
public suspend fun collation(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.collation = mapped
}
/**
* @param value Specifies the name of the PostgreSQL Database, which needs [to be a valid PostgreSQL identifier](https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). Changing this forces a new resource to be created.
*/
@JvmName("xnsojijiqmfvaowj")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.
*/
@JvmName("stxpfrdcoqknnetr")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.
*/
@JvmName("wjcrqiwrpwchxngd")
public suspend fun serverName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.serverName = mapped
}
internal fun build(): DatabaseArgs = DatabaseArgs(
charset = charset,
collation = collation,
name = name,
resourceGroupName = resourceGroupName,
serverName = serverName,
)
}