We recommend using Azure Native.
azure.postgresql.FlexibleServerBackup
Explore with Pulumi AI
Manages a PostgreSQL Flexible Server Backup.
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 exampleFlexibleServer = new azure.postgresql.FlexibleServer("example", {
name: "example-fs",
resourceGroupName: example.name,
location: example.location,
administratorLogin: "adminTerraform",
administratorPassword: "QAZwsx123",
version: "12",
skuName: "GP_Standard_D2s_v3",
zone: "2",
});
const exampleFlexibleServerBackup = new azure.postgresql.FlexibleServerBackup("example", {
name: "example-pfsb",
serverId: exampleFlexibleServer.id,
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_flexible_server = azure.postgresql.FlexibleServer("example",
name="example-fs",
resource_group_name=example.name,
location=example.location,
administrator_login="adminTerraform",
administrator_password="QAZwsx123",
version="12",
sku_name="GP_Standard_D2s_v3",
zone="2")
example_flexible_server_backup = azure.postgresql.FlexibleServerBackup("example",
name="example-pfsb",
server_id=example_flexible_server.id)
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
}
exampleFlexibleServer, err := postgresql.NewFlexibleServer(ctx, "example", &postgresql.FlexibleServerArgs{
Name: pulumi.String("example-fs"),
ResourceGroupName: example.Name,
Location: example.Location,
AdministratorLogin: pulumi.String("adminTerraform"),
AdministratorPassword: pulumi.String("QAZwsx123"),
Version: pulumi.String("12"),
SkuName: pulumi.String("GP_Standard_D2s_v3"),
Zone: pulumi.String("2"),
})
if err != nil {
return err
}
_, err = postgresql.NewFlexibleServerBackup(ctx, "example", &postgresql.FlexibleServerBackupArgs{
Name: pulumi.String("example-pfsb"),
ServerId: exampleFlexibleServer.ID(),
})
if err != nil {
return err
}
return nil
})
}
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 exampleFlexibleServer = new Azure.PostgreSql.FlexibleServer("example", new()
{
Name = "example-fs",
ResourceGroupName = example.Name,
Location = example.Location,
AdministratorLogin = "adminTerraform",
AdministratorPassword = "QAZwsx123",
Version = "12",
SkuName = "GP_Standard_D2s_v3",
Zone = "2",
});
var exampleFlexibleServerBackup = new Azure.PostgreSql.FlexibleServerBackup("example", new()
{
Name = "example-pfsb",
ServerId = exampleFlexibleServer.Id,
});
});
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.FlexibleServer;
import com.pulumi.azure.postgresql.FlexibleServerArgs;
import com.pulumi.azure.postgresql.FlexibleServerBackup;
import com.pulumi.azure.postgresql.FlexibleServerBackupArgs;
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 exampleFlexibleServer = new FlexibleServer("exampleFlexibleServer", FlexibleServerArgs.builder()
.name("example-fs")
.resourceGroupName(example.name())
.location(example.location())
.administratorLogin("adminTerraform")
.administratorPassword("QAZwsx123")
.version("12")
.skuName("GP_Standard_D2s_v3")
.zone("2")
.build());
var exampleFlexibleServerBackup = new FlexibleServerBackup("exampleFlexibleServerBackup", FlexibleServerBackupArgs.builder()
.name("example-pfsb")
.serverId(exampleFlexibleServer.id())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleFlexibleServer:
type: azure:postgresql:FlexibleServer
name: example
properties:
name: example-fs
resourceGroupName: ${example.name}
location: ${example.location}
administratorLogin: adminTerraform
administratorPassword: QAZwsx123
version: '12'
skuName: GP_Standard_D2s_v3
zone: '2'
exampleFlexibleServerBackup:
type: azure:postgresql:FlexibleServerBackup
name: example
properties:
name: example-pfsb
serverId: ${exampleFlexibleServer.id}
API Providers
This resource uses the following Azure API Providers:
Microsoft.DBforPostgreSQL
- 2024-08-01
Create FlexibleServerBackup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FlexibleServerBackup(name: string, args: FlexibleServerBackupArgs, opts?: CustomResourceOptions);
@overload
def FlexibleServerBackup(resource_name: str,
args: FlexibleServerBackupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FlexibleServerBackup(resource_name: str,
opts: Optional[ResourceOptions] = None,
server_id: Optional[str] = None,
name: Optional[str] = None)
func NewFlexibleServerBackup(ctx *Context, name string, args FlexibleServerBackupArgs, opts ...ResourceOption) (*FlexibleServerBackup, error)
public FlexibleServerBackup(string name, FlexibleServerBackupArgs args, CustomResourceOptions? opts = null)
public FlexibleServerBackup(String name, FlexibleServerBackupArgs args)
public FlexibleServerBackup(String name, FlexibleServerBackupArgs args, CustomResourceOptions options)
type: azure:postgresql:FlexibleServerBackup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FlexibleServerBackupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FlexibleServerBackupArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FlexibleServerBackupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FlexibleServerBackupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FlexibleServerBackupArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var flexibleServerBackupResource = new Azure.PostgreSql.FlexibleServerBackup("flexibleServerBackupResource", new()
{
ServerId = "string",
Name = "string",
});
example, err := postgresql.NewFlexibleServerBackup(ctx, "flexibleServerBackupResource", &postgresql.FlexibleServerBackupArgs{
ServerId: pulumi.String("string"),
Name: pulumi.String("string"),
})
var flexibleServerBackupResource = new FlexibleServerBackup("flexibleServerBackupResource", FlexibleServerBackupArgs.builder()
.serverId("string")
.name("string")
.build());
flexible_server_backup_resource = azure.postgresql.FlexibleServerBackup("flexibleServerBackupResource",
server_id="string",
name="string")
const flexibleServerBackupResource = new azure.postgresql.FlexibleServerBackup("flexibleServerBackupResource", {
serverId: "string",
name: "string",
});
type: azure:postgresql:FlexibleServerBackup
properties:
name: string
serverId: string
FlexibleServerBackup Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The FlexibleServerBackup resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the FlexibleServerBackup resource produces the following output properties:
- Completed
Time string - The Time (ISO8601 format) at which the backup was completed.
- Id string
- The provider-assigned unique ID for this managed resource.
- Completed
Time string - The Time (ISO8601 format) at which the backup was completed.
- Id string
- The provider-assigned unique ID for this managed resource.
- completed
Time String - The Time (ISO8601 format) at which the backup was completed.
- id String
- The provider-assigned unique ID for this managed resource.
- completed
Time string - The Time (ISO8601 format) at which the backup was completed.
- id string
- The provider-assigned unique ID for this managed resource.
- completed_
time str - The Time (ISO8601 format) at which the backup was completed.
- id str
- The provider-assigned unique ID for this managed resource.
- completed
Time String - The Time (ISO8601 format) at which the backup was completed.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing FlexibleServerBackup Resource
Get an existing FlexibleServerBackup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FlexibleServerBackupState, opts?: CustomResourceOptions): FlexibleServerBackup
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
completed_time: Optional[str] = None,
name: Optional[str] = None,
server_id: Optional[str] = None) -> FlexibleServerBackup
func GetFlexibleServerBackup(ctx *Context, name string, id IDInput, state *FlexibleServerBackupState, opts ...ResourceOption) (*FlexibleServerBackup, error)
public static FlexibleServerBackup Get(string name, Input<string> id, FlexibleServerBackupState? state, CustomResourceOptions? opts = null)
public static FlexibleServerBackup get(String name, Output<String> id, FlexibleServerBackupState state, CustomResourceOptions options)
resources: _: type: azure:postgresql:FlexibleServerBackup get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Completed
Time string - The Time (ISO8601 format) at which the backup was completed.
- Name string
- Specifies the name of this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- Server
Id string - The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- Completed
Time string - The Time (ISO8601 format) at which the backup was completed.
- Name string
- Specifies the name of this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- Server
Id string - The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- completed
Time String - The Time (ISO8601 format) at which the backup was completed.
- name String
- Specifies the name of this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- server
Id String - The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- completed
Time string - The Time (ISO8601 format) at which the backup was completed.
- name string
- Specifies the name of this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- server
Id string - The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- completed_
time str - The Time (ISO8601 format) at which the backup was completed.
- name str
- Specifies the name of this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- server_
id str - The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- completed
Time String - The Time (ISO8601 format) at which the backup was completed.
- name String
- Specifies the name of this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
- server
Id String - The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Backup. Changing this forces a new resource to be created.
Import
An existing PostgreSQL Flexible Server Backup can be imported into Pulumi using the resource id
, e.g.
$ pulumi import azure:postgresql/flexibleServerBackup:FlexibleServerBackup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DBforPostgreSQL/flexibleServers/fs1/backups/backup1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.