published on Saturday, Sep 12, 2026 by kislerdm
published on Saturday, Sep 12, 2026 by kislerdm
Manages the automatic snapshot backup schedule for a Neon branch.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as neon from "@pulumi/neon";
const example = new neon.Project("example", {name: "foo"});
const exampleBranchBackupSchedule = new neon.BranchBackupSchedule("example", {
projectId: example.id,
branchId: example.defaultBranchId,
schedules: [
{
frequency: "weekly",
day: 1,
hour: 4,
retentionSeconds: 86400 * 7,
},
{
frequency: "daily",
hour: 4,
retentionSeconds: 86400,
},
{
frequency: "monthly",
day: 1,
hour: 4,
retentionSeconds: 86400 * 30,
},
{
frequency: "monthly",
day: 2,
hour: 4,
retentionSeconds: 86400 * 30,
},
],
});
import pulumi
import pulumi_neon as neon
example = neon.Project("example", name="foo")
example_branch_backup_schedule = neon.BranchBackupSchedule("example",
project_id=example.id,
branch_id=example.default_branch_id,
schedules=[
{
"frequency": "weekly",
"day": 1,
"hour": 4,
"retention_seconds": 86400 * 7,
},
{
"frequency": "daily",
"hour": 4,
"retention_seconds": 86400,
},
{
"frequency": "monthly",
"day": 1,
"hour": 4,
"retention_seconds": 86400 * 30,
},
{
"frequency": "monthly",
"day": 2,
"hour": 4,
"retention_seconds": 86400 * 30,
},
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/neon/neon"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := neon.NewProject(ctx, "example", &neon.ProjectArgs{
Name: pulumi.String("foo"),
})
if err != nil {
return err
}
_, err = neon.NewBranchBackupSchedule(ctx, "example", &neon.BranchBackupScheduleArgs{
ProjectId: example.ID(),
BranchId: example.DefaultBranchId,
Schedules: neon.BranchBackupScheduleScheduleArray{
&neon.BranchBackupScheduleScheduleArgs{
Frequency: pulumi.String("weekly"),
Day: pulumi.Float64(1),
Hour: pulumi.Float64(4),
RetentionSeconds: 86400 * 7,
},
&neon.BranchBackupScheduleScheduleArgs{
Frequency: pulumi.String("daily"),
Hour: pulumi.Float64(4),
RetentionSeconds: pulumi.Float64(86400),
},
&neon.BranchBackupScheduleScheduleArgs{
Frequency: pulumi.String("monthly"),
Day: pulumi.Float64(1),
Hour: pulumi.Float64(4),
RetentionSeconds: 86400 * 30,
},
&neon.BranchBackupScheduleScheduleArgs{
Frequency: pulumi.String("monthly"),
Day: pulumi.Float64(2),
Hour: pulumi.Float64(4),
RetentionSeconds: 86400 * 30,
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Neon = Pulumi.Neon;
return await Deployment.RunAsync(() =>
{
var example = new Neon.Project("example", new()
{
Name = "foo",
});
var exampleBranchBackupSchedule = new Neon.BranchBackupSchedule("example", new()
{
ProjectId = example.Id,
BranchId = example.DefaultBranchId,
Schedules = new[]
{
new Neon.Inputs.BranchBackupScheduleScheduleArgs
{
Frequency = "weekly",
Day = 1,
Hour = 4,
RetentionSeconds = 86400 * 7,
},
new Neon.Inputs.BranchBackupScheduleScheduleArgs
{
Frequency = "daily",
Hour = 4,
RetentionSeconds = 86400,
},
new Neon.Inputs.BranchBackupScheduleScheduleArgs
{
Frequency = "monthly",
Day = 1,
Hour = 4,
RetentionSeconds = 86400 * 30,
},
new Neon.Inputs.BranchBackupScheduleScheduleArgs
{
Frequency = "monthly",
Day = 2,
Hour = 4,
RetentionSeconds = 86400 * 30,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.neon.Project;
import com.pulumi.neon.ProjectArgs;
import com.pulumi.neon.BranchBackupSchedule;
import com.pulumi.neon.BranchBackupScheduleArgs;
import com.pulumi.neon.inputs.BranchBackupScheduleScheduleArgs;
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 Project("example", ProjectArgs.builder()
.name("foo")
.build());
var exampleBranchBackupSchedule = new BranchBackupSchedule("exampleBranchBackupSchedule", BranchBackupScheduleArgs.builder()
.projectId(example.id())
.branchId(example.defaultBranchId())
.schedules(
BranchBackupScheduleScheduleArgs.builder()
.frequency("weekly")
.day(1.0)
.hour(4.0)
.retentionSeconds(86400 * 7)
.build(),
BranchBackupScheduleScheduleArgs.builder()
.frequency("daily")
.hour(4.0)
.retentionSeconds(86400.0)
.build(),
BranchBackupScheduleScheduleArgs.builder()
.frequency("monthly")
.day(1.0)
.hour(4.0)
.retentionSeconds(86400 * 30)
.build(),
BranchBackupScheduleScheduleArgs.builder()
.frequency("monthly")
.day(2.0)
.hour(4.0)
.retentionSeconds(86400 * 30)
.build())
.build());
}
}
Example coming soon!
Example coming soon!
Create BranchBackupSchedule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BranchBackupSchedule(name: string, args: BranchBackupScheduleArgs, opts?: CustomResourceOptions);@overload
def BranchBackupSchedule(resource_name: str,
args: BranchBackupScheduleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BranchBackupSchedule(resource_name: str,
opts: Optional[ResourceOptions] = None,
branch_id: Optional[str] = None,
project_id: Optional[str] = None,
schedules: Optional[Sequence[BranchBackupScheduleScheduleArgs]] = None)func NewBranchBackupSchedule(ctx *Context, name string, args BranchBackupScheduleArgs, opts ...ResourceOption) (*BranchBackupSchedule, error)public BranchBackupSchedule(string name, BranchBackupScheduleArgs args, CustomResourceOptions? opts = null)
public BranchBackupSchedule(String name, BranchBackupScheduleArgs args)
public BranchBackupSchedule(String name, BranchBackupScheduleArgs args, CustomResourceOptions options)
type: neon:BranchBackupSchedule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "neon_branch_backup_schedule" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args BranchBackupScheduleArgs
- 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 BranchBackupScheduleArgs
- 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 BranchBackupScheduleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BranchBackupScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BranchBackupScheduleArgs
- 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 branchBackupScheduleResource = new Neon.BranchBackupSchedule("branchBackupScheduleResource", new()
{
BranchId = "string",
ProjectId = "string",
Schedules = new[]
{
new Neon.Inputs.BranchBackupScheduleScheduleArgs
{
Frequency = "string",
Day = 0.0,
Hour = 0.0,
Month = 0.0,
RetentionSeconds = 0.0,
},
},
});
example, err := neon.NewBranchBackupSchedule(ctx, "branchBackupScheduleResource", &neon.BranchBackupScheduleArgs{
BranchId: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Schedules: neon.BranchBackupScheduleScheduleArray{
&neon.BranchBackupScheduleScheduleArgs{
Frequency: pulumi.String("string"),
Day: pulumi.Float64(0),
Hour: pulumi.Float64(0),
Month: pulumi.Float64(0),
RetentionSeconds: pulumi.Float64(0),
},
},
})
resource "neon_branch_backup_schedule" "branchBackupScheduleResource" {
lifecycle {
create_before_destroy = true
}
branch_id = "string"
project_id = "string"
schedules {
frequency = "string"
day = 0
hour = 0
month = 0
retention_seconds = 0
}
}
var branchBackupScheduleResource = new BranchBackupSchedule("branchBackupScheduleResource", BranchBackupScheduleArgs.builder()
.branchId("string")
.projectId("string")
.schedules(BranchBackupScheduleScheduleArgs.builder()
.frequency("string")
.day(0.0)
.hour(0.0)
.month(0.0)
.retentionSeconds(0.0)
.build())
.build());
branch_backup_schedule_resource = neon.BranchBackupSchedule("branchBackupScheduleResource",
branch_id="string",
project_id="string",
schedules=[{
"frequency": "string",
"day": float(0),
"hour": float(0),
"month": float(0),
"retention_seconds": float(0),
}])
const branchBackupScheduleResource = new neon.BranchBackupSchedule("branchBackupScheduleResource", {
branchId: "string",
projectId: "string",
schedules: [{
frequency: "string",
day: 0,
hour: 0,
month: 0,
retentionSeconds: 0,
}],
});
type: neon:BranchBackupSchedule
properties:
branchId: string
projectId: string
schedules:
- day: 0
frequency: string
hour: 0
month: 0
retentionSeconds: 0
BranchBackupSchedule 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 BranchBackupSchedule resource accepts the following input properties:
- Branch
Id string - The Neon branch ID.
- Project
Id string - The Neon project ID.
- Schedules
List<Branch
Backup Schedule Schedule> - Snapshot frequencies configured for the branch.
- Branch
Id string - The Neon branch ID.
- Project
Id string - The Neon project ID.
- Schedules
[]Branch
Backup Schedule Schedule Args - Snapshot frequencies configured for the branch.
- branch_
id string - The Neon branch ID.
- project_
id string - The Neon project ID.
- schedules list(object)
- Snapshot frequencies configured for the branch.
- branch
Id String - The Neon branch ID.
- project
Id String - The Neon project ID.
- schedules
List<Branch
Backup Schedule Schedule> - Snapshot frequencies configured for the branch.
- branch
Id string - The Neon branch ID.
- project
Id string - The Neon project ID.
- schedules
Branch
Backup Schedule Schedule[] - Snapshot frequencies configured for the branch.
- branch_
id str - The Neon branch ID.
- project_
id str - The Neon project ID.
- schedules
Sequence[Branch
Backup Schedule Schedule Args] - Snapshot frequencies configured for the branch.
- branch
Id String - The Neon branch ID.
- project
Id String - The Neon project ID.
- schedules List<Property Map>
- Snapshot frequencies configured for the branch.
Outputs
All input properties are implicitly available as output properties. Additionally, the BranchBackupSchedule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing BranchBackupSchedule Resource
Get an existing BranchBackupSchedule 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?: BranchBackupScheduleState, opts?: CustomResourceOptions): BranchBackupSchedule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
branch_id: Optional[str] = None,
project_id: Optional[str] = None,
schedules: Optional[Sequence[BranchBackupScheduleScheduleArgs]] = None) -> BranchBackupSchedulefunc GetBranchBackupSchedule(ctx *Context, name string, id IDInput, state *BranchBackupScheduleState, opts ...ResourceOption) (*BranchBackupSchedule, error)public static BranchBackupSchedule Get(string name, Input<string> id, BranchBackupScheduleState? state, CustomResourceOptions? opts = null)public static BranchBackupSchedule get(String name, Output<String> id, BranchBackupScheduleState state, CustomResourceOptions options)resources: _: type: neon:BranchBackupSchedule get: id: ${id}import {
to = neon_branch_backup_schedule.example
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.
- Branch
Id string - The Neon branch ID.
- Project
Id string - The Neon project ID.
- Schedules
List<Branch
Backup Schedule Schedule> - Snapshot frequencies configured for the branch.
- Branch
Id string - The Neon branch ID.
- Project
Id string - The Neon project ID.
- Schedules
[]Branch
Backup Schedule Schedule Args - Snapshot frequencies configured for the branch.
- branch_
id string - The Neon branch ID.
- project_
id string - The Neon project ID.
- schedules list(object)
- Snapshot frequencies configured for the branch.
- branch
Id String - The Neon branch ID.
- project
Id String - The Neon project ID.
- schedules
List<Branch
Backup Schedule Schedule> - Snapshot frequencies configured for the branch.
- branch
Id string - The Neon branch ID.
- project
Id string - The Neon project ID.
- schedules
Branch
Backup Schedule Schedule[] - Snapshot frequencies configured for the branch.
- branch_
id str - The Neon branch ID.
- project_
id str - The Neon project ID.
- schedules
Sequence[Branch
Backup Schedule Schedule Args] - Snapshot frequencies configured for the branch.
- branch
Id String - The Neon branch ID.
- project
Id String - The Neon project ID.
- schedules List<Property Map>
- Snapshot frequencies configured for the branch.
Supporting Types
BranchBackupScheduleSchedule, BranchBackupScheduleScheduleArgs
- Frequency string
- Snapshot frequency: daily, weekly, or monthly.
- Day double
- Day of the week or month, when applicable.
- Hour double
- Hour of the day, when applicable.
- Month double
- Month of the year, when applicable.
- Retention
Seconds double - How long to retain scheduled snapshots, in seconds.
- Frequency string
- Snapshot frequency: daily, weekly, or monthly.
- Day float64
- Day of the week or month, when applicable.
- Hour float64
- Hour of the day, when applicable.
- Month float64
- Month of the year, when applicable.
- Retention
Seconds float64 - How long to retain scheduled snapshots, in seconds.
- frequency string
- Snapshot frequency: daily, weekly, or monthly.
- day number
- Day of the week or month, when applicable.
- hour number
- Hour of the day, when applicable.
- month number
- Month of the year, when applicable.
- retention_
seconds number - How long to retain scheduled snapshots, in seconds.
- frequency String
- Snapshot frequency: daily, weekly, or monthly.
- day Double
- Day of the week or month, when applicable.
- hour Double
- Hour of the day, when applicable.
- month Double
- Month of the year, when applicable.
- retention
Seconds Double - How long to retain scheduled snapshots, in seconds.
- frequency string
- Snapshot frequency: daily, weekly, or monthly.
- day number
- Day of the week or month, when applicable.
- hour number
- Hour of the day, when applicable.
- month number
- Month of the year, when applicable.
- retention
Seconds number - How long to retain scheduled snapshots, in seconds.
- frequency str
- Snapshot frequency: daily, weekly, or monthly.
- day float
- Day of the week or month, when applicable.
- hour float
- Hour of the day, when applicable.
- month float
- Month of the year, when applicable.
- retention_
seconds float - How long to retain scheduled snapshots, in seconds.
- frequency String
- Snapshot frequency: daily, weekly, or monthly.
- day Number
- Day of the week or month, when applicable.
- hour Number
- Hour of the day, when applicable.
- month Number
- Month of the year, when applicable.
- retention
Seconds Number - How long to retain scheduled snapshots, in seconds.
Import
The Backup Schedule for a Neon Branch can be imported to the terraform state by its composite identifier that
consists of ProjectID and BranchID separated by a forward slash.
Import using the import block:
For example:
hcl
import {
to = neon_branch_backup_schedule.example
id = “curly-poetry-30604233/br-snowy-mountain-a5jkb18i”
}
Import using the command pulumi import:
commandline
$ pulumi import neon:index/branchBackupSchedule:BranchBackupSchedule example "curly-poetry-30604233/br-snowy-mountain-a5jkb18i"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- neon kislerdm/terraform-provider-neon
- License
- Notes
- This Pulumi package is based on the
neonTerraform Provider.
published on Saturday, Sep 12, 2026 by kislerdm