Oracle Cloud Infrastructure v2.28.0 published on Thursday, Mar 27, 2025 by Pulumi
oci.RecoveryMod.getProtectionPolicies
Explore with Pulumi AI
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/v2/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[_recoverymod.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[_recoverymod.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 dictionary
The following arguments are supported:
- Compartment
Id This property is required. string - The compartment OCID.
- Display
Name string - A filter to return only resources that match the entire 'displayname' given.
- Filters
Changes to this property will trigger replacement.
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 This property is required. string - The compartment OCID.
- Display
Name string - A filter to return only resources that match the entire 'displayname' given.
- Filters
Changes to this property will trigger replacement.
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 This property is required. String - The compartment OCID.
- display
Name String - A filter to return only resources that match the entire 'displayname' given.
- filters
Changes to this property will trigger replacement.
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 This property is required. string - The compartment OCID.
- display
Name string - A filter to return only resources that match the entire 'displayname' given.
- filters
Changes to this property will trigger replacement.
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 This property is required. str - The compartment OCID.
- display_
name str - A filter to return only resources that match the entire 'displayname' given.
- filters
Changes to this property will trigger replacement.
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 This property is required. String - The compartment OCID.
- display
Name String - A filter to return only resources that match the entire 'displayname' given.
- filters
Changes to this property will trigger replacement.
- 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[recoverymod.collections Get Protection Policies Protection Policy Collection] - The list of protection_policy_collection.
- display_
name str - A user provided name for the protection policy.
- filters
Sequence[recoverymod.
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
- Items
This property is required. List<GetProtection Policies Protection Policy Collection Item>
- Items
This property is required. []GetProtection Policies Protection Policy Collection Item
- items
This property is required. List<GetProtection Policies Protection Policy Collection Item>
- items
This property is required. GetProtection Policies Protection Policy Collection Item[]
- items
This property is required. Sequence[recoverymod.Get Protection Policies Protection Policy Collection Item]
- items
This property is required. List<Property Map>
GetProtectionPoliciesProtectionPolicyCollectionItem
- Backup
Retention Period In Days This property is required. int - 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 This property is required. string - The compartment OCID.
This property is required. 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 This property is required. string - A filter to return only resources that match the entire 'displayname' given.
This property is required. 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
This property is required. string - The protection policy OCID.
- Is
Predefined Policy This property is required. bool - 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 This property is required. 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 Cloud Locality This property is required. bool - 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 Date Time This property is required. string - 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
This property is required. string - A filter to return only resources their lifecycleState matches the given lifecycleState.
This property is required. 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 This property is required. 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 This property is required. 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 Period In Days This property is required. int - 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 This property is required. string - The compartment OCID.
This property is required. 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 This property is required. string - A filter to return only resources that match the entire 'displayname' given.
This property is required. 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
This property is required. string - The protection policy OCID.
- Is
Predefined Policy This property is required. bool - 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 This property is required. 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 Cloud Locality This property is required. bool - 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 Date Time This property is required. string - 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
This property is required. string - A filter to return only resources their lifecycleState matches the given lifecycleState.
This property is required. 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 This property is required. 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 This property is required. 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 Period In Days This property is required. Integer - 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 This property is required. String - The compartment OCID.
This property is required. 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 This property is required. String - A filter to return only resources that match the entire 'displayname' given.
This property is required. 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
This property is required. String - The protection policy OCID.
- is
Predefined Policy This property is required. Boolean - 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 This property is required. 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 Cloud Locality This property is required. Boolean - 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 Date Time This property is required. String - 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
This property is required. String - A filter to return only resources their lifecycleState matches the given lifecycleState.
This property is required. 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 This property is required. 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 This property is required. 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 Period In Days This property is required. number - 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 This property is required. string - The compartment OCID.
This property is required. {[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 This property is required. string - A filter to return only resources that match the entire 'displayname' given.
This property is required. {[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
This property is required. string - The protection policy OCID.
- is
Predefined Policy This property is required. boolean - 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 This property is required. 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 Cloud Locality This property is required. boolean - 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 Date Time This property is required. string - 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
This property is required. string - A filter to return only resources their lifecycleState matches the given lifecycleState.
This property is required. {[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 This property is required. 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 This property is required. 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_ period_ in_ days This property is required. int - 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 This property is required. str - The compartment OCID.
This property is required. 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 This property is required. str - A filter to return only resources that match the entire 'displayname' given.
This property is required. 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
This property is required. str - The protection policy OCID.
- is_
predefined_ policy This property is required. bool - 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 This property is required. 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_ cloud_ locality This property is required. bool - 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_ date_ time This property is required. str - 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
This property is required. str - A filter to return only resources their lifecycleState matches the given lifecycleState.
This property is required. 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 This property is required. 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 This property is required. 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 Period In Days This property is required. Number - 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 This property is required. String - The compartment OCID.
This property is required. 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 This property is required. String - A filter to return only resources that match the entire 'displayname' given.
This property is required. 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
This property is required. String - The protection policy OCID.
- is
Predefined Policy This property is required. Boolean - 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 This property is required. 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 Cloud Locality This property is required. Boolean - 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 Date Time This property is required. String - 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
This property is required. String - A filter to return only resources their lifecycleState matches the given lifecycleState.
This property is required. 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 This property is required. 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 This property is required. 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
oci
Terraform Provider.