1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ObjectStorage
  5. getObjectLifecyclePolicy
Oracle Cloud Infrastructure v1.24.0 published on Thursday, Feb 22, 2024 by Pulumi

oci.ObjectStorage.getObjectLifecyclePolicy

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.24.0 published on Thursday, Feb 22, 2024 by Pulumi

    This data source provides details about a specific Object Lifecycle Policy resource in Oracle Cloud Infrastructure Object Storage service.

    Gets the object lifecycle policy for the bucket.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testObjectLifecyclePolicy = Oci.ObjectStorage.GetObjectLifecyclePolicy.Invoke(new()
        {
            Bucket = @var.Object_lifecycle_policy_bucket,
            Namespace = @var.Object_lifecycle_policy_namespace,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/ObjectStorage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ObjectStorage.GetObjectLifecyclePolicy(ctx, &objectstorage.GetObjectLifecyclePolicyArgs{
    			Bucket:    _var.Object_lifecycle_policy_bucket,
    			Namespace: _var.Object_lifecycle_policy_namespace,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ObjectStorage.ObjectStorageFunctions;
    import com.pulumi.oci.ObjectStorage.inputs.GetObjectLifecyclePolicyArgs;
    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 testObjectLifecyclePolicy = ObjectStorageFunctions.getObjectLifecyclePolicy(GetObjectLifecyclePolicyArgs.builder()
                .bucket(var_.object_lifecycle_policy_bucket())
                .namespace(var_.object_lifecycle_policy_namespace())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_oci as oci
    
    test_object_lifecycle_policy = oci.ObjectStorage.get_object_lifecycle_policy(bucket=var["object_lifecycle_policy_bucket"],
        namespace=var["object_lifecycle_policy_namespace"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testObjectLifecyclePolicy = oci.ObjectStorage.getObjectLifecyclePolicy({
        bucket: _var.object_lifecycle_policy_bucket,
        namespace: _var.object_lifecycle_policy_namespace,
    });
    
    variables:
      testObjectLifecyclePolicy:
        fn::invoke:
          Function: oci:ObjectStorage:getObjectLifecyclePolicy
          Arguments:
            bucket: ${var.object_lifecycle_policy_bucket}
            namespace: ${var.object_lifecycle_policy_namespace}
    

    Using getObjectLifecyclePolicy

    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 getObjectLifecyclePolicy(args: GetObjectLifecyclePolicyArgs, opts?: InvokeOptions): Promise<GetObjectLifecyclePolicyResult>
    function getObjectLifecyclePolicyOutput(args: GetObjectLifecyclePolicyOutputArgs, opts?: InvokeOptions): Output<GetObjectLifecyclePolicyResult>
    def get_object_lifecycle_policy(bucket: Optional[str] = None,
                                    namespace: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetObjectLifecyclePolicyResult
    def get_object_lifecycle_policy_output(bucket: Optional[pulumi.Input[str]] = None,
                                    namespace: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetObjectLifecyclePolicyResult]
    func GetObjectLifecyclePolicy(ctx *Context, args *GetObjectLifecyclePolicyArgs, opts ...InvokeOption) (*GetObjectLifecyclePolicyResult, error)
    func GetObjectLifecyclePolicyOutput(ctx *Context, args *GetObjectLifecyclePolicyOutputArgs, opts ...InvokeOption) GetObjectLifecyclePolicyResultOutput

    > Note: This function is named GetObjectLifecyclePolicy in the Go SDK.

    public static class GetObjectLifecyclePolicy 
    {
        public static Task<GetObjectLifecyclePolicyResult> InvokeAsync(GetObjectLifecyclePolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetObjectLifecyclePolicyResult> Invoke(GetObjectLifecyclePolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetObjectLifecyclePolicyResult> getObjectLifecyclePolicy(GetObjectLifecyclePolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:ObjectStorage/getObjectLifecyclePolicy:getObjectLifecyclePolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    Namespace string
    The Object Storage namespace used for the request.
    Bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    Namespace string
    The Object Storage namespace used for the request.
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    namespace String
    The Object Storage namespace used for the request.
    bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    namespace string
    The Object Storage namespace used for the request.
    bucket str
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    namespace str
    The Object Storage namespace used for the request.
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    namespace String
    The Object Storage namespace used for the request.

    getObjectLifecyclePolicy Result

    The following output properties are available:

    Bucket string
    Id string
    Namespace string
    Rules List<GetObjectLifecyclePolicyRule>
    The live lifecycle policy on the bucket.
    TimeCreated string
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    Bucket string
    Id string
    Namespace string
    Rules []GetObjectLifecyclePolicyRule
    The live lifecycle policy on the bucket.
    TimeCreated string
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    bucket String
    id String
    namespace String
    rules List<GetObjectLifecyclePolicyRule>
    The live lifecycle policy on the bucket.
    timeCreated String
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    bucket string
    id string
    namespace string
    rules GetObjectLifecyclePolicyRule[]
    The live lifecycle policy on the bucket.
    timeCreated string
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    bucket str
    id str
    namespace str
    rules GetObjectLifecyclePolicyRule]
    The live lifecycle policy on the bucket.
    time_created str
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    bucket String
    id String
    namespace String
    rules List<Property Map>
    The live lifecycle policy on the bucket.
    timeCreated String
    The date and time the object lifecycle policy was created, as described in RFC 3339.

    Supporting Types

    GetObjectLifecyclePolicyRule

    Action string
    The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects from Standard and InfrequentAccess storage tiers into the Archive storage tier. Rules using the action 'INFREQUENT_ACCESS' move objects from Standard storage tier into the Infrequent Access Storage tier. Objects that are already in InfrequentAccess tier or in Archive tier are left untouched. Rules using the action 'DELETE' permanently delete objects from buckets. Rules using 'ABORT' abort the uncommitted multipart-uploads and permanently delete their parts from buckets.
    IsEnabled bool
    A Boolean that determines whether this rule is currently enabled.
    Name string
    The name of the lifecycle rule to be applied.
    ObjectNameFilters List<GetObjectLifecyclePolicyRuleObjectNameFilter>
    A filter that compares object names to a set of prefixes or patterns to determine if a rule applies to a given object. The filter can contain include glob patterns, exclude glob patterns and inclusion prefixes. The inclusion prefixes property is kept for backward compatibility. It is recommended to use inclusion patterns instead of prefixes. Exclusions take precedence over inclusions.
    Target string
    The target of the object lifecycle policy rule. The values of target can be either "objects", "multipart-uploads" or "previous-object-versions". This field when declared as "objects" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for objects. This field when declared as "previous-object-versions" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for previous versions of existing objects. This field when declared as "multipart-uploads" is used to specify the ABORT (only) rule for uncommitted multipart-uploads.
    TimeAmount string
    Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object's Last-Modified time.
    TimeUnit string
    The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.
    Action string
    The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects from Standard and InfrequentAccess storage tiers into the Archive storage tier. Rules using the action 'INFREQUENT_ACCESS' move objects from Standard storage tier into the Infrequent Access Storage tier. Objects that are already in InfrequentAccess tier or in Archive tier are left untouched. Rules using the action 'DELETE' permanently delete objects from buckets. Rules using 'ABORT' abort the uncommitted multipart-uploads and permanently delete their parts from buckets.
    IsEnabled bool
    A Boolean that determines whether this rule is currently enabled.
    Name string
    The name of the lifecycle rule to be applied.
    ObjectNameFilters []GetObjectLifecyclePolicyRuleObjectNameFilter
    A filter that compares object names to a set of prefixes or patterns to determine if a rule applies to a given object. The filter can contain include glob patterns, exclude glob patterns and inclusion prefixes. The inclusion prefixes property is kept for backward compatibility. It is recommended to use inclusion patterns instead of prefixes. Exclusions take precedence over inclusions.
    Target string
    The target of the object lifecycle policy rule. The values of target can be either "objects", "multipart-uploads" or "previous-object-versions". This field when declared as "objects" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for objects. This field when declared as "previous-object-versions" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for previous versions of existing objects. This field when declared as "multipart-uploads" is used to specify the ABORT (only) rule for uncommitted multipart-uploads.
    TimeAmount string
    Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object's Last-Modified time.
    TimeUnit string
    The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.
    action String
    The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects from Standard and InfrequentAccess storage tiers into the Archive storage tier. Rules using the action 'INFREQUENT_ACCESS' move objects from Standard storage tier into the Infrequent Access Storage tier. Objects that are already in InfrequentAccess tier or in Archive tier are left untouched. Rules using the action 'DELETE' permanently delete objects from buckets. Rules using 'ABORT' abort the uncommitted multipart-uploads and permanently delete their parts from buckets.
    isEnabled Boolean
    A Boolean that determines whether this rule is currently enabled.
    name String
    The name of the lifecycle rule to be applied.
    objectNameFilters List<GetObjectLifecyclePolicyRuleObjectNameFilter>
    A filter that compares object names to a set of prefixes or patterns to determine if a rule applies to a given object. The filter can contain include glob patterns, exclude glob patterns and inclusion prefixes. The inclusion prefixes property is kept for backward compatibility. It is recommended to use inclusion patterns instead of prefixes. Exclusions take precedence over inclusions.
    target String
    The target of the object lifecycle policy rule. The values of target can be either "objects", "multipart-uploads" or "previous-object-versions". This field when declared as "objects" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for objects. This field when declared as "previous-object-versions" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for previous versions of existing objects. This field when declared as "multipart-uploads" is used to specify the ABORT (only) rule for uncommitted multipart-uploads.
    timeAmount String
    Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object's Last-Modified time.
    timeUnit String
    The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.
    action string
    The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects from Standard and InfrequentAccess storage tiers into the Archive storage tier. Rules using the action 'INFREQUENT_ACCESS' move objects from Standard storage tier into the Infrequent Access Storage tier. Objects that are already in InfrequentAccess tier or in Archive tier are left untouched. Rules using the action 'DELETE' permanently delete objects from buckets. Rules using 'ABORT' abort the uncommitted multipart-uploads and permanently delete their parts from buckets.
    isEnabled boolean
    A Boolean that determines whether this rule is currently enabled.
    name string
    The name of the lifecycle rule to be applied.
    objectNameFilters GetObjectLifecyclePolicyRuleObjectNameFilter[]
    A filter that compares object names to a set of prefixes or patterns to determine if a rule applies to a given object. The filter can contain include glob patterns, exclude glob patterns and inclusion prefixes. The inclusion prefixes property is kept for backward compatibility. It is recommended to use inclusion patterns instead of prefixes. Exclusions take precedence over inclusions.
    target string
    The target of the object lifecycle policy rule. The values of target can be either "objects", "multipart-uploads" or "previous-object-versions". This field when declared as "objects" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for objects. This field when declared as "previous-object-versions" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for previous versions of existing objects. This field when declared as "multipart-uploads" is used to specify the ABORT (only) rule for uncommitted multipart-uploads.
    timeAmount string
    Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object's Last-Modified time.
    timeUnit string
    The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.
    action str
    The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects from Standard and InfrequentAccess storage tiers into the Archive storage tier. Rules using the action 'INFREQUENT_ACCESS' move objects from Standard storage tier into the Infrequent Access Storage tier. Objects that are already in InfrequentAccess tier or in Archive tier are left untouched. Rules using the action 'DELETE' permanently delete objects from buckets. Rules using 'ABORT' abort the uncommitted multipart-uploads and permanently delete their parts from buckets.
    is_enabled bool
    A Boolean that determines whether this rule is currently enabled.
    name str
    The name of the lifecycle rule to be applied.
    object_name_filters GetObjectLifecyclePolicyRuleObjectNameFilter]
    A filter that compares object names to a set of prefixes or patterns to determine if a rule applies to a given object. The filter can contain include glob patterns, exclude glob patterns and inclusion prefixes. The inclusion prefixes property is kept for backward compatibility. It is recommended to use inclusion patterns instead of prefixes. Exclusions take precedence over inclusions.
    target str
    The target of the object lifecycle policy rule. The values of target can be either "objects", "multipart-uploads" or "previous-object-versions". This field when declared as "objects" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for objects. This field when declared as "previous-object-versions" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for previous versions of existing objects. This field when declared as "multipart-uploads" is used to specify the ABORT (only) rule for uncommitted multipart-uploads.
    time_amount str
    Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object's Last-Modified time.
    time_unit str
    The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.
    action String
    The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects from Standard and InfrequentAccess storage tiers into the Archive storage tier. Rules using the action 'INFREQUENT_ACCESS' move objects from Standard storage tier into the Infrequent Access Storage tier. Objects that are already in InfrequentAccess tier or in Archive tier are left untouched. Rules using the action 'DELETE' permanently delete objects from buckets. Rules using 'ABORT' abort the uncommitted multipart-uploads and permanently delete their parts from buckets.
    isEnabled Boolean
    A Boolean that determines whether this rule is currently enabled.
    name String
    The name of the lifecycle rule to be applied.
    objectNameFilters List<Property Map>
    A filter that compares object names to a set of prefixes or patterns to determine if a rule applies to a given object. The filter can contain include glob patterns, exclude glob patterns and inclusion prefixes. The inclusion prefixes property is kept for backward compatibility. It is recommended to use inclusion patterns instead of prefixes. Exclusions take precedence over inclusions.
    target String
    The target of the object lifecycle policy rule. The values of target can be either "objects", "multipart-uploads" or "previous-object-versions". This field when declared as "objects" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for objects. This field when declared as "previous-object-versions" is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for previous versions of existing objects. This field when declared as "multipart-uploads" is used to specify the ABORT (only) rule for uncommitted multipart-uploads.
    timeAmount String
    Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object's Last-Modified time.
    timeUnit String
    The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.

    GetObjectLifecyclePolicyRuleObjectNameFilter

    ExclusionPatterns List<string>
    An array of glob patterns to match the object names to exclude. An empty array is ignored. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    InclusionPatterns List<string>
    An array of glob patterns to match the object names to include. An empty array includes all objects in the bucket. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    InclusionPrefixes List<string>
    An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    ExclusionPatterns []string
    An array of glob patterns to match the object names to exclude. An empty array is ignored. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    InclusionPatterns []string
    An array of glob patterns to match the object names to include. An empty array includes all objects in the bucket. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    InclusionPrefixes []string
    An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    exclusionPatterns List<String>
    An array of glob patterns to match the object names to exclude. An empty array is ignored. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    inclusionPatterns List<String>
    An array of glob patterns to match the object names to include. An empty array includes all objects in the bucket. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    inclusionPrefixes List<String>
    An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    exclusionPatterns string[]
    An array of glob patterns to match the object names to exclude. An empty array is ignored. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    inclusionPatterns string[]
    An array of glob patterns to match the object names to include. An empty array includes all objects in the bucket. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    inclusionPrefixes string[]
    An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    exclusion_patterns Sequence[str]
    An array of glob patterns to match the object names to exclude. An empty array is ignored. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    inclusion_patterns Sequence[str]
    An array of glob patterns to match the object names to include. An empty array includes all objects in the bucket. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    inclusion_prefixes Sequence[str]
    An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    exclusionPatterns List<String>
    An array of glob patterns to match the object names to exclude. An empty array is ignored. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    inclusionPatterns List<String>
    An array of glob patterns to match the object names to include. An empty array includes all objects in the bucket. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
    inclusionPrefixes List<String>
    An array of object name prefixes that the rule will apply to. An empty array means to include all objects.

    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.24.0 published on Thursday, Feb 22, 2024 by Pulumi