aptible 0.9.12 published on Monday, Apr 14, 2025 by aptible
aptible.getBackupRetentionPolicy
Explore with Pulumi AI
# Backup Retention Policy Data Source
An Environment’s Backup Retention Policy controls how automated backups are retained and destroyed.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aptible from "@pulumi/aptible";
const exampleEnvironment = aptible.getEnvironment({
handle: "example-env",
});
const exampleBackupRetentionPolicy = exampleEnvironment.then(exampleEnvironment => aptible.getBackupRetentionPolicy({
envId: exampleEnvironment.envId,
}));
import pulumi
import pulumi_aptible as aptible
example_environment = aptible.get_environment(handle="example-env")
example_backup_retention_policy = aptible.get_backup_retention_policy(env_id=example_environment.env_id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/aptible/aptible"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleEnvironment, err := aptible.LookupEnvironment(ctx, &aptible.LookupEnvironmentArgs{
Handle: "example-env",
}, nil)
if err != nil {
return err
}
_, err = aptible.GetBackupRetentionPolicy(ctx, &aptible.GetBackupRetentionPolicyArgs{
EnvId: exampleEnvironment.EnvId,
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aptible = Pulumi.Aptible;
return await Deployment.RunAsync(() =>
{
var exampleEnvironment = Aptible.GetEnvironment.Invoke(new()
{
Handle = "example-env",
});
var exampleBackupRetentionPolicy = Aptible.GetBackupRetentionPolicy.Invoke(new()
{
EnvId = exampleEnvironment.Apply(getEnvironmentResult => getEnvironmentResult.EnvId),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aptible.AptibleFunctions;
import com.pulumi.aptible.inputs.GetEnvironmentArgs;
import com.pulumi.aptible.inputs.GetBackupRetentionPolicyArgs;
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) {
final var exampleEnvironment = AptibleFunctions.getEnvironment(GetEnvironmentArgs.builder()
.handle("example-env")
.build());
final var exampleBackupRetentionPolicy = AptibleFunctions.getBackupRetentionPolicy(GetBackupRetentionPolicyArgs.builder()
.envId(exampleEnvironment.applyValue(getEnvironmentResult -> getEnvironmentResult.envId()))
.build());
}
}
variables:
exampleEnvironment:
fn::invoke:
function: aptible:getEnvironment
arguments:
handle: example-env
exampleBackupRetentionPolicy:
fn::invoke:
function: aptible:getBackupRetentionPolicy
arguments:
envId: ${exampleEnvironment.envId}
Using getBackupRetentionPolicy
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getBackupRetentionPolicy(args: GetBackupRetentionPolicyArgs, opts?: InvokeOptions): Promise<GetBackupRetentionPolicyResult>
function getBackupRetentionPolicyOutput(args: GetBackupRetentionPolicyOutputArgs, opts?: InvokeOptions): Output<GetBackupRetentionPolicyResult>
def get_backup_retention_policy(env_id: Optional[float] = None,
id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBackupRetentionPolicyResult
def get_backup_retention_policy_output(env_id: Optional[pulumi.Input[float]] = None,
id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetBackupRetentionPolicyResult]
func GetBackupRetentionPolicy(ctx *Context, args *GetBackupRetentionPolicyArgs, opts ...InvokeOption) (*GetBackupRetentionPolicyResult, error)
func GetBackupRetentionPolicyOutput(ctx *Context, args *GetBackupRetentionPolicyOutputArgs, opts ...InvokeOption) GetBackupRetentionPolicyResultOutput
> Note: This function is named GetBackupRetentionPolicy
in the Go SDK.
public static class GetBackupRetentionPolicy
{
public static Task<GetBackupRetentionPolicyResult> InvokeAsync(GetBackupRetentionPolicyArgs args, InvokeOptions? opts = null)
public static Output<GetBackupRetentionPolicyResult> Invoke(GetBackupRetentionPolicyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBackupRetentionPolicyResult> getBackupRetentionPolicy(GetBackupRetentionPolicyArgs args, InvokeOptions options)
public static Output<GetBackupRetentionPolicyResult> getBackupRetentionPolicy(GetBackupRetentionPolicyArgs args, InvokeOptions options)
fn::invoke:
function: aptible:index/getBackupRetentionPolicy:getBackupRetentionPolicy
arguments:
# arguments dictionary
The following arguments are supported:
getBackupRetentionPolicy Result
The following output properties are available:
- Daily double
- The number of daily backups to retain per database.
- Env
Id double - Id string
- Keep
Final bool - Whether the final backup of databases should be retained when they're deleted.
- Make
Copy bool - Whether backups should be copied to another region.
- Monthly double
- The number of monthly backups to retain per database.
- Policy
Id double - Yearly double
- The number of yearly backups to retain per database.
- Daily float64
- The number of daily backups to retain per database.
- Env
Id float64 - Id string
- Keep
Final bool - Whether the final backup of databases should be retained when they're deleted.
- Make
Copy bool - Whether backups should be copied to another region.
- Monthly float64
- The number of monthly backups to retain per database.
- Policy
Id float64 - Yearly float64
- The number of yearly backups to retain per database.
- daily Double
- The number of daily backups to retain per database.
- env
Id Double - id String
- keep
Final Boolean - Whether the final backup of databases should be retained when they're deleted.
- make
Copy Boolean - Whether backups should be copied to another region.
- monthly Double
- The number of monthly backups to retain per database.
- policy
Id Double - yearly Double
- The number of yearly backups to retain per database.
- daily number
- The number of daily backups to retain per database.
- env
Id number - id string
- keep
Final boolean - Whether the final backup of databases should be retained when they're deleted.
- make
Copy boolean - Whether backups should be copied to another region.
- monthly number
- The number of monthly backups to retain per database.
- policy
Id number - yearly number
- The number of yearly backups to retain per database.
- daily float
- The number of daily backups to retain per database.
- env_
id float - id str
- keep_
final bool - Whether the final backup of databases should be retained when they're deleted.
- make_
copy bool - Whether backups should be copied to another region.
- monthly float
- The number of monthly backups to retain per database.
- policy_
id float - yearly float
- The number of yearly backups to retain per database.
- daily Number
- The number of daily backups to retain per database.
- env
Id Number - id String
- keep
Final Boolean - Whether the final backup of databases should be retained when they're deleted.
- make
Copy Boolean - Whether backups should be copied to another region.
- monthly Number
- The number of monthly backups to retain per database.
- policy
Id Number - yearly Number
- The number of yearly backups to retain per database.
Package Details
- Repository
- aptible aptible/terraform-provider-aptible
- License
- Notes
- This Pulumi package is based on the
aptible
Terraform Provider.