ServerArgs

data class ServerArgs(val administratorLogin: Output<String>? = null, val administratorLoginPassword: Output<String>? = null, val administratorLoginPasswordWoVersion: Output<Int>? = null, val autoGrowEnabled: Output<Boolean>? = null, val backupRetentionDays: Output<Int>? = null, val createMode: Output<String>? = null, val creationSourceServerId: Output<String>? = null, val geoRedundantBackupEnabled: Output<Boolean>? = null, val identity: Output<ServerIdentityArgs>? = null, val infrastructureEncryptionEnabled: Output<Boolean>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val publicNetworkAccessEnabled: Output<Boolean>? = null, val resourceGroupName: Output<String>? = null, val restorePointInTime: Output<String>? = null, val skuName: Output<String>? = null, val sslEnforcementEnabled: Output<Boolean>? = null, val sslMinimalTlsVersionEnforced: Output<String>? = null, val storageMb: Output<Int>? = null, val tags: Output<Map<String, String>>? = null, val threatDetectionPolicy: Output<ServerThreatDetectionPolicyArgs>? = null, val version: Output<String>? = null) : ConvertibleToJava<ServerArgs>

Manages a PostgreSQL Server.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleServer = new azure.postgresql.Server("example", {
name: "example-psqlserver",
location: example.location,
resourceGroupName: example.name,
administratorLogin: "psqladmin",
administratorLoginPassword: "H@Sh1CoR3!",
skuName: "GP_Gen5_4",
version: "11",
storageMb: 640000,
backupRetentionDays: 7,
geoRedundantBackupEnabled: true,
autoGrowEnabled: true,
publicNetworkAccessEnabled: false,
sslEnforcementEnabled: true,
sslMinimalTlsVersionEnforced: "TLS1_2",
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_server = azure.postgresql.Server("example",
name="example-psqlserver",
location=example.location,
resource_group_name=example.name,
administrator_login="psqladmin",
administrator_login_password="H@Sh1CoR3!",
sku_name="GP_Gen5_4",
version="11",
storage_mb=640000,
backup_retention_days=7,
geo_redundant_backup_enabled=True,
auto_grow_enabled=True,
public_network_access_enabled=False,
ssl_enforcement_enabled=True,
ssl_minimal_tls_version_enforced="TLS1_2")
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 = "example-resources",
Location = "West Europe",
});
var exampleServer = new Azure.PostgreSql.Server("example", new()
{
Name = "example-psqlserver",
Location = example.Location,
ResourceGroupName = example.Name,
AdministratorLogin = "psqladmin",
AdministratorLoginPassword = "H@Sh1CoR3!",
SkuName = "GP_Gen5_4",
Version = "11",
StorageMb = 640000,
BackupRetentionDays = 7,
GeoRedundantBackupEnabled = true,
AutoGrowEnabled = true,
PublicNetworkAccessEnabled = false,
SslEnforcementEnabled = true,
SslMinimalTlsVersionEnforced = "TLS1_2",
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/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("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = postgresql.NewServer(ctx, "example", &postgresql.ServerArgs{
Name: pulumi.String("example-psqlserver"),
Location: example.Location,
ResourceGroupName: example.Name,
AdministratorLogin: pulumi.String("psqladmin"),
AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"),
SkuName: pulumi.String("GP_Gen5_4"),
Version: pulumi.String("11"),
StorageMb: pulumi.Int(640000),
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackupEnabled: pulumi.Bool(true),
AutoGrowEnabled: pulumi.Bool(true),
PublicNetworkAccessEnabled: pulumi.Bool(false),
SslEnforcementEnabled: pulumi.Bool(true),
SslMinimalTlsVersionEnforced: pulumi.String("TLS1_2"),
})
if err != nil {
return err
}
return nil
})
}
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 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("example-resources")
.location("West Europe")
.build());
var exampleServer = new Server("exampleServer", ServerArgs.builder()
.name("example-psqlserver")
.location(example.location())
.resourceGroupName(example.name())
.administratorLogin("psqladmin")
.administratorLoginPassword("H@Sh1CoR3!")
.skuName("GP_Gen5_4")
.version("11")
.storageMb(640000)
.backupRetentionDays(7)
.geoRedundantBackupEnabled(true)
.autoGrowEnabled(true)
.publicNetworkAccessEnabled(false)
.sslEnforcementEnabled(true)
.sslMinimalTlsVersionEnforced("TLS1_2")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleServer:
type: azure:postgresql:Server
name: example
properties:
name: example-psqlserver
location: ${example.location}
resourceGroupName: ${example.name}
administratorLogin: psqladmin
administratorLoginPassword: H@Sh1CoR3!
skuName: GP_Gen5_4
version: '11'
storageMb: 640000
backupRetentionDays: 7
geoRedundantBackupEnabled: true
autoGrowEnabled: true
publicNetworkAccessEnabled: false
sslEnforcementEnabled: true
sslMinimalTlsVersionEnforced: TLS1_2

API Providers

This resource uses the following Azure API Providers:

  • Microsoft.DBforPostgreSQL: 2017-12-01

Import

PostgreSQL Server's can be imported using the resource id, e.g.

$ pulumi import azure:postgresql/server:Server server1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforPostgreSQL/servers/server1

Constructors

Link copied to clipboard
constructor(administratorLogin: Output<String>? = null, administratorLoginPassword: Output<String>? = null, administratorLoginPasswordWoVersion: Output<Int>? = null, autoGrowEnabled: Output<Boolean>? = null, backupRetentionDays: Output<Int>? = null, createMode: Output<String>? = null, creationSourceServerId: Output<String>? = null, geoRedundantBackupEnabled: Output<Boolean>? = null, identity: Output<ServerIdentityArgs>? = null, infrastructureEncryptionEnabled: Output<Boolean>? = null, location: Output<String>? = null, name: Output<String>? = null, publicNetworkAccessEnabled: Output<Boolean>? = null, resourceGroupName: Output<String>? = null, restorePointInTime: Output<String>? = null, skuName: Output<String>? = null, sslEnforcementEnabled: Output<Boolean>? = null, sslMinimalTlsVersionEnforced: Output<String>? = null, storageMb: Output<Int>? = null, tags: Output<Map<String, String>>? = null, threatDetectionPolicy: Output<ServerThreatDetectionPolicyArgs>? = null, version: Output<String>? = null)

Properties

Link copied to clipboard
val administratorLogin: Output<String>? = null

The Administrator login for the PostgreSQL Server. Required when create_mode is Default. Changing this forces a new resource to be created.

Link copied to clipboard
val administratorLoginPassword: Output<String>? = null

The Password associated with the administrator_login for the PostgreSQL Server.

Link copied to clipboard

An integer value used to trigger an update for administrator_login_password_wo. This property should be incremented when updating administrator_login_password_wo.

Link copied to clipboard
val autoGrowEnabled: Output<Boolean>? = null

Enable/Disable auto-growing of the storage. Storage auto-grow prevents your server from running out of storage and becoming read-only. If storage auto grow is enabled, the storage automatically grows without impacting the workload. Defaults to true.

Link copied to clipboard
val backupRetentionDays: Output<Int>? = null

Backup retention days for the server, supported values are between 7 and 35 days.

Link copied to clipboard
val createMode: Output<String>? = null

The creation mode. Can be used to restore or replicate existing servers. Possible values are Default, Replica, GeoRestore, and PointInTimeRestore. Defaults to Default.

Link copied to clipboard
val creationSourceServerId: Output<String>? = null

For creation modes other than Default, the source server ID to use.

Link copied to clipboard
val geoRedundantBackupEnabled: Output<Boolean>? = null

Turn Geo-redundant server backups on/off. This allows you to choose between locally redundant or geo-redundant backup storage in the General Purpose and Memory Optimized tiers. When the backups are stored in geo-redundant backup storage, they are not only stored within the region in which your server is hosted, but are also replicated to a paired data center. This provides better protection and ability to restore your server in a different region in the event of a disaster. This is not support for the Basic tier. Changing this forces a new resource to be created.

Link copied to clipboard
val identity: Output<ServerIdentityArgs>? = null

An identity block as defined below.

Link copied to clipboard

Whether or not infrastructure is encrypted for this server. Changing this forces a new resource to be created.

Link copied to clipboard
val location: Output<String>? = null

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard
val name: Output<String>? = null

Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

Link copied to clipboard
val publicNetworkAccessEnabled: Output<Boolean>? = null

Whether or not public network access is allowed for this server. Defaults to true.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group in which to create the PostgreSQL Server. Changing this forces a new resource to be created.

Link copied to clipboard
val restorePointInTime: Output<String>? = null

When create_mode is PointInTimeRestore the point in time to restore from creation_source_server_id. It should be provided in RFC3339 format, e.g. 2013-11-08T22:00:40Z.

Link copied to clipboard
val skuName: Output<String>? = null

Specifies the SKU Name for this PostgreSQL Server. The name of the SKU, follows the tier + family + cores pattern (e.g. B_Gen4_1, GP_Gen5_8). For more information see the product documentation. Possible values are B_Gen4_1, B_Gen4_2, B_Gen5_1, B_Gen5_2, GP_Gen4_2, GP_Gen4_4, GP_Gen4_8, GP_Gen4_16, GP_Gen4_32, GP_Gen5_2, GP_Gen5_4, GP_Gen5_8, GP_Gen5_16, GP_Gen5_32, GP_Gen5_64, MO_Gen5_2, MO_Gen5_4, MO_Gen5_8, MO_Gen5_16 and MO_Gen5_32.

Link copied to clipboard
val sslEnforcementEnabled: Output<Boolean>? = null

Specifies if SSL should be enforced on connections. Possible values are true and false.

Link copied to clipboard

The minimum TLS version to support on the sever. Possible values are TLSEnforcementDisabled, TLS1_0, TLS1_1, and TLS1_2. Defaults to TLS1_2.

Link copied to clipboard
val storageMb: Output<Int>? = null

Max storage allowed for a server. Possible values are between 5120 MB(5GB) and 1048576 MB(1TB) for the Basic SKU and between 5120 MB(5GB) and 16777216 MB(16TB) for General Purpose/Memory Optimized SKUs. For more information see the product documentation.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard

Threat detection policy configuration, known in the API as Server Security Alerts Policy. The threat_detection_policy block supports fields documented below.

Link copied to clipboard
val version: Output<String>? = null

Specifies the version of PostgreSQL to use. Valid values are 9.5, 9.6, 10, 10.0, 10.2 and 11. Changing this forces a new resource to be created.

Functions

Link copied to clipboard
open override fun toJava(): ServerArgs