1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. backupdisasterrecovery
  5. BackupPlanAssociation
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.backupdisasterrecovery.BackupPlanAssociation

Explore with Pulumi AI

A Backup and DR BackupPlanAssociation.

To get more information about BackupPlanAssociation, see:

Example Usage

Backup Dr Bpa

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const mySA = new gcp.serviceaccount.Account("mySA", {
    accountId: "my-custom",
    displayName: "Custom SA for VM Instance",
});
const myinstance = new gcp.compute.Instance("myinstance", {
    networkInterfaces: [{
        accessConfigs: [{}],
        network: "default",
    }],
    name: "test-instance",
    machineType: "n2-standard-2",
    zone: "us-central1-a",
    bootDisk: {
        initializeParams: {
            image: "debian-cloud/debian-11",
            labels: {
                my_label: "value",
            },
        },
    },
    scratchDisks: [{
        "interface": "NVME",
    }],
    serviceAccount: {
        email: mySA.email,
        scopes: ["cloud-platform"],
    },
});
const bv1 = new gcp.backupdisasterrecovery.BackupVault("bv1", {
    location: "us-central1",
    backupVaultId: "bv-bpa",
    backupMinimumEnforcedRetentionDuration: "100000s",
    forceDelete: true,
});
const bp1 = new gcp.backupdisasterrecovery.BackupPlan("bp1", {
    location: "us-central1",
    backupPlanId: "bp-bpa-test",
    resourceType: "compute.googleapis.com/Instance",
    backupVault: bv1.id,
    backupRules: [{
        ruleId: "rule-1",
        backupRetentionDays: 2,
        standardSchedule: {
            recurrenceType: "HOURLY",
            hourlyFrequency: 6,
            timeZone: "UTC",
            backupWindow: {
                startHourOfDay: 12,
                endHourOfDay: 18,
            },
        },
    }],
});
const my_backup_plan_association = new gcp.backupdisasterrecovery.BackupPlanAssociation("my-backup-plan-association", {
    location: "us-central1",
    resourceType: "compute.googleapis.com/Instance",
    backupPlanAssociationId: "my-bpa",
    resource: myinstance.id,
    backupPlan: bp1.name,
});
Copy
import pulumi
import pulumi_gcp as gcp

my_sa = gcp.serviceaccount.Account("mySA",
    account_id="my-custom",
    display_name="Custom SA for VM Instance")
myinstance = gcp.compute.Instance("myinstance",
    network_interfaces=[{
        "access_configs": [{}],
        "network": "default",
    }],
    name="test-instance",
    machine_type="n2-standard-2",
    zone="us-central1-a",
    boot_disk={
        "initialize_params": {
            "image": "debian-cloud/debian-11",
            "labels": {
                "my_label": "value",
            },
        },
    },
    scratch_disks=[{
        "interface": "NVME",
    }],
    service_account={
        "email": my_sa.email,
        "scopes": ["cloud-platform"],
    })
bv1 = gcp.backupdisasterrecovery.BackupVault("bv1",
    location="us-central1",
    backup_vault_id="bv-bpa",
    backup_minimum_enforced_retention_duration="100000s",
    force_delete=True)
bp1 = gcp.backupdisasterrecovery.BackupPlan("bp1",
    location="us-central1",
    backup_plan_id="bp-bpa-test",
    resource_type="compute.googleapis.com/Instance",
    backup_vault=bv1.id,
    backup_rules=[{
        "rule_id": "rule-1",
        "backup_retention_days": 2,
        "standard_schedule": {
            "recurrence_type": "HOURLY",
            "hourly_frequency": 6,
            "time_zone": "UTC",
            "backup_window": {
                "start_hour_of_day": 12,
                "end_hour_of_day": 18,
            },
        },
    }])
my_backup_plan_association = gcp.backupdisasterrecovery.BackupPlanAssociation("my-backup-plan-association",
    location="us-central1",
    resource_type="compute.googleapis.com/Instance",
    backup_plan_association_id="my-bpa",
    resource=myinstance.id,
    backup_plan=bp1.name)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/backupdisasterrecovery"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/serviceaccount"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		mySA, err := serviceaccount.NewAccount(ctx, "mySA", &serviceaccount.AccountArgs{
			AccountId:   pulumi.String("my-custom"),
			DisplayName: pulumi.String("Custom SA for VM Instance"),
		})
		if err != nil {
			return err
		}
		myinstance, err := compute.NewInstance(ctx, "myinstance", &compute.InstanceArgs{
			NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
				&compute.InstanceNetworkInterfaceArgs{
					AccessConfigs: compute.InstanceNetworkInterfaceAccessConfigArray{
						&compute.InstanceNetworkInterfaceAccessConfigArgs{},
					},
					Network: pulumi.String("default"),
				},
			},
			Name:        pulumi.String("test-instance"),
			MachineType: pulumi.String("n2-standard-2"),
			Zone:        pulumi.String("us-central1-a"),
			BootDisk: &compute.InstanceBootDiskArgs{
				InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
					Image: pulumi.String("debian-cloud/debian-11"),
					Labels: pulumi.StringMap{
						"my_label": pulumi.String("value"),
					},
				},
			},
			ScratchDisks: compute.InstanceScratchDiskArray{
				&compute.InstanceScratchDiskArgs{
					Interface: pulumi.String("NVME"),
				},
			},
			ServiceAccount: &compute.InstanceServiceAccountArgs{
				Email: mySA.Email,
				Scopes: pulumi.StringArray{
					pulumi.String("cloud-platform"),
				},
			},
		})
		if err != nil {
			return err
		}
		bv1, err := backupdisasterrecovery.NewBackupVault(ctx, "bv1", &backupdisasterrecovery.BackupVaultArgs{
			Location:                               pulumi.String("us-central1"),
			BackupVaultId:                          pulumi.String("bv-bpa"),
			BackupMinimumEnforcedRetentionDuration: pulumi.String("100000s"),
			ForceDelete:                            pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		bp1, err := backupdisasterrecovery.NewBackupPlan(ctx, "bp1", &backupdisasterrecovery.BackupPlanArgs{
			Location:     pulumi.String("us-central1"),
			BackupPlanId: pulumi.String("bp-bpa-test"),
			ResourceType: pulumi.String("compute.googleapis.com/Instance"),
			BackupVault:  bv1.ID(),
			BackupRules: backupdisasterrecovery.BackupPlanBackupRuleArray{
				&backupdisasterrecovery.BackupPlanBackupRuleArgs{
					RuleId:              pulumi.String("rule-1"),
					BackupRetentionDays: pulumi.Int(2),
					StandardSchedule: &backupdisasterrecovery.BackupPlanBackupRuleStandardScheduleArgs{
						RecurrenceType:  pulumi.String("HOURLY"),
						HourlyFrequency: pulumi.Int(6),
						TimeZone:        pulumi.String("UTC"),
						BackupWindow: &backupdisasterrecovery.BackupPlanBackupRuleStandardScheduleBackupWindowArgs{
							StartHourOfDay: pulumi.Int(12),
							EndHourOfDay:   pulumi.Int(18),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = backupdisasterrecovery.NewBackupPlanAssociation(ctx, "my-backup-plan-association", &backupdisasterrecovery.BackupPlanAssociationArgs{
			Location:                pulumi.String("us-central1"),
			ResourceType:            pulumi.String("compute.googleapis.com/Instance"),
			BackupPlanAssociationId: pulumi.String("my-bpa"),
			Resource:                myinstance.ID(),
			BackupPlan:              bp1.Name,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var mySA = new Gcp.ServiceAccount.Account("mySA", new()
    {
        AccountId = "my-custom",
        DisplayName = "Custom SA for VM Instance",
    });

    var myinstance = new Gcp.Compute.Instance("myinstance", new()
    {
        NetworkInterfaces = new[]
        {
            new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
            {
                AccessConfigs = new[]
                {
                    null,
                },
                Network = "default",
            },
        },
        Name = "test-instance",
        MachineType = "n2-standard-2",
        Zone = "us-central1-a",
        BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
        {
            InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
            {
                Image = "debian-cloud/debian-11",
                Labels = 
                {
                    { "my_label", "value" },
                },
            },
        },
        ScratchDisks = new[]
        {
            new Gcp.Compute.Inputs.InstanceScratchDiskArgs
            {
                Interface = "NVME",
            },
        },
        ServiceAccount = new Gcp.Compute.Inputs.InstanceServiceAccountArgs
        {
            Email = mySA.Email,
            Scopes = new[]
            {
                "cloud-platform",
            },
        },
    });

    var bv1 = new Gcp.BackupDisasterRecovery.BackupVault("bv1", new()
    {
        Location = "us-central1",
        BackupVaultId = "bv-bpa",
        BackupMinimumEnforcedRetentionDuration = "100000s",
        ForceDelete = true,
    });

    var bp1 = new Gcp.BackupDisasterRecovery.BackupPlan("bp1", new()
    {
        Location = "us-central1",
        BackupPlanId = "bp-bpa-test",
        ResourceType = "compute.googleapis.com/Instance",
        BackupVault = bv1.Id,
        BackupRules = new[]
        {
            new Gcp.BackupDisasterRecovery.Inputs.BackupPlanBackupRuleArgs
            {
                RuleId = "rule-1",
                BackupRetentionDays = 2,
                StandardSchedule = new Gcp.BackupDisasterRecovery.Inputs.BackupPlanBackupRuleStandardScheduleArgs
                {
                    RecurrenceType = "HOURLY",
                    HourlyFrequency = 6,
                    TimeZone = "UTC",
                    BackupWindow = new Gcp.BackupDisasterRecovery.Inputs.BackupPlanBackupRuleStandardScheduleBackupWindowArgs
                    {
                        StartHourOfDay = 12,
                        EndHourOfDay = 18,
                    },
                },
            },
        },
    });

    var my_backup_plan_association = new Gcp.BackupDisasterRecovery.BackupPlanAssociation("my-backup-plan-association", new()
    {
        Location = "us-central1",
        ResourceType = "compute.googleapis.com/Instance",
        BackupPlanAssociationId = "my-bpa",
        Resource = myinstance.Id,
        BackupPlan = bp1.Name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceaccount.Account;
import com.pulumi.gcp.serviceaccount.AccountArgs;
import com.pulumi.gcp.compute.Instance;
import com.pulumi.gcp.compute.InstanceArgs;
import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
import com.pulumi.gcp.compute.inputs.InstanceScratchDiskArgs;
import com.pulumi.gcp.compute.inputs.InstanceServiceAccountArgs;
import com.pulumi.gcp.backupdisasterrecovery.BackupVault;
import com.pulumi.gcp.backupdisasterrecovery.BackupVaultArgs;
import com.pulumi.gcp.backupdisasterrecovery.BackupPlan;
import com.pulumi.gcp.backupdisasterrecovery.BackupPlanArgs;
import com.pulumi.gcp.backupdisasterrecovery.inputs.BackupPlanBackupRuleArgs;
import com.pulumi.gcp.backupdisasterrecovery.inputs.BackupPlanBackupRuleStandardScheduleArgs;
import com.pulumi.gcp.backupdisasterrecovery.inputs.BackupPlanBackupRuleStandardScheduleBackupWindowArgs;
import com.pulumi.gcp.backupdisasterrecovery.BackupPlanAssociation;
import com.pulumi.gcp.backupdisasterrecovery.BackupPlanAssociationArgs;
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 mySA = new Account("mySA", AccountArgs.builder()
            .accountId("my-custom")
            .displayName("Custom SA for VM Instance")
            .build());

        var myinstance = new Instance("myinstance", InstanceArgs.builder()
            .networkInterfaces(InstanceNetworkInterfaceArgs.builder()
                .accessConfigs()
                .network("default")
                .build())
            .name("test-instance")
            .machineType("n2-standard-2")
            .zone("us-central1-a")
            .bootDisk(InstanceBootDiskArgs.builder()
                .initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
                    .image("debian-cloud/debian-11")
                    .labels(Map.of("my_label", "value"))
                    .build())
                .build())
            .scratchDisks(InstanceScratchDiskArgs.builder()
                .interface_("NVME")
                .build())
            .serviceAccount(InstanceServiceAccountArgs.builder()
                .email(mySA.email())
                .scopes("cloud-platform")
                .build())
            .build());

        var bv1 = new BackupVault("bv1", BackupVaultArgs.builder()
            .location("us-central1")
            .backupVaultId("bv-bpa")
            .backupMinimumEnforcedRetentionDuration("100000s")
            .forceDelete("true")
            .build());

        var bp1 = new BackupPlan("bp1", BackupPlanArgs.builder()
            .location("us-central1")
            .backupPlanId("bp-bpa-test")
            .resourceType("compute.googleapis.com/Instance")
            .backupVault(bv1.id())
            .backupRules(BackupPlanBackupRuleArgs.builder()
                .ruleId("rule-1")
                .backupRetentionDays(2)
                .standardSchedule(BackupPlanBackupRuleStandardScheduleArgs.builder()
                    .recurrenceType("HOURLY")
                    .hourlyFrequency(6)
                    .timeZone("UTC")
                    .backupWindow(BackupPlanBackupRuleStandardScheduleBackupWindowArgs.builder()
                        .startHourOfDay(12)
                        .endHourOfDay(18)
                        .build())
                    .build())
                .build())
            .build());

        var my_backup_plan_association = new BackupPlanAssociation("my-backup-plan-association", BackupPlanAssociationArgs.builder()
            .location("us-central1")
            .resourceType("compute.googleapis.com/Instance")
            .backupPlanAssociationId("my-bpa")
            .resource(myinstance.id())
            .backupPlan(bp1.name())
            .build());

    }
}
Copy
resources:
  mySA:
    type: gcp:serviceaccount:Account
    properties:
      accountId: my-custom
      displayName: Custom SA for VM Instance
  myinstance:
    type: gcp:compute:Instance
    properties:
      networkInterfaces:
        - accessConfigs:
            - {}
          network: default
      name: test-instance
      machineType: n2-standard-2
      zone: us-central1-a
      bootDisk:
        initializeParams:
          image: debian-cloud/debian-11
          labels:
            my_label: value
      scratchDisks:
        - interface: NVME
      serviceAccount:
        email: ${mySA.email}
        scopes:
          - cloud-platform
  bv1:
    type: gcp:backupdisasterrecovery:BackupVault
    properties:
      location: us-central1
      backupVaultId: bv-bpa
      backupMinimumEnforcedRetentionDuration: 100000s
      forceDelete: 'true'
  bp1:
    type: gcp:backupdisasterrecovery:BackupPlan
    properties:
      location: us-central1
      backupPlanId: bp-bpa-test
      resourceType: compute.googleapis.com/Instance
      backupVault: ${bv1.id}
      backupRules:
        - ruleId: rule-1
          backupRetentionDays: 2
          standardSchedule:
            recurrenceType: HOURLY
            hourlyFrequency: 6
            timeZone: UTC
            backupWindow:
              startHourOfDay: 12
              endHourOfDay: 18
  my-backup-plan-association:
    type: gcp:backupdisasterrecovery:BackupPlanAssociation
    properties:
      location: us-central1
      resourceType: compute.googleapis.com/Instance
      backupPlanAssociationId: my-bpa
      resource: ${myinstance.id}
      backupPlan: ${bp1.name}
Copy

Create BackupPlanAssociation Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new BackupPlanAssociation(name: string, args: BackupPlanAssociationArgs, opts?: CustomResourceOptions);
@overload
def BackupPlanAssociation(resource_name: str,
                          args: BackupPlanAssociationArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def BackupPlanAssociation(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          backup_plan: Optional[str] = None,
                          backup_plan_association_id: Optional[str] = None,
                          location: Optional[str] = None,
                          resource: Optional[str] = None,
                          resource_type: Optional[str] = None,
                          project: Optional[str] = None)
func NewBackupPlanAssociation(ctx *Context, name string, args BackupPlanAssociationArgs, opts ...ResourceOption) (*BackupPlanAssociation, error)
public BackupPlanAssociation(string name, BackupPlanAssociationArgs args, CustomResourceOptions? opts = null)
public BackupPlanAssociation(String name, BackupPlanAssociationArgs args)
public BackupPlanAssociation(String name, BackupPlanAssociationArgs args, CustomResourceOptions options)
type: gcp:backupdisasterrecovery:BackupPlanAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. BackupPlanAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. BackupPlanAssociationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. BackupPlanAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. BackupPlanAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. BackupPlanAssociationArgs
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 backupPlanAssociationResource = new Gcp.BackupDisasterRecovery.BackupPlanAssociation("backupPlanAssociationResource", new()
{
    BackupPlan = "string",
    BackupPlanAssociationId = "string",
    Location = "string",
    Resource = "string",
    ResourceType = "string",
    Project = "string",
});
Copy
example, err := backupdisasterrecovery.NewBackupPlanAssociation(ctx, "backupPlanAssociationResource", &backupdisasterrecovery.BackupPlanAssociationArgs{
	BackupPlan:              pulumi.String("string"),
	BackupPlanAssociationId: pulumi.String("string"),
	Location:                pulumi.String("string"),
	Resource:                pulumi.String("string"),
	ResourceType:            pulumi.String("string"),
	Project:                 pulumi.String("string"),
})
Copy
var backupPlanAssociationResource = new BackupPlanAssociation("backupPlanAssociationResource", BackupPlanAssociationArgs.builder()
    .backupPlan("string")
    .backupPlanAssociationId("string")
    .location("string")
    .resource("string")
    .resourceType("string")
    .project("string")
    .build());
Copy
backup_plan_association_resource = gcp.backupdisasterrecovery.BackupPlanAssociation("backupPlanAssociationResource",
    backup_plan="string",
    backup_plan_association_id="string",
    location="string",
    resource="string",
    resource_type="string",
    project="string")
Copy
const backupPlanAssociationResource = new gcp.backupdisasterrecovery.BackupPlanAssociation("backupPlanAssociationResource", {
    backupPlan: "string",
    backupPlanAssociationId: "string",
    location: "string",
    resource: "string",
    resourceType: "string",
    project: "string",
});
Copy
type: gcp:backupdisasterrecovery:BackupPlanAssociation
properties:
    backupPlan: string
    backupPlanAssociationId: string
    location: string
    project: string
    resource: string
    resourceType: string
Copy

BackupPlanAssociation 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 BackupPlanAssociation resource accepts the following input properties:

BackupPlan
This property is required.
Changes to this property will trigger replacement.
string
The BP with which resource needs to be created
BackupPlanAssociationId
This property is required.
Changes to this property will trigger replacement.
string
The id of backupplan association


Location
This property is required.
Changes to this property will trigger replacement.
string
The location for the backupplan association
Resource
This property is required.
Changes to this property will trigger replacement.
string
The resource for which BPA needs to be created
ResourceType
This property is required.
Changes to this property will trigger replacement.
string
The resource type of workload on which backupplan is applied
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
BackupPlan
This property is required.
Changes to this property will trigger replacement.
string
The BP with which resource needs to be created
BackupPlanAssociationId
This property is required.
Changes to this property will trigger replacement.
string
The id of backupplan association


Location
This property is required.
Changes to this property will trigger replacement.
string
The location for the backupplan association
Resource
This property is required.
Changes to this property will trigger replacement.
string
The resource for which BPA needs to be created
ResourceType
This property is required.
Changes to this property will trigger replacement.
string
The resource type of workload on which backupplan is applied
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
backupPlan
This property is required.
Changes to this property will trigger replacement.
String
The BP with which resource needs to be created
backupPlanAssociationId
This property is required.
Changes to this property will trigger replacement.
String
The id of backupplan association


location
This property is required.
Changes to this property will trigger replacement.
String
The location for the backupplan association
resource
This property is required.
Changes to this property will trigger replacement.
String
The resource for which BPA needs to be created
resourceType
This property is required.
Changes to this property will trigger replacement.
String
The resource type of workload on which backupplan is applied
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
backupPlan
This property is required.
Changes to this property will trigger replacement.
string
The BP with which resource needs to be created
backupPlanAssociationId
This property is required.
Changes to this property will trigger replacement.
string
The id of backupplan association


location
This property is required.
Changes to this property will trigger replacement.
string
The location for the backupplan association
resource
This property is required.
Changes to this property will trigger replacement.
string
The resource for which BPA needs to be created
resourceType
This property is required.
Changes to this property will trigger replacement.
string
The resource type of workload on which backupplan is applied
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
backup_plan
This property is required.
Changes to this property will trigger replacement.
str
The BP with which resource needs to be created
backup_plan_association_id
This property is required.
Changes to this property will trigger replacement.
str
The id of backupplan association


location
This property is required.
Changes to this property will trigger replacement.
str
The location for the backupplan association
resource
This property is required.
Changes to this property will trigger replacement.
str
The resource for which BPA needs to be created
resource_type
This property is required.
Changes to this property will trigger replacement.
str
The resource type of workload on which backupplan is applied
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
backupPlan
This property is required.
Changes to this property will trigger replacement.
String
The BP with which resource needs to be created
backupPlanAssociationId
This property is required.
Changes to this property will trigger replacement.
String
The id of backupplan association


location
This property is required.
Changes to this property will trigger replacement.
String
The location for the backupplan association
resource
This property is required.
Changes to this property will trigger replacement.
String
The resource for which BPA needs to be created
resourceType
This property is required.
Changes to this property will trigger replacement.
String
The resource type of workload on which backupplan is applied
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Outputs

All input properties are implicitly available as output properties. Additionally, the BackupPlanAssociation resource produces the following output properties:

CreateTime string
The time when the instance was created
DataSource string
Resource name of data source which will be used as storage location for backups taken
Id string
The provider-assigned unique ID for this managed resource.
LastSuccessfulBackupConsistencyTime string
The point in time when the last successful backup was captured from the source
Name string
The name of backup plan association resource created
RulesConfigInfos List<BackupPlanAssociationRulesConfigInfo>
Message for rules config info Structure is documented below.
UpdateTime string
The time when the instance was updated.
CreateTime string
The time when the instance was created
DataSource string
Resource name of data source which will be used as storage location for backups taken
Id string
The provider-assigned unique ID for this managed resource.
LastSuccessfulBackupConsistencyTime string
The point in time when the last successful backup was captured from the source
Name string
The name of backup plan association resource created
RulesConfigInfos []BackupPlanAssociationRulesConfigInfo
Message for rules config info Structure is documented below.
UpdateTime string
The time when the instance was updated.
createTime String
The time when the instance was created
dataSource String
Resource name of data source which will be used as storage location for backups taken
id String
The provider-assigned unique ID for this managed resource.
lastSuccessfulBackupConsistencyTime String
The point in time when the last successful backup was captured from the source
name String
The name of backup plan association resource created
rulesConfigInfos List<BackupPlanAssociationRulesConfigInfo>
Message for rules config info Structure is documented below.
updateTime String
The time when the instance was updated.
createTime string
The time when the instance was created
dataSource string
Resource name of data source which will be used as storage location for backups taken
id string
The provider-assigned unique ID for this managed resource.
lastSuccessfulBackupConsistencyTime string
The point in time when the last successful backup was captured from the source
name string
The name of backup plan association resource created
rulesConfigInfos BackupPlanAssociationRulesConfigInfo[]
Message for rules config info Structure is documented below.
updateTime string
The time when the instance was updated.
create_time str
The time when the instance was created
data_source str
Resource name of data source which will be used as storage location for backups taken
id str
The provider-assigned unique ID for this managed resource.
last_successful_backup_consistency_time str
The point in time when the last successful backup was captured from the source
name str
The name of backup plan association resource created
rules_config_infos Sequence[BackupPlanAssociationRulesConfigInfo]
Message for rules config info Structure is documented below.
update_time str
The time when the instance was updated.
createTime String
The time when the instance was created
dataSource String
Resource name of data source which will be used as storage location for backups taken
id String
The provider-assigned unique ID for this managed resource.
lastSuccessfulBackupConsistencyTime String
The point in time when the last successful backup was captured from the source
name String
The name of backup plan association resource created
rulesConfigInfos List<Property Map>
Message for rules config info Structure is documented below.
updateTime String
The time when the instance was updated.

Look up Existing BackupPlanAssociation Resource

Get an existing BackupPlanAssociation 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?: BackupPlanAssociationState, opts?: CustomResourceOptions): BackupPlanAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backup_plan: Optional[str] = None,
        backup_plan_association_id: Optional[str] = None,
        create_time: Optional[str] = None,
        data_source: Optional[str] = None,
        last_successful_backup_consistency_time: Optional[str] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        resource: Optional[str] = None,
        resource_type: Optional[str] = None,
        rules_config_infos: Optional[Sequence[BackupPlanAssociationRulesConfigInfoArgs]] = None,
        update_time: Optional[str] = None) -> BackupPlanAssociation
func GetBackupPlanAssociation(ctx *Context, name string, id IDInput, state *BackupPlanAssociationState, opts ...ResourceOption) (*BackupPlanAssociation, error)
public static BackupPlanAssociation Get(string name, Input<string> id, BackupPlanAssociationState? state, CustomResourceOptions? opts = null)
public static BackupPlanAssociation get(String name, Output<String> id, BackupPlanAssociationState state, CustomResourceOptions options)
resources:  _:    type: gcp:backupdisasterrecovery:BackupPlanAssociation    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
BackupPlan Changes to this property will trigger replacement. string
The BP with which resource needs to be created
BackupPlanAssociationId Changes to this property will trigger replacement. string
The id of backupplan association


CreateTime string
The time when the instance was created
DataSource string
Resource name of data source which will be used as storage location for backups taken
LastSuccessfulBackupConsistencyTime string
The point in time when the last successful backup was captured from the source
Location Changes to this property will trigger replacement. string
The location for the backupplan association
Name string
The name of backup plan association resource created
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Resource Changes to this property will trigger replacement. string
The resource for which BPA needs to be created
ResourceType Changes to this property will trigger replacement. string
The resource type of workload on which backupplan is applied
RulesConfigInfos List<BackupPlanAssociationRulesConfigInfo>
Message for rules config info Structure is documented below.
UpdateTime string
The time when the instance was updated.
BackupPlan Changes to this property will trigger replacement. string
The BP with which resource needs to be created
BackupPlanAssociationId Changes to this property will trigger replacement. string
The id of backupplan association


CreateTime string
The time when the instance was created
DataSource string
Resource name of data source which will be used as storage location for backups taken
LastSuccessfulBackupConsistencyTime string
The point in time when the last successful backup was captured from the source
Location Changes to this property will trigger replacement. string
The location for the backupplan association
Name string
The name of backup plan association resource created
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Resource Changes to this property will trigger replacement. string
The resource for which BPA needs to be created
ResourceType Changes to this property will trigger replacement. string
The resource type of workload on which backupplan is applied
RulesConfigInfos []BackupPlanAssociationRulesConfigInfoArgs
Message for rules config info Structure is documented below.
UpdateTime string
The time when the instance was updated.
backupPlan Changes to this property will trigger replacement. String
The BP with which resource needs to be created
backupPlanAssociationId Changes to this property will trigger replacement. String
The id of backupplan association


createTime String
The time when the instance was created
dataSource String
Resource name of data source which will be used as storage location for backups taken
lastSuccessfulBackupConsistencyTime String
The point in time when the last successful backup was captured from the source
location Changes to this property will trigger replacement. String
The location for the backupplan association
name String
The name of backup plan association resource created
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
resource Changes to this property will trigger replacement. String
The resource for which BPA needs to be created
resourceType Changes to this property will trigger replacement. String
The resource type of workload on which backupplan is applied
rulesConfigInfos List<BackupPlanAssociationRulesConfigInfo>
Message for rules config info Structure is documented below.
updateTime String
The time when the instance was updated.
backupPlan Changes to this property will trigger replacement. string
The BP with which resource needs to be created
backupPlanAssociationId Changes to this property will trigger replacement. string
The id of backupplan association


createTime string
The time when the instance was created
dataSource string
Resource name of data source which will be used as storage location for backups taken
lastSuccessfulBackupConsistencyTime string
The point in time when the last successful backup was captured from the source
location Changes to this property will trigger replacement. string
The location for the backupplan association
name string
The name of backup plan association resource created
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
resource Changes to this property will trigger replacement. string
The resource for which BPA needs to be created
resourceType Changes to this property will trigger replacement. string
The resource type of workload on which backupplan is applied
rulesConfigInfos BackupPlanAssociationRulesConfigInfo[]
Message for rules config info Structure is documented below.
updateTime string
The time when the instance was updated.
backup_plan Changes to this property will trigger replacement. str
The BP with which resource needs to be created
backup_plan_association_id Changes to this property will trigger replacement. str
The id of backupplan association


create_time str
The time when the instance was created
data_source str
Resource name of data source which will be used as storage location for backups taken
last_successful_backup_consistency_time str
The point in time when the last successful backup was captured from the source
location Changes to this property will trigger replacement. str
The location for the backupplan association
name str
The name of backup plan association resource created
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
resource Changes to this property will trigger replacement. str
The resource for which BPA needs to be created
resource_type Changes to this property will trigger replacement. str
The resource type of workload on which backupplan is applied
rules_config_infos Sequence[BackupPlanAssociationRulesConfigInfoArgs]
Message for rules config info Structure is documented below.
update_time str
The time when the instance was updated.
backupPlan Changes to this property will trigger replacement. String
The BP with which resource needs to be created
backupPlanAssociationId Changes to this property will trigger replacement. String
The id of backupplan association


createTime String
The time when the instance was created
dataSource String
Resource name of data source which will be used as storage location for backups taken
lastSuccessfulBackupConsistencyTime String
The point in time when the last successful backup was captured from the source
location Changes to this property will trigger replacement. String
The location for the backupplan association
name String
The name of backup plan association resource created
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
resource Changes to this property will trigger replacement. String
The resource for which BPA needs to be created
resourceType Changes to this property will trigger replacement. String
The resource type of workload on which backupplan is applied
rulesConfigInfos List<Property Map>
Message for rules config info Structure is documented below.
updateTime String
The time when the instance was updated.

Supporting Types

BackupPlanAssociationRulesConfigInfo
, BackupPlanAssociationRulesConfigInfoArgs

LastBackupErrors List<BackupPlanAssociationRulesConfigInfoLastBackupError>
(Output) google.rpc.Status object to store the last backup error Structure is documented below.
LastBackupState string
(Output) State of last backup taken.
RuleId string
(Output) Backup Rule id fetched from backup plan.
LastBackupErrors []BackupPlanAssociationRulesConfigInfoLastBackupError
(Output) google.rpc.Status object to store the last backup error Structure is documented below.
LastBackupState string
(Output) State of last backup taken.
RuleId string
(Output) Backup Rule id fetched from backup plan.
lastBackupErrors List<BackupPlanAssociationRulesConfigInfoLastBackupError>
(Output) google.rpc.Status object to store the last backup error Structure is documented below.
lastBackupState String
(Output) State of last backup taken.
ruleId String
(Output) Backup Rule id fetched from backup plan.
lastBackupErrors BackupPlanAssociationRulesConfigInfoLastBackupError[]
(Output) google.rpc.Status object to store the last backup error Structure is documented below.
lastBackupState string
(Output) State of last backup taken.
ruleId string
(Output) Backup Rule id fetched from backup plan.
last_backup_errors Sequence[BackupPlanAssociationRulesConfigInfoLastBackupError]
(Output) google.rpc.Status object to store the last backup error Structure is documented below.
last_backup_state str
(Output) State of last backup taken.
rule_id str
(Output) Backup Rule id fetched from backup plan.
lastBackupErrors List<Property Map>
(Output) google.rpc.Status object to store the last backup error Structure is documented below.
lastBackupState String
(Output) State of last backup taken.
ruleId String
(Output) Backup Rule id fetched from backup plan.

BackupPlanAssociationRulesConfigInfoLastBackupError
, BackupPlanAssociationRulesConfigInfoLastBackupErrorArgs

Code double
(Output) The status code, which should be an enum value of [google.rpc.Code]
Message string
(Output) A developer-facing error message, which should be in English.
Code float64
(Output) The status code, which should be an enum value of [google.rpc.Code]
Message string
(Output) A developer-facing error message, which should be in English.
code Double
(Output) The status code, which should be an enum value of [google.rpc.Code]
message String
(Output) A developer-facing error message, which should be in English.
code number
(Output) The status code, which should be an enum value of [google.rpc.Code]
message string
(Output) A developer-facing error message, which should be in English.
code float
(Output) The status code, which should be an enum value of [google.rpc.Code]
message str
(Output) A developer-facing error message, which should be in English.
code Number
(Output) The status code, which should be an enum value of [google.rpc.Code]
message String
(Output) A developer-facing error message, which should be in English.

Import

BackupPlanAssociation can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/backupPlanAssociations/{{backup_plan_association_id}}

  • {{project}}/{{location}}/{{backup_plan_association_id}}

  • {{location}}/{{backup_plan_association_id}}

When using the pulumi import command, BackupPlanAssociation can be imported using one of the formats above. For example:

$ pulumi import gcp:backupdisasterrecovery/backupPlanAssociation:BackupPlanAssociation default projects/{{project}}/locations/{{location}}/backupPlanAssociations/{{backup_plan_association_id}}
Copy
$ pulumi import gcp:backupdisasterrecovery/backupPlanAssociation:BackupPlanAssociation default {{project}}/{{location}}/{{backup_plan_association_id}}
Copy
$ pulumi import gcp:backupdisasterrecovery/backupPlanAssociation:BackupPlanAssociation default {{location}}/{{backup_plan_association_id}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

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.