1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. backupdisasterrecovery
  5. getBackupPlanAssociations
Google Cloud v9.4.0 published on Tuesday, Nov 4, 2025 by Pulumi

gcp.backupdisasterrecovery.getBackupPlanAssociations

Start a Neo task
Explain and create a gcp.backupdisasterrecovery.getBackupPlanAssociations resource
gcp logo
Google Cloud v9.4.0 published on Tuesday, Nov 4, 2025 by Pulumi

    Provides a list of Backup and DR BackupPlanAssociations for a specific resource type.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const computeInstanceAssociations = gcp.backupdisasterrecovery.getBackupPlanAssociations({
        location: "us-central1",
        resourceType: "compute.googleapis.com/Instance",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    compute_instance_associations = gcp.backupdisasterrecovery.get_backup_plan_associations(location="us-central1",
        resource_type="compute.googleapis.com/Instance")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/backupdisasterrecovery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := backupdisasterrecovery.GetBackupPlanAssociations(ctx, &backupdisasterrecovery.GetBackupPlanAssociationsArgs{
    			Location:     "us-central1",
    			ResourceType: "compute.googleapis.com/Instance",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var computeInstanceAssociations = Gcp.BackupDisasterRecovery.GetBackupPlanAssociations.Invoke(new()
        {
            Location = "us-central1",
            ResourceType = "compute.googleapis.com/Instance",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.backupdisasterrecovery.BackupdisasterrecoveryFunctions;
    import com.pulumi.gcp.backupdisasterrecovery.inputs.GetBackupPlanAssociationsArgs;
    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 computeInstanceAssociations = BackupdisasterrecoveryFunctions.getBackupPlanAssociations(GetBackupPlanAssociationsArgs.builder()
                .location("us-central1")
                .resourceType("compute.googleapis.com/Instance")
                .build());
    
        }
    }
    
    variables:
      computeInstanceAssociations:
        fn::invoke:
          function: gcp:backupdisasterrecovery:getBackupPlanAssociations
          arguments:
            location: us-central1
            resourceType: compute.googleapis.com/Instance
    

    Using getBackupPlanAssociations

    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 getBackupPlanAssociations(args: GetBackupPlanAssociationsArgs, opts?: InvokeOptions): Promise<GetBackupPlanAssociationsResult>
    function getBackupPlanAssociationsOutput(args: GetBackupPlanAssociationsOutputArgs, opts?: InvokeOptions): Output<GetBackupPlanAssociationsResult>
    def get_backup_plan_associations(location: Optional[str] = None,
                                     project: Optional[str] = None,
                                     resource_type: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetBackupPlanAssociationsResult
    def get_backup_plan_associations_output(location: Optional[pulumi.Input[str]] = None,
                                     project: Optional[pulumi.Input[str]] = None,
                                     resource_type: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetBackupPlanAssociationsResult]
    func GetBackupPlanAssociations(ctx *Context, args *GetBackupPlanAssociationsArgs, opts ...InvokeOption) (*GetBackupPlanAssociationsResult, error)
    func GetBackupPlanAssociationsOutput(ctx *Context, args *GetBackupPlanAssociationsOutputArgs, opts ...InvokeOption) GetBackupPlanAssociationsResultOutput

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

    public static class GetBackupPlanAssociations 
    {
        public static Task<GetBackupPlanAssociationsResult> InvokeAsync(GetBackupPlanAssociationsArgs args, InvokeOptions? opts = null)
        public static Output<GetBackupPlanAssociationsResult> Invoke(GetBackupPlanAssociationsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBackupPlanAssociationsResult> getBackupPlanAssociations(GetBackupPlanAssociationsArgs args, InvokeOptions options)
    public static Output<GetBackupPlanAssociationsResult> getBackupPlanAssociations(GetBackupPlanAssociationsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:backupdisasterrecovery/getBackupPlanAssociations:getBackupPlanAssociations
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The location where the Backup Plan Association resources reside.
    ResourceType string
    The resource type of the workload. For example, sqladmin.googleapis.com/Instance or compute.googleapis.com/Instance.


    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    Location string
    The location where the Backup Plan Association resources reside.
    ResourceType string
    The resource type of the workload. For example, sqladmin.googleapis.com/Instance or compute.googleapis.com/Instance.


    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location where the Backup Plan Association resources reside.
    resourceType String
    The resource type of the workload. For example, sqladmin.googleapis.com/Instance or compute.googleapis.com/Instance.


    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.
    location string
    The location where the Backup Plan Association resources reside.
    resourceType string
    The resource type of the workload. For example, sqladmin.googleapis.com/Instance or compute.googleapis.com/Instance.


    project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    location str
    The location where the Backup Plan Association resources reside.
    resource_type str
    The resource type of the workload. For example, sqladmin.googleapis.com/Instance or compute.googleapis.com/Instance.


    project str
    The project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location where the Backup Plan Association resources reside.
    resourceType String
    The resource type of the workload. For example, sqladmin.googleapis.com/Instance or compute.googleapis.com/Instance.


    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.

    getBackupPlanAssociations Result

    The following output properties are available:

    Associations List<GetBackupPlanAssociationsAssociation>
    A list of the backup plan associations found.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Project string
    The ID of the project in which the resource belongs.
    ResourceType string
    Associations []GetBackupPlanAssociationsAssociation
    A list of the backup plan associations found.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Project string
    The ID of the project in which the resource belongs.
    ResourceType string
    associations List<GetBackupPlanAssociationsAssociation>
    A list of the backup plan associations found.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    project String
    The ID of the project in which the resource belongs.
    resourceType String
    associations GetBackupPlanAssociationsAssociation[]
    A list of the backup plan associations found.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    project string
    The ID of the project in which the resource belongs.
    resourceType string
    associations Sequence[GetBackupPlanAssociationsAssociation]
    A list of the backup plan associations found.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    project str
    The ID of the project in which the resource belongs.
    resource_type str
    associations List<Property Map>
    A list of the backup plan associations found.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    project String
    The ID of the project in which the resource belongs.
    resourceType String

    Supporting Types

    GetBackupPlanAssociationsAssociation

    BackupPlan string
    The backup plan to which the resource is attached.
    CreateTime string
    DataSource string
    The resource name of data source which will be used as storage location for backups taken.
    Name string
    The full name of the backup plan association resource.
    Resource string
    The resource to which the backup plan is applied.
    RulesConfigInfos List<GetBackupPlanAssociationsAssociationRulesConfigInfo>
    A list containing information about the backup rules. Each object in the list contains:
    BackupPlan string
    The backup plan to which the resource is attached.
    CreateTime string
    DataSource string
    The resource name of data source which will be used as storage location for backups taken.
    Name string
    The full name of the backup plan association resource.
    Resource string
    The resource to which the backup plan is applied.
    RulesConfigInfos []GetBackupPlanAssociationsAssociationRulesConfigInfo
    A list containing information about the backup rules. Each object in the list contains:
    backupPlan String
    The backup plan to which the resource is attached.
    createTime String
    dataSource String
    The resource name of data source which will be used as storage location for backups taken.
    name String
    The full name of the backup plan association resource.
    resource String
    The resource to which the backup plan is applied.
    rulesConfigInfos List<GetBackupPlanAssociationsAssociationRulesConfigInfo>
    A list containing information about the backup rules. Each object in the list contains:
    backupPlan string
    The backup plan to which the resource is attached.
    createTime string
    dataSource string
    The resource name of data source which will be used as storage location for backups taken.
    name string
    The full name of the backup plan association resource.
    resource string
    The resource to which the backup plan is applied.
    rulesConfigInfos GetBackupPlanAssociationsAssociationRulesConfigInfo[]
    A list containing information about the backup rules. Each object in the list contains:
    backup_plan str
    The backup plan to which the resource is attached.
    create_time str
    data_source str
    The resource name of data source which will be used as storage location for backups taken.
    name str
    The full name of the backup plan association resource.
    resource str
    The resource to which the backup plan is applied.
    rules_config_infos Sequence[GetBackupPlanAssociationsAssociationRulesConfigInfo]
    A list containing information about the backup rules. Each object in the list contains:
    backupPlan String
    The backup plan to which the resource is attached.
    createTime String
    dataSource String
    The resource name of data source which will be used as storage location for backups taken.
    name String
    The full name of the backup plan association resource.
    resource String
    The resource to which the backup plan is applied.
    rulesConfigInfos List<Property Map>
    A list containing information about the backup rules. Each object in the list contains:

    GetBackupPlanAssociationsAssociationRulesConfigInfo

    LastBackupErrors List<GetBackupPlanAssociationsAssociationRulesConfigInfoLastBackupError>
    A block containing details of the last backup error, if any.
    LastBackupState string
    State of last backup taken.
    LastSuccessfulBackupConsistencyTime string
    The point in time when the last successful backup was captured from the source.
    RuleId string
    Backup Rule id fetched from backup plan.
    LastBackupErrors []GetBackupPlanAssociationsAssociationRulesConfigInfoLastBackupError
    A block containing details of the last backup error, if any.
    LastBackupState string
    State of last backup taken.
    LastSuccessfulBackupConsistencyTime string
    The point in time when the last successful backup was captured from the source.
    RuleId string
    Backup Rule id fetched from backup plan.
    lastBackupErrors List<GetBackupPlanAssociationsAssociationRulesConfigInfoLastBackupError>
    A block containing details of the last backup error, if any.
    lastBackupState String
    State of last backup taken.
    lastSuccessfulBackupConsistencyTime String
    The point in time when the last successful backup was captured from the source.
    ruleId String
    Backup Rule id fetched from backup plan.
    lastBackupErrors GetBackupPlanAssociationsAssociationRulesConfigInfoLastBackupError[]
    A block containing details of the last backup error, if any.
    lastBackupState string
    State of last backup taken.
    lastSuccessfulBackupConsistencyTime string
    The point in time when the last successful backup was captured from the source.
    ruleId string
    Backup Rule id fetched from backup plan.
    last_backup_errors Sequence[GetBackupPlanAssociationsAssociationRulesConfigInfoLastBackupError]
    A block containing details of the last backup error, if any.
    last_backup_state str
    State of last backup taken.
    last_successful_backup_consistency_time str
    The point in time when the last successful backup was captured from the source.
    rule_id str
    Backup Rule id fetched from backup plan.
    lastBackupErrors List<Property Map>
    A block containing details of the last backup error, if any.
    lastBackupState String
    State of last backup taken.
    lastSuccessfulBackupConsistencyTime String
    The point in time when the last successful backup was captured from the source.
    ruleId String
    Backup Rule id fetched from backup plan.

    GetBackupPlanAssociationsAssociationRulesConfigInfoLastBackupError

    Code int
    The status code, which should be an enum value of [google.rpc.Code].
    Message string
    A developer-facing error message.
    Code int
    The status code, which should be an enum value of [google.rpc.Code].
    Message string
    A developer-facing error message.
    code Integer
    The status code, which should be an enum value of [google.rpc.Code].
    message String
    A developer-facing error message.
    code number
    The status code, which should be an enum value of [google.rpc.Code].
    message string
    A developer-facing error message.
    code int
    The status code, which should be an enum value of [google.rpc.Code].
    message str
    A developer-facing error message.
    code Number
    The status code, which should be an enum value of [google.rpc.Code].
    message String
    A developer-facing error message.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud v9.4.0 published on Tuesday, Nov 4, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate