1. Packages
  2. Aptible Provider
  3. API Docs
  4. getBackupRetentionPolicy
aptible 0.9.12 published on Monday, Apr 14, 2025 by aptible

aptible.getBackupRetentionPolicy

Explore with Pulumi AI

aptible logo
aptible 0.9.12 published on Monday, Apr 14, 2025 by aptible

    # 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:

    EnvId double
    The ID of the environment to retrieve the backup retention policy for.
    Id string
    EnvId float64
    The ID of the environment to retrieve the backup retention policy for.
    Id string
    envId Double
    The ID of the environment to retrieve the backup retention policy for.
    id String
    envId number
    The ID of the environment to retrieve the backup retention policy for.
    id string
    env_id float
    The ID of the environment to retrieve the backup retention policy for.
    id str
    envId Number
    The ID of the environment to retrieve the backup retention policy for.
    id String

    getBackupRetentionPolicy Result

    The following output properties are available:

    Daily double
    The number of daily backups to retain per database.
    EnvId double
    Id string
    KeepFinal bool
    Whether the final backup of databases should be retained when they're deleted.
    MakeCopy bool
    Whether backups should be copied to another region.
    Monthly double
    The number of monthly backups to retain per database.
    PolicyId double
    Yearly double
    The number of yearly backups to retain per database.
    Daily float64
    The number of daily backups to retain per database.
    EnvId float64
    Id string
    KeepFinal bool
    Whether the final backup of databases should be retained when they're deleted.
    MakeCopy bool
    Whether backups should be copied to another region.
    Monthly float64
    The number of monthly backups to retain per database.
    PolicyId float64
    Yearly float64
    The number of yearly backups to retain per database.
    daily Double
    The number of daily backups to retain per database.
    envId Double
    id String
    keepFinal Boolean
    Whether the final backup of databases should be retained when they're deleted.
    makeCopy Boolean
    Whether backups should be copied to another region.
    monthly Double
    The number of monthly backups to retain per database.
    policyId Double
    yearly Double
    The number of yearly backups to retain per database.
    daily number
    The number of daily backups to retain per database.
    envId number
    id string
    keepFinal boolean
    Whether the final backup of databases should be retained when they're deleted.
    makeCopy boolean
    Whether backups should be copied to another region.
    monthly number
    The number of monthly backups to retain per database.
    policyId 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.
    envId Number
    id String
    keepFinal Boolean
    Whether the final backup of databases should be retained when they're deleted.
    makeCopy Boolean
    Whether backups should be copied to another region.
    monthly Number
    The number of monthly backups to retain per database.
    policyId 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.
    aptible logo
    aptible 0.9.12 published on Monday, Apr 14, 2025 by aptible