Flexible Server Args
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 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 exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.name("example-vn")
.location(example.location())
.resourceGroupName(example.name())
.addressSpaces("10.0.0.0/16")
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.name("example-sn")
.resourceGroupName(example.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()
.name("example.postgres.database.azure.com")
.resourceGroupName(example.name())
.build());
var exampleZoneVirtualNetworkLink = new ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", ZoneVirtualNetworkLinkArgs.builder()
.name("exampleVnetZone.com")
.privateDnsZoneName(exampleZone.name())
.virtualNetworkId(exampleVirtualNetwork.id())
.resourceGroupName(example.name())
.build());
var exampleFlexibleServer = new FlexibleServer("exampleFlexibleServer", FlexibleServerArgs.builder()
.name("example-psqlflexibleserver")
.resourceGroupName(example.name())
.location(example.location())
.version("12")
.delegatedSubnetId(exampleSubnet.id())
.privateDnsZoneId(exampleZone.id())
.administratorLogin("psqladmin")
.administratorPassword("H@Sh1CoR3!")
.zone("1")
.storageMb(32768)
.storageTier("P30")
.skuName("GP_Standard_D4s_v3")
.build());
}
}
storage_tier
defaults based on storage_mb
storage_mb | GiB | TiB | Default | Supported storage_tier 's | Provisioned IOPS |
---|---|---|---|---|---|
32768 | 32 | - | P4 | P4, P6, P10, P15, P20, P30, P40, P50 | 120 |
65536 | 64 | - | P6 | P6, P10, P15, P20, P30, P40, P50 | 240 |
131072 | 128 | - | P10 | P10, P15, P20, P30, P40, P50 | 500 |
262144 | 256 | - | P15 | P15, P20, P30, P40, P50 | 1,100 |
524288 | 512 | - | P20 | P20, P30, P40, P50 | 2,300 |
1048576 | 1024 | 1 | P30 | P30, P40, P50 | 5,000 |
2097152 | 2048 | 2 | P40 | P40, P50 | 7,500 |
4193280 | 4095 | 4 | P50 | P50 | 7,500 |
4194304 | 4096 | 4 | P50 | P50 | 7,500 |
8388608 | 8192 | 8 | P60 | P60, P70 | 16,000 |
16777216 | 16384 | 16 | P70 | P70, P80 | 18,000 |
33553408 | 32767 | 32 | P80 | P80 | 20,000 |
Note: Host Caching (ReadOnly and Read/Write) is supported on disk sizes less than 4194304 MiB. This means any disk that is provisioned up to 4193280 MiB can take advantage of Host Caching. Host caching is not supported for disk sizes larger than 4193280 MiB. For example, a P50 premium disk provisioned at 4193280 GiB can take advantage of Host caching while a P50 disk provisioned at 4194304 MiB cannot. Moving from a smaller disk size to a larger disk size, greater than 4193280 MiB, will cause the disk to lose the disk caching ability.
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
Constructors
Functions
Properties
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.