Oracle Cloud Infrastructure v3.9.0 published on Wednesday, Sep 24, 2025 by Pulumi
oci.RecoveryMod.getProtectionPolicies
This data source provides the list of Protection Policies in Oracle Cloud Infrastructure Recovery service.
Gets a list of protection policies based on the specified parameters.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testProtectionPolicies = oci.RecoveryMod.getProtectionPolicies({
compartmentId: compartmentId,
displayName: protectionPolicyDisplayName,
owner: protectionPolicyOwner,
protectionPolicyId: testProtectionPolicy.id,
state: protectionPolicyState,
});
import pulumi
import pulumi_oci as oci
test_protection_policies = oci.RecoveryMod.get_protection_policies(compartment_id=compartment_id,
display_name=protection_policy_display_name,
owner=protection_policy_owner,
protection_policy_id=test_protection_policy["id"],
state=protection_policy_state)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/recoverymod"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoverymod.GetProtectionPolicies(ctx, &recoverymod.GetProtectionPoliciesArgs{
CompartmentId: compartmentId,
DisplayName: pulumi.StringRef(protectionPolicyDisplayName),
Owner: pulumi.StringRef(protectionPolicyOwner),
ProtectionPolicyId: pulumi.StringRef(testProtectionPolicy.Id),
State: pulumi.StringRef(protectionPolicyState),
}, 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 testProtectionPolicies = Oci.RecoveryMod.GetProtectionPolicies.Invoke(new()
{
CompartmentId = compartmentId,
DisplayName = protectionPolicyDisplayName,
Owner = protectionPolicyOwner,
ProtectionPolicyId = testProtectionPolicy.Id,
State = protectionPolicyState,
});
});
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.GetProtectionPoliciesArgs;
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 testProtectionPolicies = RecoveryModFunctions.getProtectionPolicies(GetProtectionPoliciesArgs.builder()
.compartmentId(compartmentId)
.displayName(protectionPolicyDisplayName)
.owner(protectionPolicyOwner)
.protectionPolicyId(testProtectionPolicy.id())
.state(protectionPolicyState)
.build());
}
}
variables:
testProtectionPolicies:
fn::invoke:
function: oci:RecoveryMod:getProtectionPolicies
arguments:
compartmentId: ${compartmentId}
displayName: ${protectionPolicyDisplayName}
owner: ${protectionPolicyOwner}
protectionPolicyId: ${testProtectionPolicy.id}
state: ${protectionPolicyState}
Using getProtectionPolicies
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 getProtectionPolicies(args: GetProtectionPoliciesArgs, opts?: InvokeOptions): Promise<GetProtectionPoliciesResult>
function getProtectionPoliciesOutput(args: GetProtectionPoliciesOutputArgs, opts?: InvokeOptions): Output<GetProtectionPoliciesResult>def get_protection_policies(compartment_id: Optional[str] = None,
display_name: Optional[str] = None,
filters: Optional[Sequence[GetProtectionPoliciesFilter]] = None,
owner: Optional[str] = None,
protection_policy_id: Optional[str] = None,
state: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetProtectionPoliciesResult
def get_protection_policies_output(compartment_id: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetProtectionPoliciesFilterArgs]]]] = None,
owner: Optional[pulumi.Input[str]] = None,
protection_policy_id: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetProtectionPoliciesResult]func GetProtectionPolicies(ctx *Context, args *GetProtectionPoliciesArgs, opts ...InvokeOption) (*GetProtectionPoliciesResult, error)
func GetProtectionPoliciesOutput(ctx *Context, args *GetProtectionPoliciesOutputArgs, opts ...InvokeOption) GetProtectionPoliciesResultOutput> Note: This function is named GetProtectionPolicies in the Go SDK.
public static class GetProtectionPolicies
{
public static Task<GetProtectionPoliciesResult> InvokeAsync(GetProtectionPoliciesArgs args, InvokeOptions? opts = null)
public static Output<GetProtectionPoliciesResult> Invoke(GetProtectionPoliciesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetProtectionPoliciesResult> getProtectionPolicies(GetProtectionPoliciesArgs args, InvokeOptions options)
public static Output<GetProtectionPoliciesResult> getProtectionPolicies(GetProtectionPoliciesArgs args, InvokeOptions options)
fn::invoke:
function: oci:RecoveryMod/getProtectionPolicies:getProtectionPolicies
arguments:
# arguments dictionaryThe following arguments are supported:
- Compartment
Id string - The compartment OCID.
- Display
Name string - A filter to return only resources that match the entire 'displayname' given.
- Filters
List<Get
Protection Policies Filter> - Owner string
- A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
- Protection
Policy stringId - The protection policy OCID.
- State string
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- Compartment
Id string - The compartment OCID.
- Display
Name string - A filter to return only resources that match the entire 'displayname' given.
- Filters
[]Get
Protection Policies Filter - Owner string
- A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
- Protection
Policy stringId - The protection policy OCID.
- State string
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- compartment
Id String - The compartment OCID.
- display
Name String - A filter to return only resources that match the entire 'displayname' given.
- filters
List<Get
Protection Policies Filter> - owner String
- A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
- protection
Policy StringId - The protection policy OCID.
- state String
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- compartment
Id string - The compartment OCID.
- display
Name string - A filter to return only resources that match the entire 'displayname' given.
- filters
Get
Protection Policies Filter[] - owner string
- A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
- protection
Policy stringId - The protection policy OCID.
- state string
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- compartment_
id str - The compartment OCID.
- display_
name str - A filter to return only resources that match the entire 'displayname' given.
- filters
Sequence[Get
Protection Policies Filter] - owner str
- A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
- protection_
policy_ strid - The protection policy OCID.
- state str
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- compartment
Id String - The compartment OCID.
- display
Name String - A filter to return only resources that match the entire 'displayname' given.
- filters List<Property Map>
- owner String
- A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
- protection
Policy StringId - The protection policy OCID.
- state String
- A filter to return only resources their lifecycleState matches the given lifecycleState.
getProtectionPolicies Result
The following output properties are available:
- Compartment
Id string - The OCID of the compartment that contains the protection policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Protection
Policy List<GetCollections Protection Policies Protection Policy Collection> - The list of protection_policy_collection.
- Display
Name string - A user provided name for the protection policy.
- Filters
List<Get
Protection Policies Filter> - Owner string
- Protection
Policy stringId - State string
- The current state of the protection policy.
- Compartment
Id string - The OCID of the compartment that contains the protection policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Protection
Policy []GetCollections Protection Policies Protection Policy Collection - The list of protection_policy_collection.
- Display
Name string - A user provided name for the protection policy.
- Filters
[]Get
Protection Policies Filter - Owner string
- Protection
Policy stringId - State string
- The current state of the protection policy.
- compartment
Id String - The OCID of the compartment that contains the protection policy.
- id String
- The provider-assigned unique ID for this managed resource.
- protection
Policy List<GetCollections Protection Policies Protection Policy Collection> - The list of protection_policy_collection.
- display
Name String - A user provided name for the protection policy.
- filters
List<Get
Protection Policies Filter> - owner String
- protection
Policy StringId - state String
- The current state of the protection policy.
- compartment
Id string - The OCID of the compartment that contains the protection policy.
- id string
- The provider-assigned unique ID for this managed resource.
- protection
Policy GetCollections Protection Policies Protection Policy Collection[] - The list of protection_policy_collection.
- display
Name string - A user provided name for the protection policy.
- filters
Get
Protection Policies Filter[] - owner string
- protection
Policy stringId - state string
- The current state of the protection policy.
- compartment_
id str - The OCID of the compartment that contains the protection policy.
- id str
- The provider-assigned unique ID for this managed resource.
- protection_
policy_ Sequence[Getcollections Protection Policies Protection Policy Collection] - The list of protection_policy_collection.
- display_
name str - A user provided name for the protection policy.
- filters
Sequence[Get
Protection Policies Filter] - owner str
- protection_
policy_ strid - state str
- The current state of the protection policy.
- compartment
Id String - The OCID of the compartment that contains the protection policy.
- id String
- The provider-assigned unique ID for this managed resource.
- protection
Policy List<Property Map>Collections - The list of protection_policy_collection.
- display
Name String - A user provided name for the protection policy.
- filters List<Property Map>
- owner String
- protection
Policy StringId - state String
- The current state of the protection policy.
Supporting Types
GetProtectionPoliciesFilter
GetProtectionPoliciesProtectionPolicyCollection
GetProtectionPoliciesProtectionPolicyCollectionItem
- 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 string - The compartment OCID.
- 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 - Display
Name string - A filter to return only resources that match the entire 'displayname' given.
- 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.
- 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 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.
- 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 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.
- State string
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- 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 - Time
Created string - An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- Time
Updated 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 string - The compartment OCID.
- 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 - Display
Name string - A filter to return only resources that match the entire 'displayname' given.
- 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.
- 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 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.
- 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 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.
- State string
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- 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 - Time
Created string - An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- Time
Updated 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 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.
- compartment
Id String - The compartment OCID.
- 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 - display
Name String - A filter to return only resources that match the entire 'displayname' given.
- 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.
- is
Predefined 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.
- lifecycle
Details 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.
- must
Enforce 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.
- policy
Locked 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.
- state String
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- 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 - time
Created String - An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- time
Updated 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 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.
- compartment
Id string - The compartment OCID.
- {[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 - display
Name string - A filter to return only resources that match the entire 'displayname' given.
- {[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.
- is
Predefined 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.
- lifecycle
Details 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.
- must
Enforce 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.
- policy
Locked 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.
- state string
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- {[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 - time
Created string - An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- time
Updated 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 compartment OCID.
- 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 filter to return only resources that match the entire 'displayname' given.
- 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.
- state str
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- 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'.
- backup
Retention 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.
- compartment
Id String - The compartment OCID.
- 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 - display
Name String - A filter to return only resources that match the entire 'displayname' given.
- 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.
- is
Predefined 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.
- lifecycle
Details 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.
- must
Enforce 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.
- policy
Locked 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.
- state String
- A filter to return only resources their lifecycleState matches the given lifecycleState.
- 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 - time
Created String - An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
- time
Updated 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.
