FlexibleServer

class FlexibleServer : KotlinCustomResource

Manages a PostgreSQL Flexible Server.

Example Usage

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.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationServiceDelegationArgs;
import com.pulumi.azure.privatedns.Zone;
import com.pulumi.azure.privatedns.ZoneArgs;
import com.pulumi.azure.privatedns.ZoneVirtualNetworkLink;
import com.pulumi.azure.privatedns.ZoneVirtualNetworkLinkArgs;
import com.pulumi.azure.postgresql.FlexibleServer;
import com.pulumi.azure.postgresql.FlexibleServerArgs;
import com.pulumi.resources.CustomResourceOptions;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.addressSpaces("10.0.0.0/16")
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("10.0.2.0/24")
.serviceEndpoints("Microsoft.Storage")
.delegations(SubnetDelegationArgs.builder()
.name("fs")
.serviceDelegation(SubnetDelegationServiceDelegationArgs.builder()
.name("Microsoft.DBforPostgreSQL/flexibleServers")
.actions("Microsoft.Network/virtualNetworks/subnets/join/action")
.build())
.build())
.build());
var exampleZone = new Zone("exampleZone", ZoneArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleZoneVirtualNetworkLink = new ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", ZoneVirtualNetworkLinkArgs.builder()
.privateDnsZoneName(exampleZone.name())
.virtualNetworkId(exampleVirtualNetwork.id())
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleFlexibleServer = new FlexibleServer("exampleFlexibleServer", FlexibleServerArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.version("12")
.delegatedSubnetId(exampleSubnet.id())
.privateDnsZoneId(exampleZone.id())
.administratorLogin("psqladmin")
.administratorPassword("H@Sh1CoR3!")
.zone("1")
.storageMb(32768)
.skuName("GP_Standard_D4s_v3")
.build(), CustomResourceOptions.builder()
.dependsOn(exampleZoneVirtualNetworkLink)
.build());
}
}

Import

PostgreSQL Flexible Servers can be imported using the resource id, e.g.

$ pulumi import azure:postgresql/flexibleServer:FlexibleServer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforPostgreSQL/flexibleServers/server1

Properties

Link copied to clipboard

The Administrator login for the PostgreSQL Flexible Server. Required when create_mode is Default and authentication.password_auth_enabled is true.

Link copied to clipboard

The Password associated with the administrator_login for the PostgreSQL Flexible Server. Required when create_mode is Default and authentication.password_auth_enabled is true.

Link copied to clipboard

An authentication block as defined below.

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

Is the storage auto grow for PostgreSQL Flexible Server enabled? Defaults to false.

Link copied to clipboard

The backup retention days for the PostgreSQL Flexible Server. Possible values are between 7 and 35 days.

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

The creation mode which can be used to restore or replicate existing servers. Possible values are Default, PointInTimeRestore, Replica and Update. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard

A customer_managed_key block as defined below. Changing this forces a new resource to be created.

Link copied to clipboard

The ID of the virtual network subnet to create the PostgreSQL Flexible Server. The provided subnet should not have any other resource deployed in it and this subnet will be delegated to the PostgreSQL Flexible Server, if not already delegated. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard
val fqdn: Output<String>

The FQDN of the PostgreSQL Flexible Server.

Link copied to clipboard

Is Geo-Redundant backup enabled on the PostgreSQL Flexible Server. Defaults to false. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard

A high_availability block as defined below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

An identity block as defined below.

Link copied to clipboard
val location: Output<String>

The Azure Region where the PostgreSQL Flexible Server should exist. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard

A maintenance_window block as defined below.

Link copied to clipboard
val name: Output<String>

The name which should be used for this PostgreSQL Flexible Server. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard

The point in time to restore from source_server_id when create_mode is PointInTimeRestore. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard

The ID of the private DNS zone to create the PostgreSQL Flexible Server. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard

Is public network access enabled?

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val replicationRole: Output<String>?

The replication role for the PostgreSQL Flexible Server. Possible value is None.

Link copied to clipboard

The name of the Resource Group where the PostgreSQL Flexible Server should exist. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard
val skuName: Output<String>

The SKU Name for the PostgreSQL Flexible Server. The name of the SKU, follows the tier + name pattern (e.g. B_Standard_B1ms, GP_Standard_D2s_v3, MO_Standard_E4s_v3).

Link copied to clipboard
val sourceServerId: Output<String>?

The resource ID of the source PostgreSQL Flexible Server to be restored. Required when create_mode is PointInTimeRestore or Replica. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard
val storageMb: Output<Int>

The max storage allowed for the PostgreSQL Flexible Server. Possible values are 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4193280, 4194304, 8388608, 16777216 and 33553408.

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

A mapping of tags which should be assigned to the PostgreSQL Flexible Server.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<String>

The version of PostgreSQL Flexible Server to use. Possible values are 11,12, 13, 14 and 15. Required when create_mode is Default. Changing this forces a new PostgreSQL Flexible Server to be created.

Link copied to clipboard
val zone: Output<String>?