Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi
oci.ObjectStorage.getObjectLifecyclePolicy
Explore with Pulumi AI
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
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testObjectLifecyclePolicy = oci.ObjectStorage.getObjectLifecyclePolicy({
bucket: objectLifecyclePolicyBucket,
namespace: objectLifecyclePolicyNamespace,
});
import pulumi
import pulumi_oci as oci
test_object_lifecycle_policy = oci.ObjectStorage.get_object_lifecycle_policy(bucket=object_lifecycle_policy_bucket,
namespace=object_lifecycle_policy_namespace)
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.GetObjectLifecyclePolicy(ctx, &objectstorage.GetObjectLifecyclePolicyArgs{
Bucket: objectLifecyclePolicyBucket,
Namespace: objectLifecyclePolicyNamespace,
}, 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 testObjectLifecyclePolicy = Oci.ObjectStorage.GetObjectLifecyclePolicy.Invoke(new()
{
Bucket = objectLifecyclePolicyBucket,
Namespace = objectLifecyclePolicyNamespace,
});
});
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(objectLifecyclePolicyBucket)
.namespace(objectLifecyclePolicyNamespace)
.build());
}
}
variables:
testObjectLifecyclePolicy:
fn::invoke:
Function: oci:ObjectStorage:getObjectLifecyclePolicy
Arguments:
bucket: ${objectLifecyclePolicyBucket}
namespace: ${objectLifecyclePolicyNamespace}
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:
getObjectLifecyclePolicy Result
The following output properties are available:
- Bucket string
- Id string
- Namespace string
- Rules
List<Get
Object Lifecycle Policy Rule> - The live lifecycle policy on the bucket.
- Time
Created string - The date and time the object lifecycle policy was created, as described in RFC 3339.
- Bucket string
- Id string
- Namespace string
- Rules
[]Get
Object Lifecycle Policy Rule - The live lifecycle policy on the bucket.
- Time
Created string - The date and time the object lifecycle policy was created, as described in RFC 3339.
- bucket String
- id String
- namespace String
- rules
List<Get
Object Lifecycle Policy Rule> - The live lifecycle policy on the bucket.
- time
Created String - The date and time the object lifecycle policy was created, as described in RFC 3339.
- bucket string
- id string
- namespace string
- rules
Get
Object Lifecycle Policy Rule[] - The live lifecycle policy on the bucket.
- time
Created string - The date and time the object lifecycle policy was created, as described in RFC 3339.
- bucket str
- id str
- namespace str
- rules
Sequence[objectstorage.
Get Object Lifecycle Policy Rule] - 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.
- time
Created 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.
- Is
Enabled bool - A Boolean that determines whether this rule is currently enabled.
- Name string
- The name of the lifecycle rule to be applied.
- Object
Name List<GetFilters Object Lifecycle Policy Rule Object Name Filter> - 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.
- Time
Amount 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.
- Time
Unit 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.
- Is
Enabled bool - A Boolean that determines whether this rule is currently enabled.
- Name string
- The name of the lifecycle rule to be applied.
- Object
Name []GetFilters Object Lifecycle Policy Rule Object Name Filter - 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.
- Time
Amount 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.
- Time
Unit 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.
- is
Enabled Boolean - A Boolean that determines whether this rule is currently enabled.
- name String
- The name of the lifecycle rule to be applied.
- object
Name List<GetFilters Object Lifecycle Policy Rule Object Name Filter> - 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.
- time
Amount 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.
- time
Unit 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.
- is
Enabled boolean - A Boolean that determines whether this rule is currently enabled.
- name string
- The name of the lifecycle rule to be applied.
- object
Name GetFilters Object Lifecycle Policy Rule Object Name Filter[] - 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.
- time
Amount 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.
- time
Unit 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_ Sequence[objectstorage.filters Get Object Lifecycle Policy Rule Object Name Filter] - 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.
- is
Enabled Boolean - A Boolean that determines whether this rule is currently enabled.
- name String
- The name of the lifecycle rule to be applied.
- object
Name List<Property Map>Filters - 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.
- time
Amount 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.
- time
Unit 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
- Exclusion
Patterns 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.
- Inclusion
Patterns 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.
- Inclusion
Prefixes List<string> - An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
- Exclusion
Patterns []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.
- Inclusion
Patterns []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.
- Inclusion
Prefixes []string - An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
- exclusion
Patterns 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.
- inclusion
Patterns 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.
- inclusion
Prefixes List<String> - An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
- exclusion
Patterns 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.
- inclusion
Patterns 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.
- inclusion
Prefixes 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.
- exclusion
Patterns 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.
- inclusion
Patterns 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.
- inclusion
Prefixes 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.