1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getPostgresqlBackupDownloadUrls
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getPostgresqlBackupDownloadUrls

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query detailed information of postgresql backup_download_urls

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const logBackups = tencentcloud.getPostgresqlLogBackups({
        minFinishTime: "%s",
        maxFinishTime: "%s",
        filters: [{
            name: "db-instance-id",
            values: [local.pgsql_id],
        }],
        orderBy: "StartTime",
        orderByType: "desc",
    });
    const backupDownloadUrls = logBackups.then(logBackups => tencentcloud.getPostgresqlBackupDownloadUrls({
        dbInstanceId: local.pgsql_id,
        backupType: "LogBackup",
        backupId: logBackups.logBackupSets?.[0]?.id,
        urlExpireTime: 12,
        backupDownloadRestriction: {
            restrictionType: "NONE",
            vpcRestrictionEffect: "ALLOW",
            vpcIdSets: [local.vpc_id],
            ipRestrictionEffect: "ALLOW",
            ipSets: ["0.0.0.0"],
        },
    }));
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    log_backups = tencentcloud.get_postgresql_log_backups(min_finish_time="%s",
        max_finish_time="%s",
        filters=[{
            "name": "db-instance-id",
            "values": [local["pgsql_id"]],
        }],
        order_by="StartTime",
        order_by_type="desc")
    backup_download_urls = tencentcloud.get_postgresql_backup_download_urls(db_instance_id=local["pgsql_id"],
        backup_type="LogBackup",
        backup_id=log_backups.log_backup_sets[0].id,
        url_expire_time=12,
        backup_download_restriction={
            "restriction_type": "NONE",
            "vpc_restriction_effect": "ALLOW",
            "vpc_id_sets": [local["vpc_id"]],
            "ip_restriction_effect": "ALLOW",
            "ip_sets": ["0.0.0.0"],
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    logBackups, err := tencentcloud.GetPostgresqlLogBackups(ctx, &tencentcloud.GetPostgresqlLogBackupsArgs{
    MinFinishTime: pulumi.StringRef("%s"),
    MaxFinishTime: pulumi.StringRef("%s"),
    Filters: []tencentcloud.GetPostgresqlLogBackupsFilter{
    {
    Name: pulumi.StringRef("db-instance-id"),
    Values: interface{}{
    local.Pgsql_id,
    },
    },
    },
    OrderBy: pulumi.StringRef("StartTime"),
    OrderByType: pulumi.StringRef("desc"),
    }, nil);
    if err != nil {
    return err
    }
    _, err = tencentcloud.GetPostgresqlBackupDownloadUrls(ctx, &tencentcloud.GetPostgresqlBackupDownloadUrlsArgs{
    DbInstanceId: local.Pgsql_id,
    BackupType: "LogBackup",
    BackupId: logBackups.LogBackupSets[0].Id,
    UrlExpireTime: pulumi.Float64Ref(12),
    BackupDownloadRestriction: tencentcloud.GetPostgresqlBackupDownloadUrlsBackupDownloadRestriction{
    RestrictionType: pulumi.StringRef("NONE"),
    VpcRestrictionEffect: pulumi.StringRef("ALLOW"),
    VpcIdSets: interface{}{
    local.Vpc_id,
    },
    IpRestrictionEffect: pulumi.StringRef("ALLOW"),
    IpSets: []string{
    "0.0.0.0",
    },
    },
    }, nil);
    if err != nil {
    return err
    }
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var logBackups = Tencentcloud.GetPostgresqlLogBackups.Invoke(new()
        {
            MinFinishTime = "%s",
            MaxFinishTime = "%s",
            Filters = new[]
            {
                new Tencentcloud.Inputs.GetPostgresqlLogBackupsFilterInputArgs
                {
                    Name = "db-instance-id",
                    Values = new[]
                    {
                        local.Pgsql_id,
                    },
                },
            },
            OrderBy = "StartTime",
            OrderByType = "desc",
        });
    
        var backupDownloadUrls = Tencentcloud.GetPostgresqlBackupDownloadUrls.Invoke(new()
        {
            DbInstanceId = local.Pgsql_id,
            BackupType = "LogBackup",
            BackupId = logBackups.Apply(getPostgresqlLogBackupsResult => getPostgresqlLogBackupsResult.LogBackupSets[0]?.Id),
            UrlExpireTime = 12,
            BackupDownloadRestriction = new Tencentcloud.Inputs.GetPostgresqlBackupDownloadUrlsBackupDownloadRestrictionInputArgs
            {
                RestrictionType = "NONE",
                VpcRestrictionEffect = "ALLOW",
                VpcIdSets = new[]
                {
                    local.Vpc_id,
                },
                IpRestrictionEffect = "ALLOW",
                IpSets = new[]
                {
                    "0.0.0.0",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetPostgresqlLogBackupsArgs;
    import com.pulumi.tencentcloud.inputs.GetPostgresqlBackupDownloadUrlsArgs;
    import com.pulumi.tencentcloud.inputs.GetPostgresqlBackupDownloadUrlsBackupDownloadRestrictionArgs;
    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 logBackups = TencentcloudFunctions.getPostgresqlLogBackups(GetPostgresqlLogBackupsArgs.builder()
                .minFinishTime("%s")
                .maxFinishTime("%s")
                .filters(GetPostgresqlLogBackupsFilterArgs.builder()
                    .name("db-instance-id")
                    .values(local.pgsql_id())
                    .build())
                .orderBy("StartTime")
                .orderByType("desc")
                .build());
    
            final var backupDownloadUrls = TencentcloudFunctions.getPostgresqlBackupDownloadUrls(GetPostgresqlBackupDownloadUrlsArgs.builder()
                .dbInstanceId(local.pgsql_id())
                .backupType("LogBackup")
                .backupId(logBackups.applyValue(getPostgresqlLogBackupsResult -> getPostgresqlLogBackupsResult.logBackupSets()[0].id()))
                .urlExpireTime(12)
                .backupDownloadRestriction(GetPostgresqlBackupDownloadUrlsBackupDownloadRestrictionArgs.builder()
                    .restrictionType("NONE")
                    .vpcRestrictionEffect("ALLOW")
                    .vpcIdSets(local.vpc_id())
                    .ipRestrictionEffect("ALLOW")
                    .ipSets("0.0.0.0")
                    .build())
                .build());
    
        }
    }
    
    variables:
      logBackups:
        fn::invoke:
          function: tencentcloud:getPostgresqlLogBackups
          arguments:
            minFinishTime: '%s'
            maxFinishTime: '%s'
            filters:
              - name: db-instance-id
                values:
                  - ${local.pgsql_id}
            orderBy: StartTime
            orderByType: desc
      backupDownloadUrls:
        fn::invoke:
          function: tencentcloud:getPostgresqlBackupDownloadUrls
          arguments:
            dbInstanceId: ${local.pgsql_id}
            backupType: LogBackup
            backupId: ${logBackups.logBackupSets[0].id}
            urlExpireTime: 12
            backupDownloadRestriction:
              restrictionType: NONE
              vpcRestrictionEffect: ALLOW
              vpcIdSets:
                - ${local.vpc_id}
              ipRestrictionEffect: ALLOW
              ipSets:
                - 0.0.0.0
    

    Using getPostgresqlBackupDownloadUrls

    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 getPostgresqlBackupDownloadUrls(args: GetPostgresqlBackupDownloadUrlsArgs, opts?: InvokeOptions): Promise<GetPostgresqlBackupDownloadUrlsResult>
    function getPostgresqlBackupDownloadUrlsOutput(args: GetPostgresqlBackupDownloadUrlsOutputArgs, opts?: InvokeOptions): Output<GetPostgresqlBackupDownloadUrlsResult>
    def get_postgresql_backup_download_urls(backup_download_restriction: Optional[GetPostgresqlBackupDownloadUrlsBackupDownloadRestriction] = None,
                                            backup_id: Optional[str] = None,
                                            backup_type: Optional[str] = None,
                                            db_instance_id: Optional[str] = None,
                                            id: Optional[str] = None,
                                            result_output_file: Optional[str] = None,
                                            url_expire_time: Optional[float] = None,
                                            opts: Optional[InvokeOptions] = None) -> GetPostgresqlBackupDownloadUrlsResult
    def get_postgresql_backup_download_urls_output(backup_download_restriction: Optional[pulumi.Input[GetPostgresqlBackupDownloadUrlsBackupDownloadRestrictionArgs]] = None,
                                            backup_id: Optional[pulumi.Input[str]] = None,
                                            backup_type: Optional[pulumi.Input[str]] = None,
                                            db_instance_id: Optional[pulumi.Input[str]] = None,
                                            id: Optional[pulumi.Input[str]] = None,
                                            result_output_file: Optional[pulumi.Input[str]] = None,
                                            url_expire_time: Optional[pulumi.Input[float]] = None,
                                            opts: Optional[InvokeOptions] = None) -> Output[GetPostgresqlBackupDownloadUrlsResult]
    func GetPostgresqlBackupDownloadUrls(ctx *Context, args *GetPostgresqlBackupDownloadUrlsArgs, opts ...InvokeOption) (*GetPostgresqlBackupDownloadUrlsResult, error)
    func GetPostgresqlBackupDownloadUrlsOutput(ctx *Context, args *GetPostgresqlBackupDownloadUrlsOutputArgs, opts ...InvokeOption) GetPostgresqlBackupDownloadUrlsResultOutput

    > Note: This function is named GetPostgresqlBackupDownloadUrls in the Go SDK.

    public static class GetPostgresqlBackupDownloadUrls 
    {
        public static Task<GetPostgresqlBackupDownloadUrlsResult> InvokeAsync(GetPostgresqlBackupDownloadUrlsArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresqlBackupDownloadUrlsResult> Invoke(GetPostgresqlBackupDownloadUrlsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPostgresqlBackupDownloadUrlsResult> getPostgresqlBackupDownloadUrls(GetPostgresqlBackupDownloadUrlsArgs args, InvokeOptions options)
    public static Output<GetPostgresqlBackupDownloadUrlsResult> getPostgresqlBackupDownloadUrls(GetPostgresqlBackupDownloadUrlsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getPostgresqlBackupDownloadUrls:getPostgresqlBackupDownloadUrls
      arguments:
        # arguments dictionary

    The following arguments are supported:

    BackupId string
    Unique backup ID.
    BackupType string
    Backup type. Valid values: LogBackup, BaseBackup.
    DbInstanceId string
    Instance ID.
    BackupDownloadRestriction GetPostgresqlBackupDownloadUrlsBackupDownloadRestriction
    Backup download restriction.
    Id string
    ResultOutputFile string
    Used to save results.
    UrlExpireTime double
    Validity period of a URL, which is 12 hours by default.
    BackupId string
    Unique backup ID.
    BackupType string
    Backup type. Valid values: LogBackup, BaseBackup.
    DbInstanceId string
    Instance ID.
    BackupDownloadRestriction GetPostgresqlBackupDownloadUrlsBackupDownloadRestriction
    Backup download restriction.
    Id string
    ResultOutputFile string
    Used to save results.
    UrlExpireTime float64
    Validity period of a URL, which is 12 hours by default.
    backupId String
    Unique backup ID.
    backupType String
    Backup type. Valid values: LogBackup, BaseBackup.
    dbInstanceId String
    Instance ID.
    backupDownloadRestriction GetPostgresqlBackupDownloadUrlsBackupDownloadRestriction
    Backup download restriction.
    id String
    resultOutputFile String
    Used to save results.
    urlExpireTime Double
    Validity period of a URL, which is 12 hours by default.
    backupId string
    Unique backup ID.
    backupType string
    Backup type. Valid values: LogBackup, BaseBackup.
    dbInstanceId string
    Instance ID.
    backupDownloadRestriction GetPostgresqlBackupDownloadUrlsBackupDownloadRestriction
    Backup download restriction.
    id string
    resultOutputFile string
    Used to save results.
    urlExpireTime number
    Validity period of a URL, which is 12 hours by default.
    backup_id str
    Unique backup ID.
    backup_type str
    Backup type. Valid values: LogBackup, BaseBackup.
    db_instance_id str
    Instance ID.
    backup_download_restriction GetPostgresqlBackupDownloadUrlsBackupDownloadRestriction
    Backup download restriction.
    id str
    result_output_file str
    Used to save results.
    url_expire_time float
    Validity period of a URL, which is 12 hours by default.
    backupId String
    Unique backup ID.
    backupType String
    Backup type. Valid values: LogBackup, BaseBackup.
    dbInstanceId String
    Instance ID.
    backupDownloadRestriction Property Map
    Backup download restriction.
    id String
    resultOutputFile String
    Used to save results.
    urlExpireTime Number
    Validity period of a URL, which is 12 hours by default.

    getPostgresqlBackupDownloadUrls Result

    The following output properties are available:

    Supporting Types

    GetPostgresqlBackupDownloadUrlsBackupDownloadRestriction

    IpRestrictionEffect string
    Whether IP is allowed. Valid values: ALLOW (allow), DENY (deny).
    IpSets List<string>
    Whether it is allowed to download IP list of the backup files.
    RestrictionType string
    Type of the network restrictions for downloading backup files. Valid values: NONE (backups can be downloaded over both private and public networks), INTRANET (backups can only be downloaded over the private network), CUSTOMIZE (backups can be downloaded over specified VPCs or at specified IPs).
    VpcIdSets List<string>
    Whether it is allowed to download the VPC ID list of the backup files.
    VpcRestrictionEffect string
    Whether VPC is allowed. Valid values: ALLOW (allow), DENY (deny).
    IpRestrictionEffect string
    Whether IP is allowed. Valid values: ALLOW (allow), DENY (deny).
    IpSets []string
    Whether it is allowed to download IP list of the backup files.
    RestrictionType string
    Type of the network restrictions for downloading backup files. Valid values: NONE (backups can be downloaded over both private and public networks), INTRANET (backups can only be downloaded over the private network), CUSTOMIZE (backups can be downloaded over specified VPCs or at specified IPs).
    VpcIdSets []string
    Whether it is allowed to download the VPC ID list of the backup files.
    VpcRestrictionEffect string
    Whether VPC is allowed. Valid values: ALLOW (allow), DENY (deny).
    ipRestrictionEffect String
    Whether IP is allowed. Valid values: ALLOW (allow), DENY (deny).
    ipSets List<String>
    Whether it is allowed to download IP list of the backup files.
    restrictionType String
    Type of the network restrictions for downloading backup files. Valid values: NONE (backups can be downloaded over both private and public networks), INTRANET (backups can only be downloaded over the private network), CUSTOMIZE (backups can be downloaded over specified VPCs or at specified IPs).
    vpcIdSets List<String>
    Whether it is allowed to download the VPC ID list of the backup files.
    vpcRestrictionEffect String
    Whether VPC is allowed. Valid values: ALLOW (allow), DENY (deny).
    ipRestrictionEffect string
    Whether IP is allowed. Valid values: ALLOW (allow), DENY (deny).
    ipSets string[]
    Whether it is allowed to download IP list of the backup files.
    restrictionType string
    Type of the network restrictions for downloading backup files. Valid values: NONE (backups can be downloaded over both private and public networks), INTRANET (backups can only be downloaded over the private network), CUSTOMIZE (backups can be downloaded over specified VPCs or at specified IPs).
    vpcIdSets string[]
    Whether it is allowed to download the VPC ID list of the backup files.
    vpcRestrictionEffect string
    Whether VPC is allowed. Valid values: ALLOW (allow), DENY (deny).
    ip_restriction_effect str
    Whether IP is allowed. Valid values: ALLOW (allow), DENY (deny).
    ip_sets Sequence[str]
    Whether it is allowed to download IP list of the backup files.
    restriction_type str
    Type of the network restrictions for downloading backup files. Valid values: NONE (backups can be downloaded over both private and public networks), INTRANET (backups can only be downloaded over the private network), CUSTOMIZE (backups can be downloaded over specified VPCs or at specified IPs).
    vpc_id_sets Sequence[str]
    Whether it is allowed to download the VPC ID list of the backup files.
    vpc_restriction_effect str
    Whether VPC is allowed. Valid values: ALLOW (allow), DENY (deny).
    ipRestrictionEffect String
    Whether IP is allowed. Valid values: ALLOW (allow), DENY (deny).
    ipSets List<String>
    Whether it is allowed to download IP list of the backup files.
    restrictionType String
    Type of the network restrictions for downloading backup files. Valid values: NONE (backups can be downloaded over both private and public networks), INTRANET (backups can only be downloaded over the private network), CUSTOMIZE (backups can be downloaded over specified VPCs or at specified IPs).
    vpcIdSets List<String>
    Whether it is allowed to download the VPC ID list of the backup files.
    vpcRestrictionEffect String
    Whether VPC is allowed. Valid values: ALLOW (allow), DENY (deny).

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack