1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. S3BucketObjectLockConfiguration
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.S3BucketObjectLockConfiguration

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.S3Bucket;
    import com.pulumi.ionoscloud.S3BucketArgs;
    import com.pulumi.ionoscloud.S3BucketObjectLockConfiguration;
    import com.pulumi.ionoscloud.S3BucketObjectLockConfigurationArgs;
    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 example = new S3Bucket("example", S3BucketArgs.builder()
                .objectLockEnabled(true)
                .build());
    
            var test = new S3BucketObjectLockConfiguration("test", S3BucketObjectLockConfigurationArgs.builder()
                .bucket(example.name())
                .objectLockEnabled("Enabled")
                .rule(S3BucketObjectLockConfigurationRuleArgs.builder()
                    .defaultRetention(S3BucketObjectLockConfigurationRuleDefaultRetentionArgs.builder()
                        .mode("GOVERNANCE")
                        .days(1)
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: ionoscloud:S3Bucket
        properties:
          objectLockEnabled: true
      test:
        type: ionoscloud:S3BucketObjectLockConfiguration
        properties:
          bucket: ${example.name}
          objectLockEnabled: Enabled
          rule:
            - defaultRetention:
                - mode: GOVERNANCE
                  days: 1
    

    Create S3BucketObjectLockConfiguration Resource

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

    Constructor syntax

    new S3BucketObjectLockConfiguration(name: string, args: S3BucketObjectLockConfigurationArgs, opts?: CustomResourceOptions);
    @overload
    def S3BucketObjectLockConfiguration(resource_name: str,
                                        args: S3BucketObjectLockConfigurationArgs,
                                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def S3BucketObjectLockConfiguration(resource_name: str,
                                        opts: Optional[ResourceOptions] = None,
                                        bucket: Optional[str] = None,
                                        object_lock_enabled: Optional[str] = None,
                                        rule: Optional[S3BucketObjectLockConfigurationRuleArgs] = None)
    func NewS3BucketObjectLockConfiguration(ctx *Context, name string, args S3BucketObjectLockConfigurationArgs, opts ...ResourceOption) (*S3BucketObjectLockConfiguration, error)
    public S3BucketObjectLockConfiguration(string name, S3BucketObjectLockConfigurationArgs args, CustomResourceOptions? opts = null)
    public S3BucketObjectLockConfiguration(String name, S3BucketObjectLockConfigurationArgs args)
    public S3BucketObjectLockConfiguration(String name, S3BucketObjectLockConfigurationArgs args, CustomResourceOptions options)
    
    type: ionoscloud:S3BucketObjectLockConfiguration
    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 S3BucketObjectLockConfigurationArgs
    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 S3BucketObjectLockConfigurationArgs
    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 S3BucketObjectLockConfigurationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args S3BucketObjectLockConfigurationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args S3BucketObjectLockConfigurationArgs
    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 s3bucketObjectLockConfigurationResource = new Ionoscloud.S3BucketObjectLockConfiguration("s3bucketObjectLockConfigurationResource", new()
    {
        Bucket = "string",
        ObjectLockEnabled = "string",
        Rule = new Ionoscloud.Inputs.S3BucketObjectLockConfigurationRuleArgs
        {
            DefaultRetention = new Ionoscloud.Inputs.S3BucketObjectLockConfigurationRuleDefaultRetentionArgs
            {
                Days = 0,
                Mode = "string",
                Years = 0,
            },
        },
    });
    
    example, err := ionoscloud.NewS3BucketObjectLockConfiguration(ctx, "s3bucketObjectLockConfigurationResource", &ionoscloud.S3BucketObjectLockConfigurationArgs{
    	Bucket:            pulumi.String("string"),
    	ObjectLockEnabled: pulumi.String("string"),
    	Rule: &ionoscloud.S3BucketObjectLockConfigurationRuleArgs{
    		DefaultRetention: &ionoscloud.S3BucketObjectLockConfigurationRuleDefaultRetentionArgs{
    			Days:  pulumi.Float64(0),
    			Mode:  pulumi.String("string"),
    			Years: pulumi.Float64(0),
    		},
    	},
    })
    
    var s3bucketObjectLockConfigurationResource = new S3BucketObjectLockConfiguration("s3bucketObjectLockConfigurationResource", S3BucketObjectLockConfigurationArgs.builder()
        .bucket("string")
        .objectLockEnabled("string")
        .rule(S3BucketObjectLockConfigurationRuleArgs.builder()
            .defaultRetention(S3BucketObjectLockConfigurationRuleDefaultRetentionArgs.builder()
                .days(0)
                .mode("string")
                .years(0)
                .build())
            .build())
        .build());
    
    s3bucket_object_lock_configuration_resource = ionoscloud.S3BucketObjectLockConfiguration("s3bucketObjectLockConfigurationResource",
        bucket="string",
        object_lock_enabled="string",
        rule={
            "default_retention": {
                "days": 0,
                "mode": "string",
                "years": 0,
            },
        })
    
    const s3bucketObjectLockConfigurationResource = new ionoscloud.S3BucketObjectLockConfiguration("s3bucketObjectLockConfigurationResource", {
        bucket: "string",
        objectLockEnabled: "string",
        rule: {
            defaultRetention: {
                days: 0,
                mode: "string",
                years: 0,
            },
        },
    });
    
    type: ionoscloud:S3BucketObjectLockConfiguration
    properties:
        bucket: string
        objectLockEnabled: string
        rule:
            defaultRetention:
                days: 0
                mode: string
                years: 0
    

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

    Bucket string
    [string] The name of the bucket where the object will be stored.
    ObjectLockEnabled string
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    Rule S3BucketObjectLockConfigurationRule
    [block] A block of rule as defined below.
    Bucket string
    [string] The name of the bucket where the object will be stored.
    ObjectLockEnabled string
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    Rule S3BucketObjectLockConfigurationRuleArgs
    [block] A block of rule as defined below.
    bucket String
    [string] The name of the bucket where the object will be stored.
    objectLockEnabled String
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    rule S3BucketObjectLockConfigurationRule
    [block] A block of rule as defined below.
    bucket string
    [string] The name of the bucket where the object will be stored.
    objectLockEnabled string
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    rule S3BucketObjectLockConfigurationRule
    [block] A block of rule as defined below.
    bucket str
    [string] The name of the bucket where the object will be stored.
    object_lock_enabled str
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    rule S3BucketObjectLockConfigurationRuleArgs
    [block] A block of rule as defined below.
    bucket String
    [string] The name of the bucket where the object will be stored.
    objectLockEnabled String
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    rule Property Map
    [block] A block of rule as defined below.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing S3BucketObjectLockConfiguration Resource

    Get an existing S3BucketObjectLockConfiguration 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?: S3BucketObjectLockConfigurationState, opts?: CustomResourceOptions): S3BucketObjectLockConfiguration
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket: Optional[str] = None,
            object_lock_enabled: Optional[str] = None,
            rule: Optional[S3BucketObjectLockConfigurationRuleArgs] = None) -> S3BucketObjectLockConfiguration
    func GetS3BucketObjectLockConfiguration(ctx *Context, name string, id IDInput, state *S3BucketObjectLockConfigurationState, opts ...ResourceOption) (*S3BucketObjectLockConfiguration, error)
    public static S3BucketObjectLockConfiguration Get(string name, Input<string> id, S3BucketObjectLockConfigurationState? state, CustomResourceOptions? opts = null)
    public static S3BucketObjectLockConfiguration get(String name, Output<String> id, S3BucketObjectLockConfigurationState state, CustomResourceOptions options)
    resources:  _:    type: ionoscloud:S3BucketObjectLockConfiguration    get:      id: ${id}
    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
    [string] The name of the bucket where the object will be stored.
    ObjectLockEnabled string
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    Rule S3BucketObjectLockConfigurationRule
    [block] A block of rule as defined below.
    Bucket string
    [string] The name of the bucket where the object will be stored.
    ObjectLockEnabled string
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    Rule S3BucketObjectLockConfigurationRuleArgs
    [block] A block of rule as defined below.
    bucket String
    [string] The name of the bucket where the object will be stored.
    objectLockEnabled String
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    rule S3BucketObjectLockConfigurationRule
    [block] A block of rule as defined below.
    bucket string
    [string] The name of the bucket where the object will be stored.
    objectLockEnabled string
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    rule S3BucketObjectLockConfigurationRule
    [block] A block of rule as defined below.
    bucket str
    [string] The name of the bucket where the object will be stored.
    object_lock_enabled str
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    rule S3BucketObjectLockConfigurationRuleArgs
    [block] A block of rule as defined below.
    bucket String
    [string] The name of the bucket where the object will be stored.
    objectLockEnabled String
    [Optional] The object lock configuration status of the bucket. Must be Enabled.
    rule Property Map
    [block] A block of rule as defined below.

    Supporting Types

    S3BucketObjectLockConfigurationRule, S3BucketObjectLockConfigurationRuleArgs

    DefaultRetention S3BucketObjectLockConfigurationRuleDefaultRetention
    [block] A block of default_retention as defined below.
    DefaultRetention S3BucketObjectLockConfigurationRuleDefaultRetention
    [block] A block of default_retention as defined below.
    defaultRetention S3BucketObjectLockConfigurationRuleDefaultRetention
    [block] A block of default_retention as defined below.
    defaultRetention S3BucketObjectLockConfigurationRuleDefaultRetention
    [block] A block of default_retention as defined below.
    default_retention S3BucketObjectLockConfigurationRuleDefaultRetention
    [block] A block of default_retention as defined below.
    defaultRetention Property Map
    [block] A block of default_retention as defined below.

    S3BucketObjectLockConfigurationRuleDefaultRetention, S3BucketObjectLockConfigurationRuleDefaultRetentionArgs

    Days double
    [int] The default retention period of the bucket in days.
    Mode string
    [string] The default retention mode of the bucket. Can be GOVERNANCE or COMPLIANCE.
    Years double

    [int] The default retention period of the bucket in years.

    Days and years are mutually exclusive. You can only specify one of them.

    Days float64
    [int] The default retention period of the bucket in days.
    Mode string
    [string] The default retention mode of the bucket. Can be GOVERNANCE or COMPLIANCE.
    Years float64

    [int] The default retention period of the bucket in years.

    Days and years are mutually exclusive. You can only specify one of them.

    days Double
    [int] The default retention period of the bucket in days.
    mode String
    [string] The default retention mode of the bucket. Can be GOVERNANCE or COMPLIANCE.
    years Double

    [int] The default retention period of the bucket in years.

    Days and years are mutually exclusive. You can only specify one of them.

    days number
    [int] The default retention period of the bucket in days.
    mode string
    [string] The default retention mode of the bucket. Can be GOVERNANCE or COMPLIANCE.
    years number

    [int] The default retention period of the bucket in years.

    Days and years are mutually exclusive. You can only specify one of them.

    days float
    [int] The default retention period of the bucket in days.
    mode str
    [string] The default retention mode of the bucket. Can be GOVERNANCE or COMPLIANCE.
    years float

    [int] The default retention period of the bucket in years.

    Days and years are mutually exclusive. You can only specify one of them.

    days Number
    [int] The default retention period of the bucket in days.
    mode String
    [string] The default retention mode of the bucket. Can be GOVERNANCE or COMPLIANCE.
    years Number

    [int] The default retention period of the bucket in years.

    Days and years are mutually exclusive. You can only specify one of them.

    Import

    IONOS Object Storage Bucket object lock configuration can be imported using the bucket name.

    $ pulumi import ionoscloud:index/s3BucketObjectLockConfiguration:S3BucketObjectLockConfiguration example example
    

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

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud