1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ObjectStorage
  5. ObjectLifecyclePolicy
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.ObjectStorage.ObjectLifecyclePolicy

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This resource provides the Object Lifecycle Policy resource in Oracle Cloud Infrastructure Object Storage service.

    Creates or replaces the object lifecycle policy for the bucket.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testObjectLifecyclePolicy = new oci.objectstorage.ObjectLifecyclePolicy("test_object_lifecycle_policy", {
        bucket: objectLifecyclePolicyBucket,
        namespace: objectLifecyclePolicyNamespace,
        rules: [{
            action: objectLifecyclePolicyRulesAction,
            isEnabled: objectLifecyclePolicyRulesIsEnabled,
            name: objectLifecyclePolicyRulesName,
            timeAmount: objectLifecyclePolicyRulesTimeAmount,
            timeUnit: objectLifecyclePolicyRulesTimeUnit,
            objectNameFilter: {
                exclusionPatterns: objectLifecyclePolicyRulesObjectNameFilterExclusionPatterns,
                inclusionPatterns: objectLifecyclePolicyRulesObjectNameFilterInclusionPatterns,
                inclusionPrefixes: objectLifecyclePolicyRulesObjectNameFilterInclusionPrefixes,
            },
            target: objectLifecyclePolicyRulesTarget,
        }],
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_object_lifecycle_policy = oci.object_storage.ObjectLifecyclePolicy("test_object_lifecycle_policy",
        bucket=object_lifecycle_policy_bucket,
        namespace=object_lifecycle_policy_namespace,
        rules=[{
            "action": object_lifecycle_policy_rules_action,
            "is_enabled": object_lifecycle_policy_rules_is_enabled,
            "name": object_lifecycle_policy_rules_name,
            "time_amount": object_lifecycle_policy_rules_time_amount,
            "time_unit": object_lifecycle_policy_rules_time_unit,
            "object_name_filter": {
                "exclusion_patterns": object_lifecycle_policy_rules_object_name_filter_exclusion_patterns,
                "inclusion_patterns": object_lifecycle_policy_rules_object_name_filter_inclusion_patterns,
                "inclusion_prefixes": object_lifecycle_policy_rules_object_name_filter_inclusion_prefixes,
            },
            "target": object_lifecycle_policy_rules_target,
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/ObjectStorage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ObjectStorage.NewObjectLifecyclePolicy(ctx, "test_object_lifecycle_policy", &ObjectStorage.ObjectLifecyclePolicyArgs{
    			Bucket:    pulumi.Any(objectLifecyclePolicyBucket),
    			Namespace: pulumi.Any(objectLifecyclePolicyNamespace),
    			Rules: objectstorage.ObjectLifecyclePolicyRuleArray{
    				&objectstorage.ObjectLifecyclePolicyRuleArgs{
    					Action:     pulumi.Any(objectLifecyclePolicyRulesAction),
    					IsEnabled:  pulumi.Any(objectLifecyclePolicyRulesIsEnabled),
    					Name:       pulumi.Any(objectLifecyclePolicyRulesName),
    					TimeAmount: pulumi.Any(objectLifecyclePolicyRulesTimeAmount),
    					TimeUnit:   pulumi.Any(objectLifecyclePolicyRulesTimeUnit),
    					ObjectNameFilter: &objectstorage.ObjectLifecyclePolicyRuleObjectNameFilterArgs{
    						ExclusionPatterns: pulumi.Any(objectLifecyclePolicyRulesObjectNameFilterExclusionPatterns),
    						InclusionPatterns: pulumi.Any(objectLifecyclePolicyRulesObjectNameFilterInclusionPatterns),
    						InclusionPrefixes: pulumi.Any(objectLifecyclePolicyRulesObjectNameFilterInclusionPrefixes),
    					},
    					Target: pulumi.Any(objectLifecyclePolicyRulesTarget),
    				},
    			},
    		})
    		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 testObjectLifecyclePolicy = new Oci.ObjectStorage.ObjectLifecyclePolicy("test_object_lifecycle_policy", new()
        {
            Bucket = objectLifecyclePolicyBucket,
            Namespace = objectLifecyclePolicyNamespace,
            Rules = new[]
            {
                new Oci.ObjectStorage.Inputs.ObjectLifecyclePolicyRuleArgs
                {
                    Action = objectLifecyclePolicyRulesAction,
                    IsEnabled = objectLifecyclePolicyRulesIsEnabled,
                    Name = objectLifecyclePolicyRulesName,
                    TimeAmount = objectLifecyclePolicyRulesTimeAmount,
                    TimeUnit = objectLifecyclePolicyRulesTimeUnit,
                    ObjectNameFilter = new Oci.ObjectStorage.Inputs.ObjectLifecyclePolicyRuleObjectNameFilterArgs
                    {
                        ExclusionPatterns = objectLifecyclePolicyRulesObjectNameFilterExclusionPatterns,
                        InclusionPatterns = objectLifecyclePolicyRulesObjectNameFilterInclusionPatterns,
                        InclusionPrefixes = objectLifecyclePolicyRulesObjectNameFilterInclusionPrefixes,
                    },
                    Target = objectLifecyclePolicyRulesTarget,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ObjectStorage.ObjectLifecyclePolicy;
    import com.pulumi.oci.ObjectStorage.ObjectLifecyclePolicyArgs;
    import com.pulumi.oci.ObjectStorage.inputs.ObjectLifecyclePolicyRuleArgs;
    import com.pulumi.oci.ObjectStorage.inputs.ObjectLifecyclePolicyRuleObjectNameFilterArgs;
    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) {
            var testObjectLifecyclePolicy = new ObjectLifecyclePolicy("testObjectLifecyclePolicy", ObjectLifecyclePolicyArgs.builder()
                .bucket(objectLifecyclePolicyBucket)
                .namespace(objectLifecyclePolicyNamespace)
                .rules(ObjectLifecyclePolicyRuleArgs.builder()
                    .action(objectLifecyclePolicyRulesAction)
                    .isEnabled(objectLifecyclePolicyRulesIsEnabled)
                    .name(objectLifecyclePolicyRulesName)
                    .timeAmount(objectLifecyclePolicyRulesTimeAmount)
                    .timeUnit(objectLifecyclePolicyRulesTimeUnit)
                    .objectNameFilter(ObjectLifecyclePolicyRuleObjectNameFilterArgs.builder()
                        .exclusionPatterns(objectLifecyclePolicyRulesObjectNameFilterExclusionPatterns)
                        .inclusionPatterns(objectLifecyclePolicyRulesObjectNameFilterInclusionPatterns)
                        .inclusionPrefixes(objectLifecyclePolicyRulesObjectNameFilterInclusionPrefixes)
                        .build())
                    .target(objectLifecyclePolicyRulesTarget)
                    .build())
                .build());
    
        }
    }
    
    resources:
      testObjectLifecyclePolicy:
        type: oci:ObjectStorage:ObjectLifecyclePolicy
        name: test_object_lifecycle_policy
        properties:
          bucket: ${objectLifecyclePolicyBucket}
          namespace: ${objectLifecyclePolicyNamespace}
          rules:
            - action: ${objectLifecyclePolicyRulesAction}
              isEnabled: ${objectLifecyclePolicyRulesIsEnabled}
              name: ${objectLifecyclePolicyRulesName}
              timeAmount: ${objectLifecyclePolicyRulesTimeAmount}
              timeUnit: ${objectLifecyclePolicyRulesTimeUnit}
              objectNameFilter:
                exclusionPatterns: ${objectLifecyclePolicyRulesObjectNameFilterExclusionPatterns}
                inclusionPatterns: ${objectLifecyclePolicyRulesObjectNameFilterInclusionPatterns}
                inclusionPrefixes: ${objectLifecyclePolicyRulesObjectNameFilterInclusionPrefixes}
              target: ${objectLifecyclePolicyRulesTarget}
    

    Create ObjectLifecyclePolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ObjectLifecyclePolicy(name: string, args: ObjectLifecyclePolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ObjectLifecyclePolicy(resource_name: str,
                              args: ObjectLifecyclePolicyArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def ObjectLifecyclePolicy(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              bucket: Optional[str] = None,
                              namespace: Optional[str] = None,
                              rules: Optional[Sequence[_objectstorage.ObjectLifecyclePolicyRuleArgs]] = None)
    func NewObjectLifecyclePolicy(ctx *Context, name string, args ObjectLifecyclePolicyArgs, opts ...ResourceOption) (*ObjectLifecyclePolicy, error)
    public ObjectLifecyclePolicy(string name, ObjectLifecyclePolicyArgs args, CustomResourceOptions? opts = null)
    public ObjectLifecyclePolicy(String name, ObjectLifecyclePolicyArgs args)
    public ObjectLifecyclePolicy(String name, ObjectLifecyclePolicyArgs args, CustomResourceOptions options)
    
    type: oci:ObjectStorage:ObjectLifecyclePolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ObjectLifecyclePolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ObjectLifecyclePolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ObjectLifecyclePolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ObjectLifecyclePolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ObjectLifecyclePolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var objectLifecyclePolicyResource = new Oci.ObjectStorage.ObjectLifecyclePolicy("objectLifecyclePolicyResource", new()
    {
        Bucket = "string",
        Namespace = "string",
        Rules = new[]
        {
            new Oci.ObjectStorage.Inputs.ObjectLifecyclePolicyRuleArgs
            {
                Action = "string",
                IsEnabled = false,
                Name = "string",
                TimeAmount = "string",
                TimeUnit = "string",
                ObjectNameFilter = new Oci.ObjectStorage.Inputs.ObjectLifecyclePolicyRuleObjectNameFilterArgs
                {
                    ExclusionPatterns = new[]
                    {
                        "string",
                    },
                    InclusionPatterns = new[]
                    {
                        "string",
                    },
                    InclusionPrefixes = new[]
                    {
                        "string",
                    },
                },
                Target = "string",
            },
        },
    });
    
    example, err := ObjectStorage.NewObjectLifecyclePolicy(ctx, "objectLifecyclePolicyResource", &ObjectStorage.ObjectLifecyclePolicyArgs{
    	Bucket:    pulumi.String("string"),
    	Namespace: pulumi.String("string"),
    	Rules: objectstorage.ObjectLifecyclePolicyRuleArray{
    		&objectstorage.ObjectLifecyclePolicyRuleArgs{
    			Action:     pulumi.String("string"),
    			IsEnabled:  pulumi.Bool(false),
    			Name:       pulumi.String("string"),
    			TimeAmount: pulumi.String("string"),
    			TimeUnit:   pulumi.String("string"),
    			ObjectNameFilter: &objectstorage.ObjectLifecyclePolicyRuleObjectNameFilterArgs{
    				ExclusionPatterns: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    				InclusionPatterns: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    				InclusionPrefixes: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    			},
    			Target: pulumi.String("string"),
    		},
    	},
    })
    
    var objectLifecyclePolicyResource = new ObjectLifecyclePolicy("objectLifecyclePolicyResource", ObjectLifecyclePolicyArgs.builder()
        .bucket("string")
        .namespace("string")
        .rules(ObjectLifecyclePolicyRuleArgs.builder()
            .action("string")
            .isEnabled(false)
            .name("string")
            .timeAmount("string")
            .timeUnit("string")
            .objectNameFilter(ObjectLifecyclePolicyRuleObjectNameFilterArgs.builder()
                .exclusionPatterns("string")
                .inclusionPatterns("string")
                .inclusionPrefixes("string")
                .build())
            .target("string")
            .build())
        .build());
    
    object_lifecycle_policy_resource = oci.object_storage.ObjectLifecyclePolicy("objectLifecyclePolicyResource",
        bucket="string",
        namespace="string",
        rules=[{
            "action": "string",
            "is_enabled": False,
            "name": "string",
            "time_amount": "string",
            "time_unit": "string",
            "object_name_filter": {
                "exclusion_patterns": ["string"],
                "inclusion_patterns": ["string"],
                "inclusion_prefixes": ["string"],
            },
            "target": "string",
        }])
    
    const objectLifecyclePolicyResource = new oci.objectstorage.ObjectLifecyclePolicy("objectLifecyclePolicyResource", {
        bucket: "string",
        namespace: "string",
        rules: [{
            action: "string",
            isEnabled: false,
            name: "string",
            timeAmount: "string",
            timeUnit: "string",
            objectNameFilter: {
                exclusionPatterns: ["string"],
                inclusionPatterns: ["string"],
                inclusionPrefixes: ["string"],
            },
            target: "string",
        }],
    });
    
    type: oci:ObjectStorage:ObjectLifecyclePolicy
    properties:
        bucket: string
        namespace: string
        rules:
            - action: string
              isEnabled: false
              name: string
              objectNameFilter:
                exclusionPatterns:
                    - string
                inclusionPatterns:
                    - string
                inclusionPrefixes:
                    - string
              target: string
              timeAmount: string
              timeUnit: string
    

    ObjectLifecyclePolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ObjectLifecyclePolicy resource accepts the following input properties:

    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.
    Rules List<ObjectLifecyclePolicyRule>
    (Updatable) The bucket's set of lifecycle policy rules.
    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.
    Rules []ObjectLifecyclePolicyRuleArgs
    (Updatable) The bucket's set of lifecycle policy rules.
    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.
    rules List<ObjectLifecyclePolicyRule>
    (Updatable) The bucket's set of lifecycle policy rules.
    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.
    rules ObjectLifecyclePolicyRule[]
    (Updatable) The bucket's set of lifecycle policy rules.
    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.
    rules Sequence[objectstorage.ObjectLifecyclePolicyRuleArgs]
    (Updatable) The bucket's set of lifecycle policy rules.
    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.
    rules List<Property Map>
    (Updatable) The bucket's set of lifecycle policy rules.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ObjectLifecyclePolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    TimeCreated string
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    Id string
    The provider-assigned unique ID for this managed resource.
    TimeCreated string
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    id String
    The provider-assigned unique ID for this managed resource.
    timeCreated String
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    id string
    The provider-assigned unique ID for this managed resource.
    timeCreated string
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    id str
    The provider-assigned unique ID for this managed resource.
    time_created str
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    id String
    The provider-assigned unique ID for this managed resource.
    timeCreated String
    The date and time the object lifecycle policy was created, as described in RFC 3339.

    Look up Existing ObjectLifecyclePolicy Resource

    Get an existing ObjectLifecyclePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ObjectLifecyclePolicyState, opts?: CustomResourceOptions): ObjectLifecyclePolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket: Optional[str] = None,
            namespace: Optional[str] = None,
            rules: Optional[Sequence[_objectstorage.ObjectLifecyclePolicyRuleArgs]] = None,
            time_created: Optional[str] = None) -> ObjectLifecyclePolicy
    func GetObjectLifecyclePolicy(ctx *Context, name string, id IDInput, state *ObjectLifecyclePolicyState, opts ...ResourceOption) (*ObjectLifecyclePolicy, error)
    public static ObjectLifecyclePolicy Get(string name, Input<string> id, ObjectLifecyclePolicyState? state, CustomResourceOptions? opts = null)
    public static ObjectLifecyclePolicy get(String name, Output<String> id, ObjectLifecyclePolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state 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.
    Rules List<ObjectLifecyclePolicyRule>
    (Updatable) The bucket's set of lifecycle policy rules.
    TimeCreated string
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    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.
    Rules []ObjectLifecyclePolicyRuleArgs
    (Updatable) The bucket's set of lifecycle policy rules.
    TimeCreated string
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    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.
    rules List<ObjectLifecyclePolicyRule>
    (Updatable) The bucket's set of lifecycle policy rules.
    timeCreated String
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    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.
    rules ObjectLifecyclePolicyRule[]
    (Updatable) The bucket's set of lifecycle policy rules.
    timeCreated string
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    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.
    rules Sequence[objectstorage.ObjectLifecyclePolicyRuleArgs]
    (Updatable) The bucket's set of lifecycle policy rules.
    time_created str
    The date and time the object lifecycle policy was created, as described in RFC 3339.
    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.
    rules List<Property Map>
    (Updatable) The bucket's set of lifecycle policy rules.
    timeCreated String
    The date and time the object lifecycle policy was created, as described in RFC 3339.

    Supporting Types

    ObjectLifecyclePolicyRule, ObjectLifecyclePolicyRuleArgs

    Action string
    (Updatable) 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
    (Updatable) A Boolean that determines whether this rule is currently enabled.
    Name string
    (Updatable) The name of the lifecycle rule to be applied.
    TimeAmount string
    (Updatable) 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

    (Updatable) 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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    ObjectNameFilter ObjectLifecyclePolicyRuleObjectNameFilter
    (Updatable) 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
    (Updatable) 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.
    Action string
    (Updatable) 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
    (Updatable) A Boolean that determines whether this rule is currently enabled.
    Name string
    (Updatable) The name of the lifecycle rule to be applied.
    TimeAmount string
    (Updatable) 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

    (Updatable) 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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    ObjectNameFilter ObjectLifecyclePolicyRuleObjectNameFilter
    (Updatable) 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
    (Updatable) 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.
    action String
    (Updatable) 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
    (Updatable) A Boolean that determines whether this rule is currently enabled.
    name String
    (Updatable) The name of the lifecycle rule to be applied.
    timeAmount String
    (Updatable) 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

    (Updatable) 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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    objectNameFilter ObjectLifecyclePolicyRuleObjectNameFilter
    (Updatable) 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
    (Updatable) 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.
    action string
    (Updatable) 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
    (Updatable) A Boolean that determines whether this rule is currently enabled.
    name string
    (Updatable) The name of the lifecycle rule to be applied.
    timeAmount string
    (Updatable) 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

    (Updatable) 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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    objectNameFilter ObjectLifecyclePolicyRuleObjectNameFilter
    (Updatable) 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
    (Updatable) 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.
    action str
    (Updatable) 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
    (Updatable) A Boolean that determines whether this rule is currently enabled.
    name str
    (Updatable) The name of the lifecycle rule to be applied.
    time_amount str
    (Updatable) 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

    (Updatable) 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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    object_name_filter objectstorage.ObjectLifecyclePolicyRuleObjectNameFilter
    (Updatable) 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
    (Updatable) 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.
    action String
    (Updatable) 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
    (Updatable) A Boolean that determines whether this rule is currently enabled.
    name String
    (Updatable) The name of the lifecycle rule to be applied.
    timeAmount String
    (Updatable) 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

    (Updatable) 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.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    objectNameFilter Property Map
    (Updatable) 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
    (Updatable) 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.

    ObjectLifecyclePolicyRuleObjectNameFilter, ObjectLifecyclePolicyRuleObjectNameFilterArgs

    ExclusionPatterns List<string>

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    InclusionPatterns List<string>

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    InclusionPrefixes List<string>
    (Updatable) An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    ExclusionPatterns []string

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    InclusionPatterns []string

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    InclusionPrefixes []string
    (Updatable) An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    exclusionPatterns List<String>

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    inclusionPatterns List<String>

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    inclusionPrefixes List<String>
    (Updatable) An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    exclusionPatterns string[]

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    inclusionPatterns string[]

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    inclusionPrefixes string[]
    (Updatable) An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    exclusion_patterns Sequence[str]

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    inclusion_patterns Sequence[str]

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    inclusion_prefixes Sequence[str]
    (Updatable) An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
    exclusionPatterns List<String>

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    inclusionPatterns List<String>

    (Updatable) 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.

    The special pattern characters have the following meanings:

    \ Escapes the following character

    •       Matches any string of characters. ?           Matches any single character . [...]       Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
      
    inclusionPrefixes List<String>
    (Updatable) An array of object name prefixes that the rule will apply to. An empty array means to include all objects.

    Import

    ObjectLifecyclePolicies can be imported using the id, e.g.

    $ pulumi import oci:ObjectStorage/objectLifecyclePolicy:ObjectLifecyclePolicy test_object_lifecycle_policy "n/{namespaceName}/b/{bucketName}/l"
    

    To learn more about importing existing cloud resources, see Importing resources.

    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 v2.17.0 published on Friday, Nov 15, 2024 by Pulumi