1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. RecoveryMod
  5. getProtectionPolicy
Oracle Cloud Infrastructure v1.31.0 published on Wednesday, Apr 10, 2024 by Pulumi

oci.RecoveryMod.getProtectionPolicy

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.31.0 published on Wednesday, Apr 10, 2024 by Pulumi

    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: oci_recovery_protection_policy.test_protection_policy.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_protection_policy = oci.RecoveryMod.get_protection_policy(protection_policy_id=oci_recovery_protection_policy["test_protection_policy"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/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: oci_recovery_protection_policy.Test_protection_policy.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 = oci_recovery_protection_policy.Test_protection_policy.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(oci_recovery_protection_policy.test_protection_policy().id())
                .build());
    
        }
    }
    
    variables:
      testProtectionPolicy:
        fn::invoke:
          Function: oci:RecoveryMod:getProtectionPolicy
          Arguments:
            protectionPolicyId: ${oci_recovery_protection_policy.test_protection_policy.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 GetProtectionPolicy(ctx *Context, args *GetProtectionPolicyArgs, opts ...InvokeOption) (*GetProtectionPolicyResult, error)
    func GetProtectionPolicyOutput(ctx *Context, args *GetProtectionPolicyOutputArgs, opts ...InvokeOption) GetProtectionPolicyResultOutput

    > Note: This function is named GetProtectionPolicy 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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:RecoveryMod/getProtectionPolicy:getProtectionPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProtectionPolicyId string
    The protection policy OCID.
    ProtectionPolicyId string
    The protection policy OCID.
    protectionPolicyId String
    The protection policy OCID.
    protectionPolicyId string
    The protection policy OCID.
    protection_policy_id str
    The protection policy OCID.
    protectionPolicyId String
    The protection policy OCID.

    getProtectionPolicy Result

    The following output properties are available:

    BackupRetentionPeriodInDays 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.
    CompartmentId string
    The OCID of the compartment that contains the protection policy.
    DefinedTags Dictionary<string, object>
    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.
    FreeformTags Dictionary<string, object>
    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.
    IsPredefinedPolicy 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.
    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.
    ProtectionPolicyId string
    State string
    The current state of the protection policy. Allowed values are:

    • CREATING
    • UPDATING
    • ACTIVE
    • DELETING
    • DELETED
    • FAILED
    SystemTags Dictionary<string, object>
    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'.
    BackupRetentionPeriodInDays 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.
    CompartmentId string
    The OCID of the compartment that contains the protection policy.
    DefinedTags map[string]interface{}
    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.
    FreeformTags map[string]interface{}
    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.
    IsPredefinedPolicy 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.
    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.
    ProtectionPolicyId string
    State string
    The current state of the protection policy. Allowed values are:

    • CREATING
    • UPDATING
    • ACTIVE
    • DELETING
    • DELETED
    • FAILED
    SystemTags map[string]interface{}
    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'.
    backupRetentionPeriodInDays 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.
    compartmentId String
    The OCID of the compartment that contains the protection policy.
    definedTags Map<String,Object>
    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.
    freeformTags Map<String,Object>
    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.
    isPredefinedPolicy 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.
    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.
    protectionPolicyId String
    state String
    The current state of the protection policy. Allowed values are:

    • CREATING
    • UPDATING
    • ACTIVE
    • DELETING
    • DELETED
    • FAILED
    systemTags Map<String,Object>
    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'.
    backupRetentionPeriodInDays 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.
    compartmentId string
    The OCID of the compartment that contains the protection policy.
    definedTags {[key: string]: any}
    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.
    freeformTags {[key: string]: any}
    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.
    isPredefinedPolicy 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.
    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.
    protectionPolicyId string
    state string
    The current state of the protection policy. Allowed values are:

    • CREATING
    • UPDATING
    • ACTIVE
    • DELETING
    • DELETED
    • FAILED
    systemTags {[key: string]: any}
    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_period_in_days 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 str
    The OCID of the compartment that contains the protection policy.
    defined_tags Mapping[str, Any]
    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.
    freeform_tags Mapping[str, Any]
    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_policy 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 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.
    protection_policy_id str
    state str
    The current state of the protection policy. Allowed values are:

    • CREATING
    • UPDATING
    • ACTIVE
    • DELETING
    • DELETED
    • FAILED
    system_tags Mapping[str, Any]
    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'.
    backupRetentionPeriodInDays 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.
    compartmentId String
    The OCID of the compartment that contains the protection policy.
    definedTags Map<Any>
    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.
    freeformTags Map<Any>
    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.
    isPredefinedPolicy 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.
    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.
    protectionPolicyId String
    state String
    The current state of the protection policy. Allowed values are:

    • CREATING
    • UPDATING
    • ACTIVE
    • DELETING
    • DELETED
    • FAILED
    systemTags Map<Any>
    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 oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.31.0 published on Wednesday, Apr 10, 2024 by Pulumi