Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.RecoveryMod.getProtectionPolicy
Explore with Pulumi AI
This data source provides details about a specific Protection Policy resource in Oracle Cloud Infrastructure Recovery service.
Gets information about a specified protection policy.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testProtectionPolicy = oci.RecoveryMod.getProtectionPolicy({
    protectionPolicyId: testProtectionPolicyOciRecoveryProtectionPolicy.id,
});
import pulumi
import pulumi_oci as oci
test_protection_policy = oci.RecoveryMod.get_protection_policy(protection_policy_id=test_protection_policy_oci_recovery_protection_policy["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/recoverymod"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := recoverymod.GetProtectionPolicy(ctx, &recoverymod.GetProtectionPolicyArgs{
			ProtectionPolicyId: testProtectionPolicyOciRecoveryProtectionPolicy.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testProtectionPolicy = Oci.RecoveryMod.GetProtectionPolicy.Invoke(new()
    {
        ProtectionPolicyId = testProtectionPolicyOciRecoveryProtectionPolicy.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.RecoveryMod.RecoveryModFunctions;
import com.pulumi.oci.RecoveryMod.inputs.GetProtectionPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var testProtectionPolicy = RecoveryModFunctions.getProtectionPolicy(GetProtectionPolicyArgs.builder()
            .protectionPolicyId(testProtectionPolicyOciRecoveryProtectionPolicy.id())
            .build());
    }
}
variables:
  testProtectionPolicy:
    fn::invoke:
      function: oci:RecoveryMod:getProtectionPolicy
      arguments:
        protectionPolicyId: ${testProtectionPolicyOciRecoveryProtectionPolicy.id}
Using getProtectionPolicy
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getProtectionPolicy(args: GetProtectionPolicyArgs, opts?: InvokeOptions): Promise<GetProtectionPolicyResult>
function getProtectionPolicyOutput(args: GetProtectionPolicyOutputArgs, opts?: InvokeOptions): Output<GetProtectionPolicyResult>def get_protection_policy(protection_policy_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetProtectionPolicyResult
def get_protection_policy_output(protection_policy_id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetProtectionPolicyResult]func LookupProtectionPolicy(ctx *Context, args *LookupProtectionPolicyArgs, opts ...InvokeOption) (*LookupProtectionPolicyResult, error)
func LookupProtectionPolicyOutput(ctx *Context, args *LookupProtectionPolicyOutputArgs, opts ...InvokeOption) LookupProtectionPolicyResultOutput> Note: This function is named LookupProtectionPolicy in the Go SDK.
public static class GetProtectionPolicy 
{
    public static Task<GetProtectionPolicyResult> InvokeAsync(GetProtectionPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetProtectionPolicyResult> Invoke(GetProtectionPolicyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetProtectionPolicyResult> getProtectionPolicy(GetProtectionPolicyArgs args, InvokeOptions options)
public static Output<GetProtectionPolicyResult> getProtectionPolicy(GetProtectionPolicyArgs args, InvokeOptions options)
fn::invoke:
  function: oci:RecoveryMod/getProtectionPolicy:getProtectionPolicy
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ProtectionPolicy stringId 
- The protection policy OCID.
- ProtectionPolicy stringId 
- The protection policy OCID.
- protectionPolicy StringId 
- The protection policy OCID.
- protectionPolicy stringId 
- The protection policy OCID.
- protection_policy_ strid 
- The protection policy OCID.
- protectionPolicy StringId 
- The protection policy OCID.
getProtectionPolicy Result
The following output properties are available:
- BackupRetention intPeriod In Days 
- The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
- CompartmentId string
- The OCID of the compartment that contains the protection policy.
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
- DisplayName string
- A user provided name for the protection policy.
- Dictionary<string, string>
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- Id string
- The protection policy OCID.
- IsPredefined boolPolicy 
- Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
- LifecycleDetails string
- Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
- MustEnforce boolCloud Locality 
- Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
- PolicyLocked stringDate Time 
- An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
- ProtectionPolicy stringId 
- State string
- The current state of the protection policy.
- Dictionary<string, string>
- Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
- TimeCreated string
- An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- TimeUpdated string
- An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- BackupRetention intPeriod In Days 
- The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
- CompartmentId string
- The OCID of the compartment that contains the protection policy.
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
- DisplayName string
- A user provided name for the protection policy.
- map[string]string
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- Id string
- The protection policy OCID.
- IsPredefined boolPolicy 
- Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
- LifecycleDetails string
- Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
- MustEnforce boolCloud Locality 
- Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
- PolicyLocked stringDate Time 
- An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
- ProtectionPolicy stringId 
- State string
- The current state of the protection policy.
- map[string]string
- Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
- TimeCreated string
- An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- TimeUpdated string
- An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- backupRetention IntegerPeriod In Days 
- The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
- compartmentId String
- The OCID of the compartment that contains the protection policy.
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
- displayName String
- A user provided name for the protection policy.
- Map<String,String>
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- id String
- The protection policy OCID.
- isPredefined BooleanPolicy 
- Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
- lifecycleDetails String
- Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
- mustEnforce BooleanCloud Locality 
- Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
- policyLocked StringDate Time 
- An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
- protectionPolicy StringId 
- state String
- The current state of the protection policy.
- Map<String,String>
- Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
- timeCreated String
- An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- timeUpdated String
- An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- backupRetention numberPeriod In Days 
- The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
- compartmentId string
- The OCID of the compartment that contains the protection policy.
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
- displayName string
- A user provided name for the protection policy.
- {[key: string]: string}
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- id string
- The protection policy OCID.
- isPredefined booleanPolicy 
- Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
- lifecycleDetails string
- Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
- mustEnforce booleanCloud Locality 
- Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
- policyLocked stringDate Time 
- An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
- protectionPolicy stringId 
- state string
- The current state of the protection policy.
- {[key: string]: string}
- Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
- timeCreated string
- An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- timeUpdated string
- An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- backup_retention_ intperiod_ in_ days 
- The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
- compartment_id str
- The OCID of the compartment that contains the protection policy.
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
- display_name str
- A user provided name for the protection policy.
- Mapping[str, str]
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- id str
- The protection policy OCID.
- is_predefined_ boolpolicy 
- Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
- lifecycle_details str
- Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
- must_enforce_ boolcloud_ locality 
- Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
- policy_locked_ strdate_ time 
- An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
- protection_policy_ strid 
- state str
- The current state of the protection policy.
- Mapping[str, str]
- Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
- time_created str
- An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- time_updated str
- An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- backupRetention NumberPeriod In Days 
- The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
- compartmentId String
- The OCID of the compartment that contains the protection policy.
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
- displayName String
- A user provided name for the protection policy.
- Map<String>
- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
- id String
- The protection policy OCID.
- isPredefined BooleanPolicy 
- Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
- lifecycleDetails String
- Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
- mustEnforce BooleanCloud Locality 
- Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
- policyLocked StringDate Time 
- An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
- protectionPolicy StringId 
- state String
- The current state of the protection policy.
- Map<String>
- Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
- timeCreated String
- An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- timeUpdated String
- An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.