1. Registry
  2. Packages
  3. Google Cloud (GCP)
  4. API Docs
  5. backupdisasterrecovery
  6. AutoProtectionPolicy
Viewing docs for Google Cloud v10.2.0
published on Tuesday, Oct 20, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v10.2.0
published on Tuesday, Oct 20, 2026 by Pulumi

    An AutoProtectionPolicy automates backup management by applying a backup plan to all eligible resources that match the policy’s criteria, instead of protecting each resource individually. A policy takes effect only after it is attached to a scope, such as a project, with a googleBackupDrAutoProtectionPolicyBinding.

    Warning: This resource is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.

    To get more information about AutoProtectionPolicy, see:

    Example Usage

    Backup Dr Auto Protection Policy Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const myBackupVault = new gcp.backupdisasterrecovery.BackupVault("my_backup_vault", {
        location: "us-central1",
        backupVaultId: "bv-app",
        backupMinimumEnforcedRetentionDuration: "100000s",
    });
    const myBackupPlan = new gcp.backupdisasterrecovery.BackupPlan("my_backup_plan", {
        location: "us-central1",
        backupPlanId: "bp-app",
        resourceType: "compute.googleapis.com/Instance",
        backupVault: myBackupVault.id,
        backupRules: [{
            ruleId: "rule-1",
            backupRetentionDays: 5,
            standardSchedule: {
                recurrenceType: "HOURLY",
                hourlyFrequency: 6,
                timeZone: "UTC",
                backupWindow: {
                    startHourOfDay: 0,
                    endHourOfDay: 24,
                },
            },
        }],
    });
    const my_auto_protection_policy = new gcp.backupdisasterrecovery.AutoProtectionPolicy("my-auto-protection-policy", {
        location: "us-central1",
        autoProtectionPolicyId: "app",
        criteria: {
            matchingConditions: [{
                labelCondition: {
                    key: "env",
                    values: ["prod"],
                },
            }],
        },
        backupPlanDetails: [{
            resourceType: "compute.googleapis.com/Instance",
            backupPlan: myBackupPlan.name,
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_backup_vault = gcp.backupdisasterrecovery.BackupVault("my_backup_vault",
        location="us-central1",
        backup_vault_id="bv-app",
        backup_minimum_enforced_retention_duration="100000s")
    my_backup_plan = gcp.backupdisasterrecovery.BackupPlan("my_backup_plan",
        location="us-central1",
        backup_plan_id="bp-app",
        resource_type="compute.googleapis.com/Instance",
        backup_vault=my_backup_vault.id,
        backup_rules=[{
            "rule_id": "rule-1",
            "backup_retention_days": 5,
            "standard_schedule": {
                "recurrence_type": "HOURLY",
                "hourly_frequency": 6,
                "time_zone": "UTC",
                "backup_window": {
                    "start_hour_of_day": 0,
                    "end_hour_of_day": 24,
                },
            },
        }])
    my_auto_protection_policy = gcp.backupdisasterrecovery.AutoProtectionPolicy("my-auto-protection-policy",
        location="us-central1",
        auto_protection_policy_id="app",
        criteria={
            "matching_conditions": [{
                "label_condition": {
                    "key": "env",
                    "values": ["prod"],
                },
            }],
        },
        backup_plan_details=[{
            "resource_type": "compute.googleapis.com/Instance",
            "backup_plan": my_backup_plan.name,
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/backupdisasterrecovery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myBackupVault, err := backupdisasterrecovery.NewBackupVault(ctx, "my_backup_vault", &backupdisasterrecovery.BackupVaultArgs{
    			Location:                               pulumi.String("us-central1"),
    			BackupVaultId:                          pulumi.String("bv-app"),
    			BackupMinimumEnforcedRetentionDuration: pulumi.String("100000s"),
    		})
    		if err != nil {
    			return err
    		}
    		myBackupPlan, err := backupdisasterrecovery.NewBackupPlan(ctx, "my_backup_plan", &backupdisasterrecovery.BackupPlanArgs{
    			Location:     pulumi.String("us-central1"),
    			BackupPlanId: pulumi.String("bp-app"),
    			ResourceType: pulumi.String("compute.googleapis.com/Instance"),
    			BackupVault:  myBackupVault.ID(),
    			BackupRules: backupdisasterrecovery.BackupPlanBackupRuleArray{
    				&backupdisasterrecovery.BackupPlanBackupRuleArgs{
    					RuleId:              pulumi.String("rule-1"),
    					BackupRetentionDays: pulumi.Int(5),
    					StandardSchedule: &backupdisasterrecovery.BackupPlanBackupRuleStandardScheduleArgs{
    						RecurrenceType:  pulumi.String("HOURLY"),
    						HourlyFrequency: pulumi.Int(6),
    						TimeZone:        pulumi.String("UTC"),
    						BackupWindow: &backupdisasterrecovery.BackupPlanBackupRuleStandardScheduleBackupWindowArgs{
    							StartHourOfDay: pulumi.Int(0),
    							EndHourOfDay:   pulumi.Int(24),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = backupdisasterrecovery.NewAutoProtectionPolicy(ctx, "my-auto-protection-policy", &backupdisasterrecovery.AutoProtectionPolicyArgs{
    			Location:               pulumi.String("us-central1"),
    			AutoProtectionPolicyId: pulumi.String("app"),
    			Criteria: &backupdisasterrecovery.AutoProtectionPolicyCriteriaArgs{
    				MatchingConditions: backupdisasterrecovery.AutoProtectionPolicyCriteriaMatchingConditionArray{
    					&backupdisasterrecovery.AutoProtectionPolicyCriteriaMatchingConditionArgs{
    						LabelCondition: &backupdisasterrecovery.AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs{
    							Key: pulumi.String("env"),
    							Values: pulumi.StringArray{
    								pulumi.String("prod"),
    							},
    						},
    					},
    				},
    			},
    			BackupPlanDetails: backupdisasterrecovery.AutoProtectionPolicyBackupPlanDetailArray{
    				&backupdisasterrecovery.AutoProtectionPolicyBackupPlanDetailArgs{
    					ResourceType: pulumi.String("compute.googleapis.com/Instance"),
    					BackupPlan:   myBackupPlan.Name,
    				},
    			},
    		})
    		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 myBackupVault = new Gcp.BackupDisasterRecovery.BackupVault("my_backup_vault", new()
        {
            Location = "us-central1",
            BackupVaultId = "bv-app",
            BackupMinimumEnforcedRetentionDuration = "100000s",
        });
    
        var myBackupPlan = new Gcp.BackupDisasterRecovery.BackupPlan("my_backup_plan", new()
        {
            Location = "us-central1",
            BackupPlanId = "bp-app",
            ResourceType = "compute.googleapis.com/Instance",
            BackupVault = myBackupVault.Id,
            BackupRules = new[]
            {
                new Gcp.BackupDisasterRecovery.Inputs.BackupPlanBackupRuleArgs
                {
                    RuleId = "rule-1",
                    BackupRetentionDays = 5,
                    StandardSchedule = new Gcp.BackupDisasterRecovery.Inputs.BackupPlanBackupRuleStandardScheduleArgs
                    {
                        RecurrenceType = "HOURLY",
                        HourlyFrequency = 6,
                        TimeZone = "UTC",
                        BackupWindow = new Gcp.BackupDisasterRecovery.Inputs.BackupPlanBackupRuleStandardScheduleBackupWindowArgs
                        {
                            StartHourOfDay = 0,
                            EndHourOfDay = 24,
                        },
                    },
                },
            },
        });
    
        var my_auto_protection_policy = new Gcp.BackupDisasterRecovery.AutoProtectionPolicy("my-auto-protection-policy", new()
        {
            Location = "us-central1",
            AutoProtectionPolicyId = "app",
            Criteria = new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyCriteriaArgs
            {
                MatchingConditions = new[]
                {
                    new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyCriteriaMatchingConditionArgs
                    {
                        LabelCondition = new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs
                        {
                            Key = "env",
                            Values = new[]
                            {
                                "prod",
                            },
                        },
                    },
                },
            },
            BackupPlanDetails = new[]
            {
                new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyBackupPlanDetailArgs
                {
                    ResourceType = "compute.googleapis.com/Instance",
                    BackupPlan = myBackupPlan.Name,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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.AutoProtectionPolicy;
    import com.pulumi.gcp.backupdisasterrecovery.AutoProtectionPolicyArgs;
    import com.pulumi.gcp.backupdisasterrecovery.inputs.AutoProtectionPolicyCriteriaArgs;
    import com.pulumi.gcp.backupdisasterrecovery.inputs.AutoProtectionPolicyCriteriaMatchingConditionArgs;
    import com.pulumi.gcp.backupdisasterrecovery.inputs.AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs;
    import com.pulumi.gcp.backupdisasterrecovery.inputs.AutoProtectionPolicyBackupPlanDetailArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 myBackupVault = new BackupVault("myBackupVault", BackupVaultArgs.builder()
                .location("us-central1")
                .backupVaultId("bv-app")
                .backupMinimumEnforcedRetentionDuration("100000s")
                .build());
    
            var myBackupPlan = new BackupPlan("myBackupPlan", BackupPlanArgs.builder()
                .location("us-central1")
                .backupPlanId("bp-app")
                .resourceType("compute.googleapis.com/Instance")
                .backupVault(myBackupVault.id())
                .backupRules(BackupPlanBackupRuleArgs.builder()
                    .ruleId("rule-1")
                    .backupRetentionDays(5)
                    .standardSchedule(BackupPlanBackupRuleStandardScheduleArgs.builder()
                        .recurrenceType("HOURLY")
                        .hourlyFrequency(6)
                        .timeZone("UTC")
                        .backupWindow(BackupPlanBackupRuleStandardScheduleBackupWindowArgs.builder()
                            .startHourOfDay(0)
                            .endHourOfDay(24)
                            .build())
                        .build())
                    .build())
                .build());
    
            var my_auto_protection_policy = new AutoProtectionPolicy("my-auto-protection-policy", AutoProtectionPolicyArgs.builder()
                .location("us-central1")
                .autoProtectionPolicyId("app")
                .criteria(AutoProtectionPolicyCriteriaArgs.builder()
                    .matchingConditions(AutoProtectionPolicyCriteriaMatchingConditionArgs.builder()
                        .labelCondition(AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs.builder()
                            .key("env")
                            .values("prod")
                            .build())
                        .build())
                    .build())
                .backupPlanDetails(AutoProtectionPolicyBackupPlanDetailArgs.builder()
                    .resourceType("compute.googleapis.com/Instance")
                    .backupPlan(myBackupPlan.name())
                    .build())
                .build());
    
        }
    }
    
    resources:
      myBackupVault:
        type: gcp:backupdisasterrecovery:BackupVault
        name: my_backup_vault
        properties:
          location: us-central1
          backupVaultId: bv-app
          backupMinimumEnforcedRetentionDuration: 100000s
      myBackupPlan:
        type: gcp:backupdisasterrecovery:BackupPlan
        name: my_backup_plan
        properties:
          location: us-central1
          backupPlanId: bp-app
          resourceType: compute.googleapis.com/Instance
          backupVault: ${myBackupVault.id}
          backupRules:
            - ruleId: rule-1
              backupRetentionDays: 5
              standardSchedule:
                recurrenceType: HOURLY
                hourlyFrequency: 6
                timeZone: UTC
                backupWindow:
                  startHourOfDay: 0
                  endHourOfDay: 24
      my-auto-protection-policy:
        type: gcp:backupdisasterrecovery:AutoProtectionPolicy
        properties:
          location: us-central1
          autoProtectionPolicyId: app
          criteria:
            matchingConditions:
              - labelCondition:
                  key: env
                  values:
                    - prod
          backupPlanDetails:
            - resourceType: compute.googleapis.com/Instance
              backupPlan: ${myBackupPlan.name}
    
    terraform {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    resource "gcp_backupdisasterrecovery_backup_vault" "my_backup_vault" {
      lifecycle {
        create_before_destroy = true
      }
      location                                   = "us-central1"
      backup_vault_id                            = "bv-app"
      backup_minimum_enforced_retention_duration = "100000s"
    }
    resource "gcp_backupdisasterrecovery_backup_plan" "my_backup_plan" {
      lifecycle {
        create_before_destroy = true
      }
      location       = "us-central1"
      backup_plan_id = "bp-app"
      resource_type  = "compute.googleapis.com/Instance"
      backup_vault   = gcp_backupdisasterrecovery_backup_vault.my_backup_vault.id
      backup_rules {
        rule_id               = "rule-1"
        backup_retention_days = 5
        standard_schedule = {
          recurrence_type  = "HOURLY"
          hourly_frequency = 6
          time_zone        = "UTC"
          backup_window = {
            start_hour_of_day = 0
            end_hour_of_day   = 24
          }
        }
      }
    }
    resource "gcp_backupdisasterrecovery_auto_protection_policy" "my-auto-protection-policy" {
      lifecycle {
        create_before_destroy = true
      }
      location                  = "us-central1"
      auto_protection_policy_id = "app"
      criteria = {
        matching_conditions = [{
          label_condition = {
            key    = "env"
            values = ["prod"]
          }
        }]
      }
      backup_plan_details {
        resource_type = "compute.googleapis.com/Instance"
        backup_plan   = gcp_backupdisasterrecovery_backup_plan.my_backup_plan.name
      }
    }
    

    Backup Dr Auto Protection Policy Full

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const myBackupVault = new gcp.backupdisasterrecovery.BackupVault("my_backup_vault", {
        location: "us-central1",
        backupVaultId: "bv-app-update",
        backupMinimumEnforcedRetentionDuration: "100000s",
    });
    const instanceBackupPlan = new gcp.backupdisasterrecovery.BackupPlan("instance_backup_plan", {
        location: "us-central1",
        backupPlanId: "bp-app-update-vm",
        resourceType: "compute.googleapis.com/Instance",
        backupVault: myBackupVault.id,
        backupRules: [{
            ruleId: "rule-1",
            backupRetentionDays: 5,
            standardSchedule: {
                recurrenceType: "HOURLY",
                hourlyFrequency: 6,
                timeZone: "UTC",
                backupWindow: {
                    startHourOfDay: 0,
                    endHourOfDay: 24,
                },
            },
        }],
    });
    const my_auto_protection_policy = new gcp.backupdisasterrecovery.AutoProtectionPolicy("my-auto-protection-policy", {
        location: "us-central1",
        autoProtectionPolicyId: "app-update",
        description: "Protects production VMs.",
        criteria: {
            matchingConditions: [{
                labelCondition: {
                    key: "env",
                    values: ["prod"],
                },
            }],
        },
        backupPlanDetails: [{
            resourceType: "compute.googleapis.com/Instance",
            backupPlan: instanceBackupPlan.name,
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_backup_vault = gcp.backupdisasterrecovery.BackupVault("my_backup_vault",
        location="us-central1",
        backup_vault_id="bv-app-update",
        backup_minimum_enforced_retention_duration="100000s")
    instance_backup_plan = gcp.backupdisasterrecovery.BackupPlan("instance_backup_plan",
        location="us-central1",
        backup_plan_id="bp-app-update-vm",
        resource_type="compute.googleapis.com/Instance",
        backup_vault=my_backup_vault.id,
        backup_rules=[{
            "rule_id": "rule-1",
            "backup_retention_days": 5,
            "standard_schedule": {
                "recurrence_type": "HOURLY",
                "hourly_frequency": 6,
                "time_zone": "UTC",
                "backup_window": {
                    "start_hour_of_day": 0,
                    "end_hour_of_day": 24,
                },
            },
        }])
    my_auto_protection_policy = gcp.backupdisasterrecovery.AutoProtectionPolicy("my-auto-protection-policy",
        location="us-central1",
        auto_protection_policy_id="app-update",
        description="Protects production VMs.",
        criteria={
            "matching_conditions": [{
                "label_condition": {
                    "key": "env",
                    "values": ["prod"],
                },
            }],
        },
        backup_plan_details=[{
            "resource_type": "compute.googleapis.com/Instance",
            "backup_plan": instance_backup_plan.name,
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/backupdisasterrecovery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myBackupVault, err := backupdisasterrecovery.NewBackupVault(ctx, "my_backup_vault", &backupdisasterrecovery.BackupVaultArgs{
    			Location:                               pulumi.String("us-central1"),
    			BackupVaultId:                          pulumi.String("bv-app-update"),
    			BackupMinimumEnforcedRetentionDuration: pulumi.String("100000s"),
    		})
    		if err != nil {
    			return err
    		}
    		instanceBackupPlan, err := backupdisasterrecovery.NewBackupPlan(ctx, "instance_backup_plan", &backupdisasterrecovery.BackupPlanArgs{
    			Location:     pulumi.String("us-central1"),
    			BackupPlanId: pulumi.String("bp-app-update-vm"),
    			ResourceType: pulumi.String("compute.googleapis.com/Instance"),
    			BackupVault:  myBackupVault.ID(),
    			BackupRules: backupdisasterrecovery.BackupPlanBackupRuleArray{
    				&backupdisasterrecovery.BackupPlanBackupRuleArgs{
    					RuleId:              pulumi.String("rule-1"),
    					BackupRetentionDays: pulumi.Int(5),
    					StandardSchedule: &backupdisasterrecovery.BackupPlanBackupRuleStandardScheduleArgs{
    						RecurrenceType:  pulumi.String("HOURLY"),
    						HourlyFrequency: pulumi.Int(6),
    						TimeZone:        pulumi.String("UTC"),
    						BackupWindow: &backupdisasterrecovery.BackupPlanBackupRuleStandardScheduleBackupWindowArgs{
    							StartHourOfDay: pulumi.Int(0),
    							EndHourOfDay:   pulumi.Int(24),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = backupdisasterrecovery.NewAutoProtectionPolicy(ctx, "my-auto-protection-policy", &backupdisasterrecovery.AutoProtectionPolicyArgs{
    			Location:               pulumi.String("us-central1"),
    			AutoProtectionPolicyId: pulumi.String("app-update"),
    			Description:            pulumi.String("Protects production VMs."),
    			Criteria: &backupdisasterrecovery.AutoProtectionPolicyCriteriaArgs{
    				MatchingConditions: backupdisasterrecovery.AutoProtectionPolicyCriteriaMatchingConditionArray{
    					&backupdisasterrecovery.AutoProtectionPolicyCriteriaMatchingConditionArgs{
    						LabelCondition: &backupdisasterrecovery.AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs{
    							Key: pulumi.String("env"),
    							Values: pulumi.StringArray{
    								pulumi.String("prod"),
    							},
    						},
    					},
    				},
    			},
    			BackupPlanDetails: backupdisasterrecovery.AutoProtectionPolicyBackupPlanDetailArray{
    				&backupdisasterrecovery.AutoProtectionPolicyBackupPlanDetailArgs{
    					ResourceType: pulumi.String("compute.googleapis.com/Instance"),
    					BackupPlan:   instanceBackupPlan.Name,
    				},
    			},
    		})
    		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 myBackupVault = new Gcp.BackupDisasterRecovery.BackupVault("my_backup_vault", new()
        {
            Location = "us-central1",
            BackupVaultId = "bv-app-update",
            BackupMinimumEnforcedRetentionDuration = "100000s",
        });
    
        var instanceBackupPlan = new Gcp.BackupDisasterRecovery.BackupPlan("instance_backup_plan", new()
        {
            Location = "us-central1",
            BackupPlanId = "bp-app-update-vm",
            ResourceType = "compute.googleapis.com/Instance",
            BackupVault = myBackupVault.Id,
            BackupRules = new[]
            {
                new Gcp.BackupDisasterRecovery.Inputs.BackupPlanBackupRuleArgs
                {
                    RuleId = "rule-1",
                    BackupRetentionDays = 5,
                    StandardSchedule = new Gcp.BackupDisasterRecovery.Inputs.BackupPlanBackupRuleStandardScheduleArgs
                    {
                        RecurrenceType = "HOURLY",
                        HourlyFrequency = 6,
                        TimeZone = "UTC",
                        BackupWindow = new Gcp.BackupDisasterRecovery.Inputs.BackupPlanBackupRuleStandardScheduleBackupWindowArgs
                        {
                            StartHourOfDay = 0,
                            EndHourOfDay = 24,
                        },
                    },
                },
            },
        });
    
        var my_auto_protection_policy = new Gcp.BackupDisasterRecovery.AutoProtectionPolicy("my-auto-protection-policy", new()
        {
            Location = "us-central1",
            AutoProtectionPolicyId = "app-update",
            Description = "Protects production VMs.",
            Criteria = new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyCriteriaArgs
            {
                MatchingConditions = new[]
                {
                    new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyCriteriaMatchingConditionArgs
                    {
                        LabelCondition = new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs
                        {
                            Key = "env",
                            Values = new[]
                            {
                                "prod",
                            },
                        },
                    },
                },
            },
            BackupPlanDetails = new[]
            {
                new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyBackupPlanDetailArgs
                {
                    ResourceType = "compute.googleapis.com/Instance",
                    BackupPlan = instanceBackupPlan.Name,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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.AutoProtectionPolicy;
    import com.pulumi.gcp.backupdisasterrecovery.AutoProtectionPolicyArgs;
    import com.pulumi.gcp.backupdisasterrecovery.inputs.AutoProtectionPolicyCriteriaArgs;
    import com.pulumi.gcp.backupdisasterrecovery.inputs.AutoProtectionPolicyCriteriaMatchingConditionArgs;
    import com.pulumi.gcp.backupdisasterrecovery.inputs.AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs;
    import com.pulumi.gcp.backupdisasterrecovery.inputs.AutoProtectionPolicyBackupPlanDetailArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 myBackupVault = new BackupVault("myBackupVault", BackupVaultArgs.builder()
                .location("us-central1")
                .backupVaultId("bv-app-update")
                .backupMinimumEnforcedRetentionDuration("100000s")
                .build());
    
            var instanceBackupPlan = new BackupPlan("instanceBackupPlan", BackupPlanArgs.builder()
                .location("us-central1")
                .backupPlanId("bp-app-update-vm")
                .resourceType("compute.googleapis.com/Instance")
                .backupVault(myBackupVault.id())
                .backupRules(BackupPlanBackupRuleArgs.builder()
                    .ruleId("rule-1")
                    .backupRetentionDays(5)
                    .standardSchedule(BackupPlanBackupRuleStandardScheduleArgs.builder()
                        .recurrenceType("HOURLY")
                        .hourlyFrequency(6)
                        .timeZone("UTC")
                        .backupWindow(BackupPlanBackupRuleStandardScheduleBackupWindowArgs.builder()
                            .startHourOfDay(0)
                            .endHourOfDay(24)
                            .build())
                        .build())
                    .build())
                .build());
    
            var my_auto_protection_policy = new AutoProtectionPolicy("my-auto-protection-policy", AutoProtectionPolicyArgs.builder()
                .location("us-central1")
                .autoProtectionPolicyId("app-update")
                .description("Protects production VMs.")
                .criteria(AutoProtectionPolicyCriteriaArgs.builder()
                    .matchingConditions(AutoProtectionPolicyCriteriaMatchingConditionArgs.builder()
                        .labelCondition(AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs.builder()
                            .key("env")
                            .values("prod")
                            .build())
                        .build())
                    .build())
                .backupPlanDetails(AutoProtectionPolicyBackupPlanDetailArgs.builder()
                    .resourceType("compute.googleapis.com/Instance")
                    .backupPlan(instanceBackupPlan.name())
                    .build())
                .build());
    
        }
    }
    
    resources:
      myBackupVault:
        type: gcp:backupdisasterrecovery:BackupVault
        name: my_backup_vault
        properties:
          location: us-central1
          backupVaultId: bv-app-update
          backupMinimumEnforcedRetentionDuration: 100000s
      instanceBackupPlan:
        type: gcp:backupdisasterrecovery:BackupPlan
        name: instance_backup_plan
        properties:
          location: us-central1
          backupPlanId: bp-app-update-vm
          resourceType: compute.googleapis.com/Instance
          backupVault: ${myBackupVault.id}
          backupRules:
            - ruleId: rule-1
              backupRetentionDays: 5
              standardSchedule:
                recurrenceType: HOURLY
                hourlyFrequency: 6
                timeZone: UTC
                backupWindow:
                  startHourOfDay: 0
                  endHourOfDay: 24
      my-auto-protection-policy:
        type: gcp:backupdisasterrecovery:AutoProtectionPolicy
        properties:
          location: us-central1
          autoProtectionPolicyId: app-update
          description: Protects production VMs.
          criteria:
            matchingConditions:
              - labelCondition:
                  key: env
                  values:
                    - prod
          backupPlanDetails:
            - resourceType: compute.googleapis.com/Instance
              backupPlan: ${instanceBackupPlan.name}
    
    terraform {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    resource "gcp_backupdisasterrecovery_backup_vault" "my_backup_vault" {
      lifecycle {
        create_before_destroy = true
      }
      location                                   = "us-central1"
      backup_vault_id                            = "bv-app-update"
      backup_minimum_enforced_retention_duration = "100000s"
    }
    resource "gcp_backupdisasterrecovery_backup_plan" "instance_backup_plan" {
      lifecycle {
        create_before_destroy = true
      }
      location       = "us-central1"
      backup_plan_id = "bp-app-update-vm"
      resource_type  = "compute.googleapis.com/Instance"
      backup_vault   = gcp_backupdisasterrecovery_backup_vault.my_backup_vault.id
      backup_rules {
        rule_id               = "rule-1"
        backup_retention_days = 5
        standard_schedule = {
          recurrence_type  = "HOURLY"
          hourly_frequency = 6
          time_zone        = "UTC"
          backup_window = {
            start_hour_of_day = 0
            end_hour_of_day   = 24
          }
        }
      }
    }
    resource "gcp_backupdisasterrecovery_auto_protection_policy" "my-auto-protection-policy" {
      lifecycle {
        create_before_destroy = true
      }
      location                  = "us-central1"
      auto_protection_policy_id = "app-update"
      description               = "Protects production VMs."
      criteria = {
        matching_conditions = [{
          label_condition = {
            key    = "env"
            values = ["prod"]
          }
        }]
      }
      backup_plan_details {
        resource_type = "compute.googleapis.com/Instance"
        backup_plan   = gcp_backupdisasterrecovery_backup_plan.instance_backup_plan.name
      }
    }
    

    Create AutoProtectionPolicy Resource

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

    Constructor syntax

    new AutoProtectionPolicy(name: string, args: AutoProtectionPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def AutoProtectionPolicy(resource_name: str,
                             args: AutoProtectionPolicyArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def AutoProtectionPolicy(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             auto_protection_policy_id: Optional[str] = None,
                             backup_plan_details: Optional[Sequence[AutoProtectionPolicyBackupPlanDetailArgs]] = None,
                             criteria: Optional[AutoProtectionPolicyCriteriaArgs] = None,
                             location: Optional[str] = None,
                             deletion_policy: Optional[str] = None,
                             description: Optional[str] = None,
                             project: Optional[str] = None)
    func NewAutoProtectionPolicy(ctx *Context, name string, args AutoProtectionPolicyArgs, opts ...ResourceOption) (*AutoProtectionPolicy, error)
    public AutoProtectionPolicy(string name, AutoProtectionPolicyArgs args, CustomResourceOptions? opts = null)
    public AutoProtectionPolicy(String name, AutoProtectionPolicyArgs args)
    public AutoProtectionPolicy(String name, AutoProtectionPolicyArgs args, CustomResourceOptions options)
    
    type: gcp:backupdisasterrecovery:AutoProtectionPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "gcp_backupdisasterrecovery_auto_protection_policy" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args AutoProtectionPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AutoProtectionPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AutoProtectionPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AutoProtectionPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AutoProtectionPolicyArgs
    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 autoProtectionPolicyResource = new Gcp.BackupDisasterRecovery.AutoProtectionPolicy("autoProtectionPolicyResource", new()
    {
        AutoProtectionPolicyId = "string",
        BackupPlanDetails = new[]
        {
            new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyBackupPlanDetailArgs
            {
                BackupPlan = "string",
                ResourceType = "string",
            },
        },
        Criteria = new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyCriteriaArgs
        {
            MatchingConditions = new[]
            {
                new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyCriteriaMatchingConditionArgs
                {
                    LabelCondition = new Gcp.BackupDisasterRecovery.Inputs.AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs
                    {
                        Key = "string",
                        Values = new[]
                        {
                            "string",
                        },
                    },
                },
            },
        },
        Location = "string",
        DeletionPolicy = "string",
        Description = "string",
        Project = "string",
    });
    
    example, err := backupdisasterrecovery.NewAutoProtectionPolicy(ctx, "autoProtectionPolicyResource", &backupdisasterrecovery.AutoProtectionPolicyArgs{
    	AutoProtectionPolicyId: pulumi.String("string"),
    	BackupPlanDetails: backupdisasterrecovery.AutoProtectionPolicyBackupPlanDetailArray{
    		&backupdisasterrecovery.AutoProtectionPolicyBackupPlanDetailArgs{
    			BackupPlan:   pulumi.String("string"),
    			ResourceType: pulumi.String("string"),
    		},
    	},
    	Criteria: &backupdisasterrecovery.AutoProtectionPolicyCriteriaArgs{
    		MatchingConditions: backupdisasterrecovery.AutoProtectionPolicyCriteriaMatchingConditionArray{
    			&backupdisasterrecovery.AutoProtectionPolicyCriteriaMatchingConditionArgs{
    				LabelCondition: &backupdisasterrecovery.AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs{
    					Key: pulumi.String("string"),
    					Values: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    				},
    			},
    		},
    	},
    	Location:       pulumi.String("string"),
    	DeletionPolicy: pulumi.String("string"),
    	Description:    pulumi.String("string"),
    	Project:        pulumi.String("string"),
    })
    
    resource "gcp_backupdisasterrecovery_auto_protection_policy" "autoProtectionPolicyResource" {
      lifecycle {
        create_before_destroy = true
      }
      auto_protection_policy_id = "string"
      backup_plan_details {
        backup_plan   = "string"
        resource_type = "string"
      }
      criteria = {
        matching_conditions = [{
          label_condition = {
            key    = "string"
            values = ["string"]
          }
        }]
      }
      location        = "string"
      deletion_policy = "string"
      description     = "string"
      project         = "string"
    }
    
    var autoProtectionPolicyResource = new AutoProtectionPolicy("autoProtectionPolicyResource", AutoProtectionPolicyArgs.builder()
        .autoProtectionPolicyId("string")
        .backupPlanDetails(AutoProtectionPolicyBackupPlanDetailArgs.builder()
            .backupPlan("string")
            .resourceType("string")
            .build())
        .criteria(AutoProtectionPolicyCriteriaArgs.builder()
            .matchingConditions(AutoProtectionPolicyCriteriaMatchingConditionArgs.builder()
                .labelCondition(AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs.builder()
                    .key("string")
                    .values("string")
                    .build())
                .build())
            .build())
        .location("string")
        .deletionPolicy("string")
        .description("string")
        .project("string")
        .build());
    
    auto_protection_policy_resource = gcp.backupdisasterrecovery.AutoProtectionPolicy("autoProtectionPolicyResource",
        auto_protection_policy_id="string",
        backup_plan_details=[{
            "backup_plan": "string",
            "resource_type": "string",
        }],
        criteria={
            "matching_conditions": [{
                "label_condition": {
                    "key": "string",
                    "values": ["string"],
                },
            }],
        },
        location="string",
        deletion_policy="string",
        description="string",
        project="string")
    
    const autoProtectionPolicyResource = new gcp.backupdisasterrecovery.AutoProtectionPolicy("autoProtectionPolicyResource", {
        autoProtectionPolicyId: "string",
        backupPlanDetails: [{
            backupPlan: "string",
            resourceType: "string",
        }],
        criteria: {
            matchingConditions: [{
                labelCondition: {
                    key: "string",
                    values: ["string"],
                },
            }],
        },
        location: "string",
        deletionPolicy: "string",
        description: "string",
        project: "string",
    });
    
    type: gcp:backupdisasterrecovery:AutoProtectionPolicy
    properties:
        autoProtectionPolicyId: string
        backupPlanDetails:
            - backupPlan: string
              resourceType: string
        criteria:
            matchingConditions:
                - labelCondition:
                    key: string
                    values:
                        - string
        deletionPolicy: string
        description: string
        location: string
        project: string
    

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

    AutoProtectionPolicyId string
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    BackupPlanDetails List<AutoProtectionPolicyBackupPlanDetail>
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    Criteria AutoProtectionPolicyCriteria
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    Location string
    The location of the auto protection policy.
    DeletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    Description string
    A description of the auto protection policy.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    AutoProtectionPolicyId string
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    BackupPlanDetails []AutoProtectionPolicyBackupPlanDetailArgs
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    Criteria AutoProtectionPolicyCriteriaArgs
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    Location string
    The location of the auto protection policy.
    DeletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    Description string
    A description of the auto protection policy.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    auto_protection_policy_id string
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backup_plan_details list(object)
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    criteria object
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    location string
    The location of the auto protection policy.
    deletion_policy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description string
    A description of the auto protection policy.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    autoProtectionPolicyId String
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backupPlanDetails List<AutoProtectionPolicyBackupPlanDetail>
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    criteria AutoProtectionPolicyCriteria
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    location String
    The location of the auto protection policy.
    deletionPolicy String
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description String
    A description of the auto protection policy.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    autoProtectionPolicyId string
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backupPlanDetails AutoProtectionPolicyBackupPlanDetail[]
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    criteria AutoProtectionPolicyCriteria
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    location string
    The location of the auto protection policy.
    deletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description string
    A description of the auto protection policy.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    auto_protection_policy_id str
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backup_plan_details Sequence[AutoProtectionPolicyBackupPlanDetailArgs]
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    criteria AutoProtectionPolicyCriteriaArgs
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    location str
    The location of the auto protection policy.
    deletion_policy str
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description str
    A description of the auto protection policy.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    autoProtectionPolicyId String
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backupPlanDetails List<Property Map>
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    criteria Property Map
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    location String
    The location of the auto protection policy.
    deletionPolicy String
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description String
    A description of the auto protection policy.
    project 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 AutoProtectionPolicy resource produces the following output properties:

    BindingSummaries List<AutoProtectionPolicyBindingSummary>
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    CreateTime string
    The time when the auto protection policy was created.
    Etag string
    The etag of the auto protection policy, used for optimistic concurrency control.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    PolicyEvaluationSummaries List<AutoProtectionPolicyPolicyEvaluationSummary>
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    State string
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    UpdateTime string
    The time when the auto protection policy was last updated.
    BindingSummaries []AutoProtectionPolicyBindingSummary
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    CreateTime string
    The time when the auto protection policy was created.
    Etag string
    The etag of the auto protection policy, used for optimistic concurrency control.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    PolicyEvaluationSummaries []AutoProtectionPolicyPolicyEvaluationSummary
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    State string
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    UpdateTime string
    The time when the auto protection policy was last updated.
    binding_summaries list(object)
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    create_time string
    The time when the auto protection policy was created.
    etag string
    The etag of the auto protection policy, used for optimistic concurrency control.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policy_evaluation_summaries list(object)
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    state string
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    update_time string
    The time when the auto protection policy was last updated.
    bindingSummaries List<AutoProtectionPolicyBindingSummary>
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    createTime String
    The time when the auto protection policy was created.
    etag String
    The etag of the auto protection policy, used for optimistic concurrency control.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policyEvaluationSummaries List<AutoProtectionPolicyPolicyEvaluationSummary>
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    state String
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    updateTime String
    The time when the auto protection policy was last updated.
    bindingSummaries AutoProtectionPolicyBindingSummary[]
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    createTime string
    The time when the auto protection policy was created.
    etag string
    The etag of the auto protection policy, used for optimistic concurrency control.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policyEvaluationSummaries AutoProtectionPolicyPolicyEvaluationSummary[]
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    state string
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    updateTime string
    The time when the auto protection policy was last updated.
    binding_summaries Sequence[AutoProtectionPolicyBindingSummary]
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    create_time str
    The time when the auto protection policy was created.
    etag str
    The etag of the auto protection policy, used for optimistic concurrency control.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policy_evaluation_summaries Sequence[AutoProtectionPolicyPolicyEvaluationSummary]
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    state str
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    update_time str
    The time when the auto protection policy was last updated.
    bindingSummaries List<Property Map>
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    createTime String
    The time when the auto protection policy was created.
    etag String
    The etag of the auto protection policy, used for optimistic concurrency control.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policyEvaluationSummaries List<Property Map>
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    state String
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    updateTime String
    The time when the auto protection policy was last updated.

    Look up Existing AutoProtectionPolicy Resource

    Get an existing AutoProtectionPolicy 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?: AutoProtectionPolicyState, opts?: CustomResourceOptions): AutoProtectionPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_protection_policy_id: Optional[str] = None,
            backup_plan_details: Optional[Sequence[AutoProtectionPolicyBackupPlanDetailArgs]] = None,
            binding_summaries: Optional[Sequence[AutoProtectionPolicyBindingSummaryArgs]] = None,
            create_time: Optional[str] = None,
            criteria: Optional[AutoProtectionPolicyCriteriaArgs] = None,
            deletion_policy: Optional[str] = None,
            description: Optional[str] = None,
            etag: Optional[str] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            policy_evaluation_summaries: Optional[Sequence[AutoProtectionPolicyPolicyEvaluationSummaryArgs]] = None,
            project: Optional[str] = None,
            state: Optional[str] = None,
            update_time: Optional[str] = None) -> AutoProtectionPolicy
    func GetAutoProtectionPolicy(ctx *Context, name string, id IDInput, state *AutoProtectionPolicyState, opts ...ResourceOption) (*AutoProtectionPolicy, error)
    public static AutoProtectionPolicy Get(string name, Input<string> id, AutoProtectionPolicyState? state, CustomResourceOptions? opts = null)
    public static AutoProtectionPolicy get(String name, Output<String> id, AutoProtectionPolicyState state, CustomResourceOptions options)
    resources:  _:    type: gcp:backupdisasterrecovery:AutoProtectionPolicy    get:      id: ${id}
    import {
      to = gcp_backupdisasterrecovery_auto_protection_policy.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    AutoProtectionPolicyId string
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    BackupPlanDetails List<AutoProtectionPolicyBackupPlanDetail>
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    BindingSummaries List<AutoProtectionPolicyBindingSummary>
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    CreateTime string
    The time when the auto protection policy was created.
    Criteria AutoProtectionPolicyCriteria
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    DeletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    Description string
    A description of the auto protection policy.
    Etag string
    The etag of the auto protection policy, used for optimistic concurrency control.
    Location string
    The location of the auto protection policy.
    Name string
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    PolicyEvaluationSummaries List<AutoProtectionPolicyPolicyEvaluationSummary>
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    State string
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    UpdateTime string
    The time when the auto protection policy was last updated.
    AutoProtectionPolicyId string
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    BackupPlanDetails []AutoProtectionPolicyBackupPlanDetailArgs
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    BindingSummaries []AutoProtectionPolicyBindingSummaryArgs
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    CreateTime string
    The time when the auto protection policy was created.
    Criteria AutoProtectionPolicyCriteriaArgs
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    DeletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    Description string
    A description of the auto protection policy.
    Etag string
    The etag of the auto protection policy, used for optimistic concurrency control.
    Location string
    The location of the auto protection policy.
    Name string
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    PolicyEvaluationSummaries []AutoProtectionPolicyPolicyEvaluationSummaryArgs
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    State string
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    UpdateTime string
    The time when the auto protection policy was last updated.
    auto_protection_policy_id string
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backup_plan_details list(object)
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    binding_summaries list(object)
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    create_time string
    The time when the auto protection policy was created.
    criteria object
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    deletion_policy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description string
    A description of the auto protection policy.
    etag string
    The etag of the auto protection policy, used for optimistic concurrency control.
    location string
    The location of the auto protection policy.
    name string
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policy_evaluation_summaries list(object)
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state string
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    update_time string
    The time when the auto protection policy was last updated.
    autoProtectionPolicyId String
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backupPlanDetails List<AutoProtectionPolicyBackupPlanDetail>
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    bindingSummaries List<AutoProtectionPolicyBindingSummary>
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    createTime String
    The time when the auto protection policy was created.
    criteria AutoProtectionPolicyCriteria
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    deletionPolicy String
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description String
    A description of the auto protection policy.
    etag String
    The etag of the auto protection policy, used for optimistic concurrency control.
    location String
    The location of the auto protection policy.
    name String
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policyEvaluationSummaries List<AutoProtectionPolicyPolicyEvaluationSummary>
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state String
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    updateTime String
    The time when the auto protection policy was last updated.
    autoProtectionPolicyId string
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backupPlanDetails AutoProtectionPolicyBackupPlanDetail[]
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    bindingSummaries AutoProtectionPolicyBindingSummary[]
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    createTime string
    The time when the auto protection policy was created.
    criteria AutoProtectionPolicyCriteria
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    deletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description string
    A description of the auto protection policy.
    etag string
    The etag of the auto protection policy, used for optimistic concurrency control.
    location string
    The location of the auto protection policy.
    name string
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policyEvaluationSummaries AutoProtectionPolicyPolicyEvaluationSummary[]
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state string
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    updateTime string
    The time when the auto protection policy was last updated.
    auto_protection_policy_id str
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backup_plan_details Sequence[AutoProtectionPolicyBackupPlanDetailArgs]
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    binding_summaries Sequence[AutoProtectionPolicyBindingSummaryArgs]
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    create_time str
    The time when the auto protection policy was created.
    criteria AutoProtectionPolicyCriteriaArgs
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    deletion_policy str
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description str
    A description of the auto protection policy.
    etag str
    The etag of the auto protection policy, used for optimistic concurrency control.
    location str
    The location of the auto protection policy.
    name str
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policy_evaluation_summaries Sequence[AutoProtectionPolicyPolicyEvaluationSummaryArgs]
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state str
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    update_time str
    The time when the auto protection policy was last updated.
    autoProtectionPolicyId String
    The ID of the auto protection policy. This becomes the final component of the policy's resource name.
    backupPlanDetails List<Property Map>
    The backup plans to apply to the resources that match the policy's criteria. Each entry specifies a resource type and the backup plan that protects resources of that type. Currently, only one entry is supported. Structure is documented below.
    bindingSummaries List<Property Map>
    A summary of the scopes that the policy is applied to through bindings. Structure is documented below.
    createTime String
    The time when the auto protection policy was created.
    criteria Property Map
    The criteria that a resource must meet to be protected by the policy. Structure is documented below.
    deletionPolicy String
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description String
    A description of the auto protection policy.
    etag String
    The etag of the auto protection policy, used for optimistic concurrency control.
    location String
    The location of the auto protection policy.
    name String
    The resource name of the auto protection policy, in the format projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy_id}.
    policyEvaluationSummaries List<Property Map>
    A summary of the last run of the job that applies the policy to matching resources. Structure is documented below.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state String
    The current state of the auto protection policy. Possible values are CREATING, ACTIVE, UPDATING, and DELETING.
    updateTime String
    The time when the auto protection policy was last updated.

    Supporting Types

    AutoProtectionPolicyBackupPlanDetail, AutoProtectionPolicyBackupPlanDetailArgs

    BackupPlan string
    The resource name of the backup plan to apply to the matching resources, in the format projects/{project}/locations/{location}/backupPlans/{backup_plan_id}. The backup plan must be in the same location as the auto protection policy.
    ResourceType string
    The type of resource that this policy automatically protects, for example compute.googleapis.com/Instance or compute.googleapis.com/Disk.
    BackupPlan string
    The resource name of the backup plan to apply to the matching resources, in the format projects/{project}/locations/{location}/backupPlans/{backup_plan_id}. The backup plan must be in the same location as the auto protection policy.
    ResourceType string
    The type of resource that this policy automatically protects, for example compute.googleapis.com/Instance or compute.googleapis.com/Disk.
    backup_plan string
    The resource name of the backup plan to apply to the matching resources, in the format projects/{project}/locations/{location}/backupPlans/{backup_plan_id}. The backup plan must be in the same location as the auto protection policy.
    resource_type string
    The type of resource that this policy automatically protects, for example compute.googleapis.com/Instance or compute.googleapis.com/Disk.
    backupPlan String
    The resource name of the backup plan to apply to the matching resources, in the format projects/{project}/locations/{location}/backupPlans/{backup_plan_id}. The backup plan must be in the same location as the auto protection policy.
    resourceType String
    The type of resource that this policy automatically protects, for example compute.googleapis.com/Instance or compute.googleapis.com/Disk.
    backupPlan string
    The resource name of the backup plan to apply to the matching resources, in the format projects/{project}/locations/{location}/backupPlans/{backup_plan_id}. The backup plan must be in the same location as the auto protection policy.
    resourceType string
    The type of resource that this policy automatically protects, for example compute.googleapis.com/Instance or compute.googleapis.com/Disk.
    backup_plan str
    The resource name of the backup plan to apply to the matching resources, in the format projects/{project}/locations/{location}/backupPlans/{backup_plan_id}. The backup plan must be in the same location as the auto protection policy.
    resource_type str
    The type of resource that this policy automatically protects, for example compute.googleapis.com/Instance or compute.googleapis.com/Disk.
    backupPlan String
    The resource name of the backup plan to apply to the matching resources, in the format projects/{project}/locations/{location}/backupPlans/{backup_plan_id}. The backup plan must be in the same location as the auto protection policy.
    resourceType String
    The type of resource that this policy automatically protects, for example compute.googleapis.com/Instance or compute.googleapis.com/Disk.

    AutoProtectionPolicyBindingSummary, AutoProtectionPolicyBindingSummaryArgs

    ProjectCount string
    (Output) The total number of projects protected by the policy.
    ProjectCount string
    (Output) The total number of projects protected by the policy.
    project_count string
    (Output) The total number of projects protected by the policy.
    projectCount String
    (Output) The total number of projects protected by the policy.
    projectCount string
    (Output) The total number of projects protected by the policy.
    project_count str
    (Output) The total number of projects protected by the policy.
    projectCount String
    (Output) The total number of projects protected by the policy.

    AutoProtectionPolicyCriteria, AutoProtectionPolicyCriteriaArgs

    MatchingConditions List<AutoProtectionPolicyCriteriaMatchingCondition>
    A list of matching conditions that a resource must meet to be protected by the policy. Currently, only one condition is supported. Structure is documented below.
    MatchingConditions []AutoProtectionPolicyCriteriaMatchingCondition
    A list of matching conditions that a resource must meet to be protected by the policy. Currently, only one condition is supported. Structure is documented below.
    matching_conditions list(object)
    A list of matching conditions that a resource must meet to be protected by the policy. Currently, only one condition is supported. Structure is documented below.
    matchingConditions List<AutoProtectionPolicyCriteriaMatchingCondition>
    A list of matching conditions that a resource must meet to be protected by the policy. Currently, only one condition is supported. Structure is documented below.
    matchingConditions AutoProtectionPolicyCriteriaMatchingCondition[]
    A list of matching conditions that a resource must meet to be protected by the policy. Currently, only one condition is supported. Structure is documented below.
    matching_conditions Sequence[AutoProtectionPolicyCriteriaMatchingCondition]
    A list of matching conditions that a resource must meet to be protected by the policy. Currently, only one condition is supported. Structure is documented below.
    matchingConditions List<Property Map>
    A list of matching conditions that a resource must meet to be protected by the policy. Currently, only one condition is supported. Structure is documented below.

    AutoProtectionPolicyCriteriaMatchingCondition, AutoProtectionPolicyCriteriaMatchingConditionArgs

    LabelCondition AutoProtectionPolicyCriteriaMatchingConditionLabelCondition
    A condition that matches resources based on their labels. Structure is documented below.
    LabelCondition AutoProtectionPolicyCriteriaMatchingConditionLabelCondition
    A condition that matches resources based on their labels. Structure is documented below.
    label_condition object
    A condition that matches resources based on their labels. Structure is documented below.
    labelCondition AutoProtectionPolicyCriteriaMatchingConditionLabelCondition
    A condition that matches resources based on their labels. Structure is documented below.
    labelCondition AutoProtectionPolicyCriteriaMatchingConditionLabelCondition
    A condition that matches resources based on their labels. Structure is documented below.
    label_condition AutoProtectionPolicyCriteriaMatchingConditionLabelCondition
    A condition that matches resources based on their labels. Structure is documented below.
    labelCondition Property Map
    A condition that matches resources based on their labels. Structure is documented below.

    AutoProtectionPolicyCriteriaMatchingConditionLabelCondition, AutoProtectionPolicyCriteriaMatchingConditionLabelConditionArgs

    Key string
    The key of the label to match.
    Values List<string>
    The values of the label to match. A resource matches the condition if its label value is equal to any of the listed values. Currently, only one value is supported.
    Key string
    The key of the label to match.
    Values []string
    The values of the label to match. A resource matches the condition if its label value is equal to any of the listed values. Currently, only one value is supported.
    key string
    The key of the label to match.
    values list(string)
    The values of the label to match. A resource matches the condition if its label value is equal to any of the listed values. Currently, only one value is supported.
    key String
    The key of the label to match.
    values List<String>
    The values of the label to match. A resource matches the condition if its label value is equal to any of the listed values. Currently, only one value is supported.
    key string
    The key of the label to match.
    values string[]
    The values of the label to match. A resource matches the condition if its label value is equal to any of the listed values. Currently, only one value is supported.
    key str
    The key of the label to match.
    values Sequence[str]
    The values of the label to match. A resource matches the condition if its label value is equal to any of the listed values. Currently, only one value is supported.
    key String
    The key of the label to match.
    values List<String>
    The values of the label to match. A resource matches the condition if its label value is equal to any of the listed values. Currently, only one value is supported.

    AutoProtectionPolicyPolicyEvaluationSummary, AutoProtectionPolicyPolicyEvaluationSummaryArgs

    FailedResourceCount string
    (Output) The number of matching resources whose protection failed during the last job run.
    MatchingResourceCount string
    (Output) The number of resources that currently match the policy's criteria.
    ProtectedResourceCount string
    (Output) The number of matching resources that are successfully protected.
    FailedResourceCount string
    (Output) The number of matching resources whose protection failed during the last job run.
    MatchingResourceCount string
    (Output) The number of resources that currently match the policy's criteria.
    ProtectedResourceCount string
    (Output) The number of matching resources that are successfully protected.
    failed_resource_count string
    (Output) The number of matching resources whose protection failed during the last job run.
    matching_resource_count string
    (Output) The number of resources that currently match the policy's criteria.
    protected_resource_count string
    (Output) The number of matching resources that are successfully protected.
    failedResourceCount String
    (Output) The number of matching resources whose protection failed during the last job run.
    matchingResourceCount String
    (Output) The number of resources that currently match the policy's criteria.
    protectedResourceCount String
    (Output) The number of matching resources that are successfully protected.
    failedResourceCount string
    (Output) The number of matching resources whose protection failed during the last job run.
    matchingResourceCount string
    (Output) The number of resources that currently match the policy's criteria.
    protectedResourceCount string
    (Output) The number of matching resources that are successfully protected.
    failed_resource_count str
    (Output) The number of matching resources whose protection failed during the last job run.
    matching_resource_count str
    (Output) The number of resources that currently match the policy's criteria.
    protected_resource_count str
    (Output) The number of matching resources that are successfully protected.
    failedResourceCount String
    (Output) The number of matching resources whose protection failed during the last job run.
    matchingResourceCount String
    (Output) The number of resources that currently match the policy's criteria.
    protectedResourceCount String
    (Output) The number of matching resources that are successfully protected.

    Import

    AutoProtectionPolicy can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{location}}/autoProtectionPolicies/{{auto_protection_policy_id}}
    • {{project}}/{{location}}/{{auto_protection_policy_id}}
    • {{location}}/{{auto_protection_policy_id}}

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

    $ pulumi import gcp:backupdisasterrecovery/autoProtectionPolicy:AutoProtectionPolicy default projects/{{project}}/locations/{{location}}/autoProtectionPolicies/{{auto_protection_policy_id}}
    $ pulumi import gcp:backupdisasterrecovery/autoProtectionPolicy:AutoProtectionPolicy default {{project}}/{{location}}/{{auto_protection_policy_id}}
    $ pulumi import gcp:backupdisasterrecovery/autoProtectionPolicy:AutoProtectionPolicy default {{location}}/{{auto_protection_policy_id}}
    

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

    Package Details

    Repository
    Google Cloud (GCP) pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Viewing docs for Google Cloud v10.2.0
    published on Tuesday, Oct 20, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial