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

oci.ObjectStorage.ReplicationPolicy

Explore with Pulumi AI

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

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

    Creates a replication policy for the specified bucket.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testReplicationPolicy = new oci.objectstorage.ReplicationPolicy("test_replication_policy", {
        bucket: replicationPolicyBucket,
        destinationBucketName: testBucket.name,
        destinationRegionName: testRegion.name,
        name: replicationPolicyName,
        namespace: replicationPolicyNamespace,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_replication_policy = oci.object_storage.ReplicationPolicy("test_replication_policy",
        bucket=replication_policy_bucket,
        destination_bucket_name=test_bucket["name"],
        destination_region_name=test_region["name"],
        name=replication_policy_name,
        namespace=replication_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.NewReplicationPolicy(ctx, "test_replication_policy", &ObjectStorage.ReplicationPolicyArgs{
    			Bucket:                pulumi.Any(replicationPolicyBucket),
    			DestinationBucketName: pulumi.Any(testBucket.Name),
    			DestinationRegionName: pulumi.Any(testRegion.Name),
    			Name:                  pulumi.Any(replicationPolicyName),
    			Namespace:             pulumi.Any(replicationPolicyNamespace),
    		})
    		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 testReplicationPolicy = new Oci.ObjectStorage.ReplicationPolicy("test_replication_policy", new()
        {
            Bucket = replicationPolicyBucket,
            DestinationBucketName = testBucket.Name,
            DestinationRegionName = testRegion.Name,
            Name = replicationPolicyName,
            Namespace = replicationPolicyNamespace,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ObjectStorage.ReplicationPolicy;
    import com.pulumi.oci.ObjectStorage.ReplicationPolicyArgs;
    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 testReplicationPolicy = new ReplicationPolicy("testReplicationPolicy", ReplicationPolicyArgs.builder()
                .bucket(replicationPolicyBucket)
                .destinationBucketName(testBucket.name())
                .destinationRegionName(testRegion.name())
                .name(replicationPolicyName)
                .namespace(replicationPolicyNamespace)
                .build());
    
        }
    }
    
    resources:
      testReplicationPolicy:
        type: oci:ObjectStorage:ReplicationPolicy
        name: test_replication_policy
        properties:
          bucket: ${replicationPolicyBucket}
          destinationBucketName: ${testBucket.name}
          destinationRegionName: ${testRegion.name}
          name: ${replicationPolicyName}
          namespace: ${replicationPolicyNamespace}
    

    Create ReplicationPolicy Resource

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

    Constructor syntax

    new ReplicationPolicy(name: string, args: ReplicationPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ReplicationPolicy(resource_name: str,
                          args: ReplicationPolicyArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ReplicationPolicy(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          bucket: Optional[str] = None,
                          destination_bucket_name: Optional[str] = None,
                          destination_region_name: Optional[str] = None,
                          namespace: Optional[str] = None,
                          delete_object_in_destination_bucket: Optional[str] = None,
                          name: Optional[str] = None)
    func NewReplicationPolicy(ctx *Context, name string, args ReplicationPolicyArgs, opts ...ResourceOption) (*ReplicationPolicy, error)
    public ReplicationPolicy(string name, ReplicationPolicyArgs args, CustomResourceOptions? opts = null)
    public ReplicationPolicy(String name, ReplicationPolicyArgs args)
    public ReplicationPolicy(String name, ReplicationPolicyArgs args, CustomResourceOptions options)
    
    type: oci:ObjectStorage:ReplicationPolicy
    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 ReplicationPolicyArgs
    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 ReplicationPolicyArgs
    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 ReplicationPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ReplicationPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ReplicationPolicyArgs
    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 replicationPolicyResource = new Oci.ObjectStorage.ReplicationPolicy("replicationPolicyResource", new()
    {
        Bucket = "string",
        DestinationBucketName = "string",
        DestinationRegionName = "string",
        Namespace = "string",
        Name = "string",
    });
    
    example, err := ObjectStorage.NewReplicationPolicy(ctx, "replicationPolicyResource", &ObjectStorage.ReplicationPolicyArgs{
    	Bucket:                pulumi.String("string"),
    	DestinationBucketName: pulumi.String("string"),
    	DestinationRegionName: pulumi.String("string"),
    	Namespace:             pulumi.String("string"),
    	Name:                  pulumi.String("string"),
    })
    
    var replicationPolicyResource = new ReplicationPolicy("replicationPolicyResource", ReplicationPolicyArgs.builder()
        .bucket("string")
        .destinationBucketName("string")
        .destinationRegionName("string")
        .namespace("string")
        .name("string")
        .build());
    
    replication_policy_resource = oci.object_storage.ReplicationPolicy("replicationPolicyResource",
        bucket="string",
        destination_bucket_name="string",
        destination_region_name="string",
        namespace="string",
        name="string")
    
    const replicationPolicyResource = new oci.objectstorage.ReplicationPolicy("replicationPolicyResource", {
        bucket: "string",
        destinationBucketName: "string",
        destinationRegionName: "string",
        namespace: "string",
        name: "string",
    });
    
    type: oci:ObjectStorage:ReplicationPolicy
    properties:
        bucket: string
        destinationBucketName: string
        destinationRegionName: string
        name: string
        namespace: string
    

    ReplicationPolicy 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 ReplicationPolicy resource accepts the following input properties:

    Bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    DestinationBucketName string
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    DestinationRegionName string
    The destination region to replicate to, for example "us-ashburn-1".
    Namespace string

    The Object Storage namespace used for the request.

    ** 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

    DeleteObjectInDestinationBucket string

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    Name string
    The name of the policy. Avoid entering confidential information.
    Bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    DestinationBucketName string
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    DestinationRegionName string
    The destination region to replicate to, for example "us-ashburn-1".
    Namespace string

    The Object Storage namespace used for the request.

    ** 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

    DeleteObjectInDestinationBucket string

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    Name string
    The name of the policy. Avoid entering confidential information.
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    destinationBucketName String
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    destinationRegionName String
    The destination region to replicate to, for example "us-ashburn-1".
    namespace String

    The Object Storage namespace used for the request.

    ** 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

    deleteObjectInDestinationBucket String

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    name String
    The name of the policy. Avoid entering confidential information.
    bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    destinationBucketName string
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    destinationRegionName string
    The destination region to replicate to, for example "us-ashburn-1".
    namespace string

    The Object Storage namespace used for the request.

    ** 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

    deleteObjectInDestinationBucket string

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    name string
    The name of the policy. Avoid entering confidential information.
    bucket str
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    destination_bucket_name str
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    destination_region_name str
    The destination region to replicate to, for example "us-ashburn-1".
    namespace str

    The Object Storage namespace used for the request.

    ** 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

    delete_object_in_destination_bucket str

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    name str
    The name of the policy. Avoid entering confidential information.
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    destinationBucketName String
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    destinationRegionName String
    The destination region to replicate to, for example "us-ashburn-1".
    namespace String

    The Object Storage namespace used for the request.

    ** 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

    deleteObjectInDestinationBucket String

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    name String
    The name of the policy. Avoid entering confidential information.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    StatusMessage string
    A human-readable description of the status.
    TimeCreated string
    The date when the replication policy was created as per RFC 3339.
    TimeLastSync string
    Changes made to the source bucket before this time has been replicated.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    StatusMessage string
    A human-readable description of the status.
    TimeCreated string
    The date when the replication policy was created as per RFC 3339.
    TimeLastSync string
    Changes made to the source bucket before this time has been replicated.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    statusMessage String
    A human-readable description of the status.
    timeCreated String
    The date when the replication policy was created as per RFC 3339.
    timeLastSync String
    Changes made to the source bucket before this time has been replicated.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    statusMessage string
    A human-readable description of the status.
    timeCreated string
    The date when the replication policy was created as per RFC 3339.
    timeLastSync string
    Changes made to the source bucket before this time has been replicated.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    status_message str
    A human-readable description of the status.
    time_created str
    The date when the replication policy was created as per RFC 3339.
    time_last_sync str
    Changes made to the source bucket before this time has been replicated.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    statusMessage String
    A human-readable description of the status.
    timeCreated String
    The date when the replication policy was created as per RFC 3339.
    timeLastSync String
    Changes made to the source bucket before this time has been replicated.

    Look up Existing ReplicationPolicy Resource

    Get an existing ReplicationPolicy 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?: ReplicationPolicyState, opts?: CustomResourceOptions): ReplicationPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket: Optional[str] = None,
            delete_object_in_destination_bucket: Optional[str] = None,
            destination_bucket_name: Optional[str] = None,
            destination_region_name: Optional[str] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None,
            status: Optional[str] = None,
            status_message: Optional[str] = None,
            time_created: Optional[str] = None,
            time_last_sync: Optional[str] = None) -> ReplicationPolicy
    func GetReplicationPolicy(ctx *Context, name string, id IDInput, state *ReplicationPolicyState, opts ...ResourceOption) (*ReplicationPolicy, error)
    public static ReplicationPolicy Get(string name, Input<string> id, ReplicationPolicyState? state, CustomResourceOptions? opts = null)
    public static ReplicationPolicy get(String name, Output<String> id, ReplicationPolicyState 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
    DeleteObjectInDestinationBucket string

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    DestinationBucketName string
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    DestinationRegionName string
    The destination region to replicate to, for example "us-ashburn-1".
    Name string
    The name of the policy. Avoid entering confidential information.
    Namespace string

    The Object Storage namespace used for the request.

    ** 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

    Status string
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    StatusMessage string
    A human-readable description of the status.
    TimeCreated string
    The date when the replication policy was created as per RFC 3339.
    TimeLastSync string
    Changes made to the source bucket before this time has been replicated.
    Bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    DeleteObjectInDestinationBucket string

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    DestinationBucketName string
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    DestinationRegionName string
    The destination region to replicate to, for example "us-ashburn-1".
    Name string
    The name of the policy. Avoid entering confidential information.
    Namespace string

    The Object Storage namespace used for the request.

    ** 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

    Status string
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    StatusMessage string
    A human-readable description of the status.
    TimeCreated string
    The date when the replication policy was created as per RFC 3339.
    TimeLastSync string
    Changes made to the source bucket before this time has been replicated.
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    deleteObjectInDestinationBucket String

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    destinationBucketName String
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    destinationRegionName String
    The destination region to replicate to, for example "us-ashburn-1".
    name String
    The name of the policy. Avoid entering confidential information.
    namespace String

    The Object Storage namespace used for the request.

    ** 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

    status String
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    statusMessage String
    A human-readable description of the status.
    timeCreated String
    The date when the replication policy was created as per RFC 3339.
    timeLastSync String
    Changes made to the source bucket before this time has been replicated.
    bucket string
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    deleteObjectInDestinationBucket string

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    destinationBucketName string
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    destinationRegionName string
    The destination region to replicate to, for example "us-ashburn-1".
    name string
    The name of the policy. Avoid entering confidential information.
    namespace string

    The Object Storage namespace used for the request.

    ** 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

    status string
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    statusMessage string
    A human-readable description of the status.
    timeCreated string
    The date when the replication policy was created as per RFC 3339.
    timeLastSync string
    Changes made to the source bucket before this time has been replicated.
    bucket str
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    delete_object_in_destination_bucket str

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    destination_bucket_name str
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    destination_region_name str
    The destination region to replicate to, for example "us-ashburn-1".
    name str
    The name of the policy. Avoid entering confidential information.
    namespace str

    The Object Storage namespace used for the request.

    ** 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

    status str
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    status_message str
    A human-readable description of the status.
    time_created str
    The date when the replication policy was created as per RFC 3339.
    time_last_sync str
    Changes made to the source bucket before this time has been replicated.
    bucket String
    The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
    deleteObjectInDestinationBucket String

    Deprecated: The 'delete_object_in_destination_bucket' field has been deprecated. It is no longer supported.

    destinationBucketName String
    The bucket to replicate to in the destination region. Replication policy creation does not automatically create a destination bucket. Create the destination bucket before creating the policy.
    destinationRegionName String
    The destination region to replicate to, for example "us-ashburn-1".
    name String
    The name of the policy. Avoid entering confidential information.
    namespace String

    The Object Storage namespace used for the request.

    ** 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

    status String
    The replication status of the policy. If the status is CLIENT_ERROR, once the user fixes the issue described in the status message, the status will become ACTIVE.
    statusMessage String
    A human-readable description of the status.
    timeCreated String
    The date when the replication policy was created as per RFC 3339.
    timeLastSync String
    Changes made to the source bucket before this time has been replicated.

    Import

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

    $ pulumi import oci:ObjectStorage/replicationPolicy:ReplicationPolicy test_replication_policy "n/{namespaceName}/b/{bucketName}/replicationPolicies/{replicationId}"
    

    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